|
| 1 | +'use strict'; |
| 2 | + |
| 3 | +module.exports = { |
| 4 | + root: true, |
| 5 | + extends: 'eslint:recommended', |
| 6 | + |
| 7 | + env: { |
| 8 | + commonjs: true, |
| 9 | + es2023: true, |
| 10 | + mocha: true, |
| 11 | + node: true |
| 12 | + }, |
| 13 | + |
| 14 | + parserOptions: { |
| 15 | + ecmaVersion: 'latest', |
| 16 | + sourceType: 'script', |
| 17 | + requireConfigFile: false |
| 18 | + }, |
| 19 | + |
| 20 | + rules: { |
| 21 | + 'accessor-pairs': 2, |
| 22 | + 'array-bracket-newline': [1, 'consistent'], |
| 23 | + 'array-bracket-spacing': [1, 'never'], |
| 24 | + 'array-callback-return': 1, |
| 25 | + 'array-element-newline': [1, 'consistent'], |
| 26 | + 'arrow-body-style': 0, |
| 27 | + 'arrow-parens': [1, 'as-needed'], |
| 28 | + 'arrow-spacing': [1, { before: true, after: true }], |
| 29 | + 'block-scoped-var': 1, |
| 30 | + 'block-spacing': [1, 'always'], |
| 31 | + 'brace-style': [1, '1tbs', { allowSingleLine: true }], |
| 32 | + 'callback-return': 0, |
| 33 | + 'camelcase': [0, { allow: [] }], |
| 34 | + 'capitalized-comments': 0, |
| 35 | + 'class-methods-use-this': 0, |
| 36 | + 'comma-dangle': [1, 'never'], |
| 37 | + 'comma-spacing': [1, { before: false, after: true }], |
| 38 | + 'comma-style': [1, 'last'], |
| 39 | + 'complexity': 1, |
| 40 | + 'computed-property-spacing': 1, |
| 41 | + 'consistent-return': 0, |
| 42 | + 'consistent-this': 1, |
| 43 | + 'constructor-super': 2, |
| 44 | + 'curly': [1, 'multi-line', 'consistent'], |
| 45 | + 'default-case': 1, |
| 46 | + 'dot-location': [1, 'property'], |
| 47 | + 'dot-notation': 1, |
| 48 | + 'eol-last': 1, |
| 49 | + 'eqeqeq': [1, 'allow-null'], |
| 50 | + 'for-direction': 1, |
| 51 | + 'func-call-spacing': 2, |
| 52 | + 'generator-star-spacing': [1, { before: true, after: true }], |
| 53 | + 'handle-callback-err': [2, '^(err|error)$'], |
| 54 | + 'indent': [1, 2, { SwitchCase: 1 }], |
| 55 | + 'key-spacing': [1, { beforeColon: false, afterColon: true }], |
| 56 | + 'keyword-spacing': [1, { before: true, after: true }], |
| 57 | + 'linebreak-style': [1, 'unix'], |
| 58 | + 'new-cap': [1, { newIsCap: true, capIsNew: false }], |
| 59 | + 'new-parens': 2, |
| 60 | + 'no-alert': 1, |
| 61 | + 'no-array-constructor': 1, |
| 62 | + 'no-async-promise-executor': 1, |
| 63 | + 'no-caller': 2, |
| 64 | + 'no-case-declarations': 1, |
| 65 | + 'no-class-assign': 2, |
| 66 | + 'no-cond-assign': 2, |
| 67 | + 'no-console': 0, |
| 68 | + 'no-const-assign': 2, |
| 69 | + 'no-constant-condition': [1, { checkLoops: false }], |
| 70 | + 'no-control-regex': 2, |
| 71 | + 'no-debugger': 2, |
| 72 | + 'no-delete-var': 2, |
| 73 | + 'no-dupe-args': 2, |
| 74 | + 'no-dupe-class-members': 2, |
| 75 | + 'no-dupe-keys': 2, |
| 76 | + 'no-duplicate-case': 2, |
| 77 | + 'no-duplicate-imports': 1, |
| 78 | + 'no-else-return': 0, |
| 79 | + 'no-empty-character-class': 2, |
| 80 | + 'no-empty-function': 0, |
| 81 | + 'no-empty-pattern': 0, |
| 82 | + 'no-empty': [1, { allowEmptyCatch: true }], |
| 83 | + 'no-eval': 0, |
| 84 | + 'no-ex-assign': 2, |
| 85 | + 'no-extend-native': 2, |
| 86 | + 'no-extra-bind': 1, |
| 87 | + 'no-extra-boolean-cast': 1, |
| 88 | + 'no-extra-label': 1, |
| 89 | + 'no-extra-parens': [1, 'all', { conditionalAssign: false, returnAssign: false, nestedBinaryExpressions: false, ignoreJSX: 'multi-line', enforceForArrowConditionals: false }], |
| 90 | + 'no-extra-semi': 1, |
| 91 | + 'no-fallthrough': 2, |
| 92 | + 'no-floating-decimal': 2, |
| 93 | + 'no-func-assign': 2, |
| 94 | + 'no-global-assign': 2, |
| 95 | + 'no-implicit-coercion': 2, |
| 96 | + 'no-implicit-globals': 1, |
| 97 | + 'no-implied-eval': 2, |
| 98 | + 'no-inner-declarations': [1, 'functions'], |
| 99 | + 'no-invalid-regexp': 2, |
| 100 | + 'no-invalid-this': 1, |
| 101 | + 'no-irregular-whitespace': 2, |
| 102 | + 'no-iterator': 2, |
| 103 | + 'no-label-var': 2, |
| 104 | + 'no-labels': 2, |
| 105 | + 'no-lone-blocks': 2, |
| 106 | + 'no-lonely-if': 2, |
| 107 | + 'no-loop-func': 1, |
| 108 | + 'no-mixed-requires': 1, |
| 109 | + 'no-mixed-spaces-and-tabs': 2, |
| 110 | + 'no-multi-assign': 1, |
| 111 | + 'no-multi-spaces': 1, |
| 112 | + 'no-multi-str': 2, |
| 113 | + 'no-multiple-empty-lines': [1, { max: 1 }], |
| 114 | + 'no-native-reassign': 2, |
| 115 | + 'no-negated-condition': 0, |
| 116 | + 'no-negated-in-lhs': 2, |
| 117 | + 'no-new-func': 2, |
| 118 | + 'no-new-object': 2, |
| 119 | + 'no-new-require': 2, |
| 120 | + 'no-new-symbol': 1, |
| 121 | + 'no-new-wrappers': 2, |
| 122 | + 'no-new': 1, |
| 123 | + 'no-obj-calls': 2, |
| 124 | + 'no-octal-escape': 2, |
| 125 | + 'no-octal': 2, |
| 126 | + 'no-path-concat': 1, |
| 127 | + 'no-proto': 2, |
| 128 | + 'no-prototype-builtins': 0, |
| 129 | + 'no-redeclare': 2, |
| 130 | + 'no-regex-spaces': 2, |
| 131 | + 'no-restricted-globals': 2, |
| 132 | + 'no-return-assign': 1, |
| 133 | + 'no-return-await': 2, |
| 134 | + 'no-script-url': 1, |
| 135 | + 'no-self-assign': 1, |
| 136 | + 'no-self-compare': 1, |
| 137 | + 'no-sequences': 2, |
| 138 | + 'no-shadow-restricted-names': 2, |
| 139 | + 'no-shadow': 0, |
| 140 | + 'no-spaced-func': 2, |
| 141 | + 'no-sparse-arrays': 2, |
| 142 | + 'no-template-curly-in-string': 0, |
| 143 | + 'no-this-before-super': 2, |
| 144 | + 'no-throw-literal': 2, |
| 145 | + 'no-trailing-spaces': 1, |
| 146 | + 'no-undef-init': 2, |
| 147 | + 'no-undef': 2, |
| 148 | + 'no-unexpected-multiline': 2, |
| 149 | + 'no-unneeded-ternary': [1, { defaultAssignment: false }], |
| 150 | + 'no-unreachable-loop': 1, |
| 151 | + 'no-unreachable': 2, |
| 152 | + 'no-unsafe-assignment': 0, |
| 153 | + 'no-unsafe-call': 0, |
| 154 | + 'no-unsafe-finally': 2, |
| 155 | + 'no-unsafe-member-access': 0, |
| 156 | + 'no-unsafe-negation': 2, |
| 157 | + 'no-unsafe-optional-chaining': 0, |
| 158 | + 'no-unsafe-return': 0, |
| 159 | + 'no-unused-expressions': 2, |
| 160 | + 'no-unused-vars': [1, { vars: 'all', args: 'after-used' }], |
| 161 | + 'no-use-before-define': 0, |
| 162 | + 'no-useless-call': 2, |
| 163 | + 'no-useless-catch': 0, |
| 164 | + 'no-useless-escape': 0, |
| 165 | + 'no-useless-rename': 1, |
| 166 | + 'no-useless-return': 1, |
| 167 | + 'no-var': 1, |
| 168 | + 'no-void': 1, |
| 169 | + 'no-warning-comments': 0, |
| 170 | + 'no-with': 2, |
| 171 | + 'object-curly-spacing': [2, 'always', { objectsInObjects: true }], |
| 172 | + 'object-shorthand': 1, |
| 173 | + 'one-var': [1, { initialized: 'never' }], |
| 174 | + 'operator-linebreak': [0, 'after', { overrides: { '?': 'before', ':': 'before' } }], |
| 175 | + 'padded-blocks': [1, { switches: 'never' }], |
| 176 | + 'prefer-const': [1, { destructuring: 'all', ignoreReadBeforeAssign: false }], |
| 177 | + 'prefer-promise-reject-errors': 1, |
| 178 | + 'quotes': [1, 'single'], |
| 179 | + 'radix': 2, |
| 180 | + 'rest-spread-spacing': 1, |
| 181 | + 'semi-spacing': [1, { before: false, after: true }], |
| 182 | + 'semi-style': 1, |
| 183 | + 'semi': [1, 'always'], |
| 184 | + 'space-before-blocks': [1, 'always'], |
| 185 | + 'space-before-function-paren': [1, { anonymous: 'never', named: 'never', asyncArrow: 'always' }], |
| 186 | + 'space-in-parens': [1, 'never'], |
| 187 | + 'space-infix-ops': 1, |
| 188 | + 'space-unary-ops': [1, { words: true, nonwords: false }], |
| 189 | + 'spaced-comment': [0, 'always', { markers: ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ','] }], |
| 190 | + 'strict': 2, |
| 191 | + 'switch-colon-spacing': 1, |
| 192 | + 'symbol-description': 1, |
| 193 | + 'template-curly-spacing': [2, 'never'], |
| 194 | + 'template-tag-spacing': [2, 'never'], |
| 195 | + 'unicode-bom': 1, |
| 196 | + 'use-isnan': 2, |
| 197 | + 'valid-jsdoc': 1, |
| 198 | + 'valid-typeof': 2, |
| 199 | + 'wrap-iife': [1, 'any'], |
| 200 | + 'yoda': [1, 'never'] |
| 201 | + }, |
| 202 | + |
| 203 | + ignorePatterns: [ |
| 204 | + 'node_modules', |
| 205 | + 'dist', |
| 206 | + 'tmp', |
| 207 | + 'temp', |
| 208 | + 'lib/templates', |
| 209 | + 'support', |
| 210 | + 'test/fixtures', |
| 211 | + 'test/support' |
| 212 | + ] |
| 213 | +}; |
0 commit comments