|
| 1 | +/** |
| 2 | + * @file .eslintrc.js - ESLint configuration file, following the Core Team's JS Style Guide. |
| 3 | + * @author Wes Garland <[email protected]> |
| 4 | + * @date Mar. 2022, July 2023 |
| 5 | + */ |
| 6 | + |
| 7 | +/** |
| 8 | + * @see {@link https://eslint.org/docs/latest/use/configure/} |
| 9 | + * @type {import('eslint').Linter.Config} |
| 10 | + */ |
| 11 | +module.exports = { |
| 12 | + extends: 'eslint:recommended', |
| 13 | + globals: { |
| 14 | + 'python': true |
| 15 | + }, |
| 16 | + env: { |
| 17 | + browser: true, |
| 18 | + commonjs: true, |
| 19 | + es2021: true, |
| 20 | + node: true |
| 21 | + }, |
| 22 | + parserOptions: { |
| 23 | + ecmaVersion: 13, |
| 24 | + sourceType: 'script', |
| 25 | + }, |
| 26 | + rules: { |
| 27 | + 'indent': [ 'warn', 2, { |
| 28 | + SwitchCase: 1, |
| 29 | + ignoredNodes: ['CallExpression', 'ForStatement'], |
| 30 | + } |
| 31 | + ], |
| 32 | + 'linebreak-style': [ 'error', 'unix' ], |
| 33 | + 'quotes': [ 'warn', 'single' ], |
| 34 | + 'func-call-spacing': [ 'off', 'never' ], |
| 35 | + 'no-prototype-builtins': 'off', |
| 36 | + 'quotes': ['warn', 'single', 'avoid-escape'], |
| 37 | + 'no-empty': [ 'warn' ], |
| 38 | + 'no-multi-spaces': [ 'off' ], |
| 39 | + 'prettier/prettier': [ 'off' ], |
| 40 | + 'vars-on-top': [ 'error' ], |
| 41 | + 'no-var': [ 'off' ], |
| 42 | + 'spaced-comment': [ 'warn' ], |
| 43 | + 'brace-style': [ 'off' ], |
| 44 | + 'no-eval': [ 'error' ], |
| 45 | + 'object-curly-spacing': [ 'warn', 'always' ], |
| 46 | + 'eqeqeq': [ 'warn', 'always' ], |
| 47 | + 'no-dupe-keys': [ 'warn' ], |
| 48 | + 'no-constant-condition': [ 'warn' ], |
| 49 | + 'no-extra-boolean-cast': [ 'warn' ], |
| 50 | + 'no-sparse-arrays': [ 'off' ], |
| 51 | + 'no-inner-declarations': [ 'off' ], |
| 52 | + 'no-loss-of-precision': [ 'warn' ], |
| 53 | + 'require-atomic-updates': [ 'warn' ], |
| 54 | + 'no-dupe-keys': [ 'warn' ], |
| 55 | + 'no-dupe-class-members': [ 'warn' ], |
| 56 | + 'no-fallthrough': [ 'warn', { commentPattern: 'fall[ -]*through' }], |
| 57 | + 'no-invalid-this': [ 'error' ], |
| 58 | + 'no-return-assign': [ 'error' ], |
| 59 | + 'no-return-await': [ 'warn' ], |
| 60 | + 'no-unused-expressions': [ 'warn', { allowShortCircuit: true, allowTernary: true } ], |
| 61 | + 'prefer-promise-reject-errors': [ 'error' ], |
| 62 | + 'no-throw-literal': [ 'error' ], |
| 63 | + 'semi': [ 'off', { omitLastInOneLineBlock: true }], /* does not work right with exports.X = function allmanStyle */ |
| 64 | + 'semi-style': [ 'warn', 'last' ], |
| 65 | + 'semi-spacing': [ 'error', {'before': false, 'after': true}], |
| 66 | + 'no-extra-semi': [ 'warn' ], |
| 67 | + 'no-tabs': [ 'error' ], |
| 68 | + 'symbol-description': [ 'error' ], |
| 69 | + 'operator-linebreak': [ 'warn', 'before' ], |
| 70 | + 'new-cap': [ 'warn' ], |
| 71 | + 'consistent-this': [ 'error', 'that' ], |
| 72 | + 'no-use-before-define': [ 'error', { functions: false, classes: false } ], |
| 73 | + 'no-shadow': [ 'error' ], |
| 74 | + 'no-label-var': [ 'error' ], |
| 75 | + 'radix': [ 'error' ], |
| 76 | + 'no-self-compare': [ 'error' ], |
| 77 | + 'require-await': [ 'error' ], |
| 78 | + 'require-yield': [ 'error' ], |
| 79 | + 'no-promise-executor-return': [ 'off' ], |
| 80 | + 'no-template-curly-in-string': [ 'warn' ], |
| 81 | + 'no-unmodified-loop-condition': [ 'warn' ], |
| 82 | + 'no-unused-private-class-members': [ 'warn' ], |
| 83 | + 'no-use-before-define': [ 'error', { functions: false, classes: true, variables: true }], |
| 84 | + 'no-implicit-coercion': [1, { |
| 85 | + disallowTemplateShorthand: false, |
| 86 | + boolean: true, |
| 87 | + number: true, |
| 88 | + string: true, |
| 89 | + allow: ['!!'] /* really only want to allow if(x) and if(!x) but not if(!!x) */ |
| 90 | + }], |
| 91 | + 'no-trailing-spaces': [ 'off', { |
| 92 | + skipBlankLines: true, |
| 93 | + ignoreComments: true |
| 94 | + } |
| 95 | + ], |
| 96 | + 'no-unused-vars': ['warn', { |
| 97 | + vars: 'all', |
| 98 | + args: 'none', |
| 99 | + ignoreRestSiblings: false |
| 100 | + }], |
| 101 | + } |
| 102 | +}; |
0 commit comments