|
| 1 | +module.exports = { |
| 2 | + env: { |
| 3 | + browser: true, |
| 4 | + commonjs: true, |
| 5 | + es2021: true, |
| 6 | + }, |
| 7 | + extends: 'eslint:recommended', |
| 8 | + parserOptions: { |
| 9 | + ecmaVersion: 13, |
| 10 | + }, |
| 11 | + globals: { |
| 12 | + process: 'readonly', |
| 13 | + }, |
| 14 | + rules: { |
| 15 | + 'no-extend-native': [ 'error', { exceptions: [ 'Array' ] } ], |
| 16 | + 'no-global-assign': [ 'error', { exceptions: [ 'self' ] } ], |
| 17 | + 'generator-star-spacing': 'off', |
| 18 | + // eslint-disable-next-line no-undef |
| 19 | + 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', |
| 20 | + 'no-trailing-spaces': [ 'error', { skipBlankLines: true } ], |
| 21 | + 'array-bracket-spacing': [ 'error', 'always' ], |
| 22 | + 'arrow-body-style': [ 'warn', 'as-needed' ], |
| 23 | + 'standard/no-callback-literal': 0, |
| 24 | + 'comma-dangle': [ |
| 25 | + 'warn', |
| 26 | + { |
| 27 | + arrays: 'always-multiline', |
| 28 | + objects: 'always-multiline', |
| 29 | + imports: 'never', |
| 30 | + exports: 'never', |
| 31 | + functions: 'ignore', |
| 32 | + }, |
| 33 | + ], |
| 34 | + 'curly': [ 'warn', 'multi-line' ], |
| 35 | + 'eol-last': [ 'error', 'always' ], |
| 36 | + 'indent': [ 'error', 2, { SwitchCase: 1, VariableDeclarator: 1 } ], |
| 37 | + 'max-len': [ |
| 38 | + 'warn', |
| 39 | + { |
| 40 | + code: 140, |
| 41 | + ignoreComments: true, |
| 42 | + ignoreTrailingComments: true, |
| 43 | + ignoreStrings: true, |
| 44 | + ignorePattern: '.+=".+"', |
| 45 | + }, |
| 46 | + ], |
| 47 | + 'no-multiple-empty-lines': [ 'error', { max: 1, maxEOF: 1 } ], |
| 48 | + 'no-prototype-builtins': 0, |
| 49 | + 'object-curly-spacing': [ 'error', 'always' ], |
| 50 | + 'object-property-newline': [ 'error', { allowAllPropertiesOnSameLine: true } ], |
| 51 | + 'padded-blocks': 'off', |
| 52 | + 'prefer-const': [ 'error', { destructuring : 'all' } ], |
| 53 | + 'prefer-template': 'error', |
| 54 | + 'quote-props': [ 'error', 'consistent-as-needed' ], |
| 55 | + 'quotes': [ |
| 56 | + 'error', |
| 57 | + 'single', |
| 58 | + { |
| 59 | + avoidEscape: true, |
| 60 | + // TODO: Remove this rule and autofix, |
| 61 | + // as we don't need useless template literals |
| 62 | + allowTemplateLiterals: true, |
| 63 | + }, |
| 64 | + ], |
| 65 | + 'semi': [ 'error', 'never', { beforeStatementContinuationChars: 'never' } ], |
| 66 | + 'space-before-function-paren': [ 'warn', 'always' ], |
| 67 | + 'spaced-comment': [ |
| 68 | + 'error', |
| 69 | + 'always', |
| 70 | + { |
| 71 | + block: { |
| 72 | + markers: [ '!' ], |
| 73 | + }, |
| 74 | + }, |
| 75 | + ], |
| 76 | + }, |
| 77 | +} |
0 commit comments