mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 03:08:40 +00:00
* Lint all js files Closes #2414 * Lint inline scripts in workflow * Upgrade eslint-plugin-actions to 1.0.1 Test plan: 1. Add `console` statement to the script in `.github/workflows/ci.yml` 2. Check `no-console` error is shown in `eslint`
113 lines
3.6 KiB
Plaintext
113 lines
3.6 KiB
Plaintext
{
|
|
"parser": "babel-eslint",
|
|
"plugins": [
|
|
"flowtype"
|
|
],
|
|
"extends": [
|
|
"eslint:recommended",
|
|
"plugin:flowtype/recommended",
|
|
"plugin:actions/recommended"
|
|
],
|
|
"rules": {
|
|
"arrow-spacing": 2,
|
|
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
|
|
// We'd possibly like to remove the 'properties': 'never' one day.
|
|
"camelcase": [2, { "properties": "never" }],
|
|
"comma-dangle": [2, "always-multiline"],
|
|
"comma-spacing": [2, { "before": false, "after": true }],
|
|
"constructor-super": 2,
|
|
"curly": 2,
|
|
"eol-last": 2,
|
|
"eqeqeq": [2, "allow-null"],
|
|
"guard-for-in": 2,
|
|
"indent": "off",
|
|
"indent-legacy": [2, 4, {"SwitchCase": 1}],
|
|
"keyword-spacing": 2,
|
|
"linebreak-style": [2, "unix"],
|
|
"max-len": [2, 84, 4, { "ignoreUrls": true, "ignorePattern": "\\brequire\\([\"']|eslint-disable" }],
|
|
"new-cap": 2,
|
|
"no-alert": 2,
|
|
"no-array-constructor": 2,
|
|
"no-console": 2,
|
|
"no-const-assign": 2,
|
|
"no-debugger": 2,
|
|
"no-dupe-class-members": 2,
|
|
"no-dupe-keys": 2,
|
|
"no-extra-bind": 2,
|
|
"no-new": 2,
|
|
"no-new-func": 2,
|
|
"no-new-object": 2,
|
|
"no-prototype-builtins": 0,
|
|
"no-spaced-func": 2,
|
|
"no-this-before-super": 2,
|
|
"no-throw-literal": 2,
|
|
"no-trailing-spaces": 2,
|
|
"no-undef": 2,
|
|
"no-unexpected-multiline": 2,
|
|
"no-unreachable": 2,
|
|
"no-unused-vars": [2, {"args": "none", "varsIgnorePattern": "^_*$"}],
|
|
"no-useless-call": 2,
|
|
"no-var": 2,
|
|
"no-with": 2,
|
|
"object-curly-spacing": [2, "never"],
|
|
"one-var": [2, "never"],
|
|
"prefer-const": 2,
|
|
"prefer-spread": 0, // re-enable once we use es6
|
|
"semi": [2, "always"],
|
|
"space-before-blocks": 2,
|
|
"space-before-function-paren": [2, "never"],
|
|
"space-infix-ops": 2,
|
|
"space-unary-ops": 2,
|
|
// ---------------------------------------
|
|
// Stuff we explicitly disable.
|
|
// We turned this off because it complains when you have a
|
|
// multi-line string, which I think is going too far.
|
|
"prefer-template": 0,
|
|
// We've decided explicitly not to care about this.
|
|
"arrow-parens": 0,
|
|
// ---------------------------------------
|
|
// TODO(csilvers): enable these if/when community agrees on it.
|
|
"prefer-arrow-callback": 0,
|
|
// Might be nice to turn this on one day, but since we don't
|
|
// use jsdoc anywhere it seems silly to require it yet.
|
|
"valid-jsdoc": 0,
|
|
"require-jsdoc": 0
|
|
},
|
|
"env": {
|
|
"es6": true,
|
|
"node": true,
|
|
"browser": true,
|
|
"jest": true
|
|
},
|
|
"settings": {
|
|
"react": {
|
|
"version": "16.8"
|
|
}
|
|
},
|
|
"overrides": [{
|
|
"files": ["katex.js", "src/**/*.js", "contrib/**/*.js"],
|
|
"excludedFiles": ["*-spec.js", "unicodeAccents.js", "unicodeSymbols.js"],
|
|
"rules": {
|
|
"no-restricted-syntax": [2, "ForOfStatement", "ClassDeclaration[superClass]", "ClassExpression[superClass]"]
|
|
},
|
|
"env": {
|
|
"node": false,
|
|
"jest": false
|
|
}
|
|
}, {
|
|
"files": ["website/**/*.js"],
|
|
"extends": [
|
|
"plugin:react/recommended"
|
|
],
|
|
"rules": {
|
|
"react/prop-types": 0
|
|
}
|
|
}, {
|
|
"files": [".github/workflows/*.{yaml,yml}/**/*.js"],
|
|
"rules": {
|
|
"indent-legacy": [2, 4, {"SwitchCase": 1, "outerIIFEBody": 0}],
|
|
}
|
|
}],
|
|
"root": true
|
|
}
|