eslint: some changes for things everyone ignores anyway
these were all things gergich gives warnings for that everyone ignores anyway. it is better to turn silly stuff off than to train people to ignore gergich warnings Change-Id: I0bc1f807c8c44c0fe6b180126cf8f6e9d14b1797 Reviewed-on: https://gerrit.instructure.com/147815 Reviewed-by: Clay Diffrient <cdiffrient@instructure.com> Tested-by: Jenkins Product-Review: Ryan Shaw <ryan@instructure.com> QA-Review: Ryan Shaw <ryan@instructure.com>
This commit is contained in:
parent
46f5e3f7c0
commit
d9bfbe973d
33
.eslintrc.js
33
.eslintrc.js
|
@ -40,33 +40,21 @@ module.exports = {
|
|||
"max-len": [1, {"code": 140}],
|
||||
"no-continue": [0],
|
||||
"react/no-typos": [0],
|
||||
"no-cond-assign": ["warn", {"except-parens": true}],
|
||||
"no-else-return": [0],
|
||||
"no-plusplus": [0],
|
||||
"no-return-assign": ['error', 'except-parens'],
|
||||
"no-underscore-dangle": [0],
|
||||
"no-unused-vars": [2, { "argsIgnorePattern": "^_"}],
|
||||
"no-use-before-define": "off",
|
||||
"one-var": ["error", { initialized: "never" }], // allow `let foo, bar` but not `let foo=1, bar=2`
|
||||
"object-curly-spacing": [0],
|
||||
"prefer-destructuring": [
|
||||
"error",
|
||||
{
|
||||
VariableDeclarator: {
|
||||
array: true, // allow `let [bar] = foo`; reject `let bar = foo[0]`
|
||||
object: true // allow `let { bar: foo } = object`; reject `let foo = object.bar`
|
||||
},
|
||||
AssignmentExpression: {
|
||||
array: false, // allow `let bar; bar = foo[0]`; this matters for conditional assignment
|
||||
object: false // allow `let bar; bar = foo.bar`; this matters for conditional assignment
|
||||
}
|
||||
}
|
||||
],
|
||||
"prefer-destructuring": "off",
|
||||
"padded-blocks": [0], // so we can have space between the define([... and the callback
|
||||
"semi": [0],
|
||||
"import/no-extraneous-dependencies": [0], // allows 'i18n!webzip_exports' and 'compiled/foo/bar'
|
||||
"import/named": [2],
|
||||
"import/no-unresolved": [0],
|
||||
"import/no-webpack-loader-syntax": [0],
|
||||
"import/no-commonjs": [2],
|
||||
"import/no-extraneous-dependencies": ["error", {"devDependencies": true}],
|
||||
"import/no-commonjs": "off",
|
||||
"jest/prefer-to-be-null": "error",
|
||||
"jest/prefer-to-be-undefined": "error",
|
||||
"react/jsx-filename-extension": [2, { "extensions": [".js"] }],
|
||||
|
@ -78,6 +66,17 @@ module.exports = {
|
|||
mustMatch: 'Copyright '
|
||||
}],
|
||||
"promise/avoid-new": [0],
|
||||
},
|
||||
overrides: {
|
||||
files: ['app/**/*', 'spec/**/*', 'public/**/*'],
|
||||
rules: {
|
||||
"import/no-amd": "error",
|
||||
"import/no-commonjs": "error",
|
||||
"import/no-extraneous-dependencies": "off", // allows 'i18n!webzip_exports' and 'compiled/foo/bar'
|
||||
"import/no-nodejs-modules": "error",
|
||||
"import/no-unresolved": "off",
|
||||
"import/no-webpack-loader-syntax": "off"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue