|
| 1 | +const js = require('@eslint/js'); |
| 2 | +const globals = require('globals'); |
| 3 | + |
| 4 | +module.exports = [ |
| 5 | + { |
| 6 | + ignores: ['coverage/*'], |
| 7 | + }, |
| 8 | + js.configs.recommended, |
| 9 | + { |
| 10 | + languageOptions: { |
| 11 | + ecmaVersion: 2020, |
| 12 | + sourceType: 'module', |
| 13 | + globals: { |
| 14 | + ...globals.node, |
| 15 | + Parse: 'readonly', |
| 16 | + }, |
| 17 | + }, |
| 18 | + rules: { |
| 19 | + indent: ['error', 2, { SwitchCase: 1 }], |
| 20 | + 'linebreak-style': ['error', 'unix'], |
| 21 | + 'no-trailing-spaces': 2, |
| 22 | + 'eol-last': 2, |
| 23 | + 'space-in-parens': ['error', 'never'], |
| 24 | + 'no-multiple-empty-lines': 1, |
| 25 | + 'prefer-const': 'error', |
| 26 | + 'space-infix-ops': 'error', |
| 27 | + 'no-useless-escape': 'off', |
| 28 | + 'require-atomic-updates': 'off', |
| 29 | + 'object-curly-spacing': ['error', 'always'], |
| 30 | + curly: ['error', 'all'], |
| 31 | + 'block-spacing': ['error', 'always'], |
| 32 | + }, |
| 33 | + }, |
| 34 | + { |
| 35 | + files: ['spec/**/*.js'], |
| 36 | + languageOptions: { |
| 37 | + globals: { |
| 38 | + ...globals.node, |
| 39 | + ...globals.jasmine, |
| 40 | + Parse: 'readonly', |
| 41 | + reconfigureServer: 'readonly', |
| 42 | + it_only_parse_server_version: 'readonly', |
| 43 | + fit_only_parse_server_version: 'readonly', |
| 44 | + describe_only_parse_server_version: 'readonly', |
| 45 | + fdescribe_only_parse_server_version: 'readonly', |
| 46 | + }, |
| 47 | + }, |
| 48 | + rules: { |
| 49 | + 'no-console': 0, |
| 50 | + 'no-var': 'error', |
| 51 | + }, |
| 52 | + }, |
| 53 | +]; |
0 commit comments