1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
| const IS_PROD = process.env.NODE_ENV === 'production' ? 2 : 0 module.exports = { root: true, globals: { }, env: { browser: true, es6: true, commonjs: true, node: true, mocha: true, jest: true, }, extends: [ 'eslint:recommended', ], plugins: [ ], parserOptions: { ecmaVersion: new Date().getFullYear(), sourceType: 'module', ecmaFeatures: { modules: true, jsx: true, }, }, rules: { 'arrow-body-style': [IS_PROD, 'as-needed'], 'arrow-parens': [2, 'as-needed', { requireForBlockBody: false }], 'arrow-spacing': [2, { before: true, after: true }], 'block-spacing': [2, 'always'], 'brace-style': 2, 'comma-dangle': [2, 'always-multiline'], 'comma-spacing': [2, { before: false, after: true }], curly: [2, 'all'], 'eol-last': [IS_PROD, 'never'], eqeqeq: [2], 'func-style': [2, 'declaration', { allowArrowFunctions: true }], 'handle-callback-err:': [0, '^(e|err|error)$'], 'implicit-arrow-linebreak': [2, 'beside'], indent: [2, 4, { SwitchCase: 1 }], 'key-spacing': [2, { beforeColon: false, afterColon: true }], 'keyword-spacing': [2, { before: true, after: true }], 'linebreak-style': [2, 'unix'], 'new-cap': [0], 'no-buffer-constructor': [2], 'no-confusing-arrow': [2, { allowParens: true }], 'no-console': [IS_PROD, { allow: ['warn', 'error'] }], 'no-debugger': [IS_PROD], 'no-duplicate-imports': [2], 'no-else-return': [2, { allowElseIf: false, }], 'no-empty': [1], 'no-eval': [2], 'no-extend-native': [2, { exceptions: [] }], 'no-extra-boolean-cast': [2], 'no-extra-parens': [2], 'no-lonely-if': [2], 'no-magic-numbers': [0, { ignore: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], ignoreArrayIndexes: true, enforceConst: false, detectObjects: false, }], 'no-mixed-requires': [2], 'no-multi-spaces': [2, { ignoreEOLComments: true }], 'no-multiple-empty-lines': [IS_PROD, { max: 1 }], 'no-nested-ternary': [2], 'no-new-require': [2], 'no-new-wrappers': [2], 'no-path-concat': [2], 'no-redeclare': [2, { builtinGlobals: true }], 'no-return-assign': [2], 'no-return-await': [IS_PROD], 'no-shadow': [2], 'no-sync': [1], 'no-trailing-spaces': [0], 'no-unneeded-ternary': [2], 'no-unused-vars': [1], 'no-use-before-define': [0], 'no-useless-constructor': [IS_PROD], 'no-useless-return': [IS_PROD], 'no-var': [2], 'max-params': [2, { max: 5 }], 'object-curly-spacing': [2, 'always'], 'object-shorthand': [2], 'object-property-newline': [2, { allowAllPropertiesOnSameLine: true }], 'operator-assignment': [2], 'padded-blocks': [0], 'prefer-arrow-callback': [2], 'prefer-const': [IS_PROD], 'prefer-rest-params': [2], 'prefer-template': [2], 'quote-props': [2, 'as-needed', { keywords: false, numbers: true }], quotes: [2, 'single'], 'require-await': [0], semi: [2, 'never'], 'semi-style': [2, 'last'], 'space-before-function-paren': [2, { anonymous: 'never', named: 'never', asyncArrow: 'always', }], 'space-infix-ops': [2], 'spaced-comment': [2, 'always'], 'template-curly-spacing': [2, 'never'], }, }
|