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,
"mocha": true
},
"globals": {
"expect": true,
"define": true,
"$": true,
"angular": true,
// Injected in layout.pug
"user_id": true,
"ace": true
},
"settings": {
// Tell eslint-plugin-react to detect which version of React we are using
"react": {
@ -59,7 +50,11 @@
},
"overrides": [
{
// Test specific rules
"files": ["**/test/*/src/**/*.js"],
"globals": {
"expect": true
},
"rules": {
// mocha-specific rules
"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"],
"rules": {
// don't allow console.log in backend code
"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) {
define([], load)
} else {
module.exports = load()
}

View file

@ -1,4 +1,4 @@
/* global MathJax, _ */
/* global MathJax */
define(['base'], function(App) {
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
*/
/* global io sl_console sl_debugging */
/* global io */
define([], function() {
let ConnectionManager

View file

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

View file

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

View file

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

View file

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

View file

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