Merge pull request #2218 from overleaf/as-eslint-globals

Move around eslint globals

GitOrigin-RevId: 81144a0b763159b9425aff673211c07ec65b3be5
This commit is contained in:
Eric Mc Sween 2019-10-14 09:17:30 -04:00 committed by sharelatex
parent 7db9e73ecf
commit ed7b5a9450
9 changed files with 36 additions and 22 deletions

View file

@ -19,15 +19,6 @@
"browser": true, "browser": true,
"mocha": true "mocha": true
}, },
"globals": {
"expect": true,
"define": true,
"$": true,
"angular": true,
// Injected in layout.pug
"user_id": true,
"ace": true
},
"settings": { "settings": {
// Tell eslint-plugin-react to detect which version of React we are using // Tell eslint-plugin-react to detect which version of React we are using
"react": { "react": {
@ -59,7 +50,11 @@
}, },
"overrides": [ "overrides": [
{ {
// Test specific rules
"files": ["**/test/*/src/**/*.js"], "files": ["**/test/*/src/**/*.js"],
"globals": {
"expect": true
},
"rules": { "rules": {
// mocha-specific rules // mocha-specific rules
"mocha/handle-done-callback": "error", "mocha/handle-done-callback": "error",
@ -82,11 +77,38 @@
} }
}, },
{ {
// don't allow console.log in backend code // Frontend test specific rules
"files": ["**/test/unit_frontend/{src,es}/**/*.js"],
"globals": {
"expect": true,
"define": true,
"$": true
}
},
{
// Backend specific rules
"files": ["**/app/*/src/**/*.js"], "files": ["**/app/*/src/**/*.js"],
"rules": { "rules": {
// don't allow console.log in backend code
"no-console": "error" "no-console": "error"
} }
},
{
// Frontend specific rules
"files": ["**/public/{src,es}/**/*.js"],
"globals": {
"define": true,
"$": true,
"angular": true,
"_": true,
"ace": true,
"ga": true,
"AlgoliaSearch": true,
"sl_console": true,
"sl_debugging": true,
// Injected in layout.pug
"user_id": true
}
} }
] ]
} }

View file

@ -128,8 +128,4 @@ prototype\
}) })
} }
if (typeof define !== 'undefined' && define !== null) { module.exports = load()
define([], load)
} else {
module.exports = load()
}

View file

@ -1,4 +1,4 @@
/* global MathJax, _ */ /* global MathJax */
define(['base'], function(App) { define(['base'], function(App) {
return App.directive('mathjax', function($compile, $parse) { return App.directive('mathjax', function($compile, $parse) {

View file

@ -8,7 +8,7 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/ */
/* global io sl_console sl_debugging */ /* global io */
define([], function() { define([], function() {
let ConnectionManager let ConnectionManager

View file

@ -1,4 +1,3 @@
/* global _ */
/* eslint-disable /* eslint-disable
camelcase, camelcase,
max-len max-len

View file

@ -1,4 +1,3 @@
/* global _ */
define([ define([
'ide/editor/directives/aceEditor/auto-complete/CommandManager', 'ide/editor/directives/aceEditor/auto-complete/CommandManager',
'ide/editor/directives/aceEditor/auto-complete/EnvironmentManager', 'ide/editor/directives/aceEditor/auto-complete/EnvironmentManager',

View file

@ -1,4 +1,3 @@
/* global _ */
define(['base'], App => define(['base'], App =>
App.factory('files', function(ide) { App.factory('files', function(ide) {
const Files = { const Files = {

View file

@ -3,7 +3,7 @@
max-len, max-len,
no-return-assign no-return-assign
*/ */
/* global recurly,_,define */ /* global recurly */
define(['base', 'directives/creditCards'], App => define(['base', 'directives/creditCards'], App =>
App.controller('NewSubscriptionController', function( App.controller('NewSubscriptionController', function(
$scope, $scope,

View file

@ -2,7 +2,6 @@
camelcase, camelcase,
max-len max-len
*/ */
/* global define,history */
define(['base'], function(App) { define(['base'], function(App) {
App.factory('MultiCurrencyPricing', function() { App.factory('MultiCurrencyPricing', function() {
const currencyCode = window.recomendedCurrency const currencyCode = window.recomendedCurrency