|
| 1 | +import { defineConfig } from 'eslint/config'; |
| 2 | +import js from '@eslint/js'; |
| 3 | +import globals from 'globals'; |
| 4 | +import stylistic from '@stylistic/eslint-plugin'; |
| 5 | + |
| 6 | +export default defineConfig([ |
| 7 | + js.configs.recommended, |
| 8 | + { |
| 9 | + languageOptions: { |
| 10 | + globals: { |
| 11 | + ...globals.node, |
| 12 | + }, |
| 13 | + ecmaVersion: 2025, |
| 14 | + sourceType: 'module', |
| 15 | + parserOptions: { |
| 16 | + ecmaFeatures: { |
| 17 | + impliedStrict: true, |
| 18 | + }, |
| 19 | + }, |
| 20 | + }, |
| 21 | + plugins: { |
| 22 | + '@stylistic': stylistic |
| 23 | + }, |
| 24 | + rules: { |
| 25 | + '@stylistic/semi': 1, |
| 26 | + '@stylistic/semi-style': 2, |
| 27 | + '@stylistic/semi-spacing': 1, |
| 28 | + '@stylistic/quotes': ['warn', 'single', { |
| 29 | + avoidEscape: true, |
| 30 | + allowTemplateLiterals: 'never', |
| 31 | + }], |
| 32 | + '@stylistic/brace-style': 2, |
| 33 | + '@stylistic/indent': ['error', 2], |
| 34 | + '@stylistic/spaced-comment': 1, |
| 35 | + '@stylistic/no-multi-spaces': 1, |
| 36 | + '@stylistic/wrap-iife': ['error', 'inside'], |
| 37 | + '@stylistic/linebreak-style': 1, |
| 38 | + '@stylistic/template-curly-spacing': 1, |
| 39 | + |
| 40 | + 'camelcase': 2, |
| 41 | + 'eqeqeq': ['error', 'smart'], |
| 42 | + 'curly': ['error', 'all'], |
| 43 | + 'dot-notation': 2, |
| 44 | + 'no-array-constructor': 2, |
| 45 | + 'no-throw-literal': 2, |
| 46 | + 'no-self-compare': 2, |
| 47 | + 'no-useless-call': 1, |
| 48 | + 'consistent-return': 2, |
| 49 | + 'no-new-wrappers': 2, |
| 50 | + 'no-script-url': 2, |
| 51 | + 'no-console': 1, |
| 52 | + 'no-void': 1, |
| 53 | + 'vars-on-top': 1, |
| 54 | + 'yoda': ['error', 'never'], |
| 55 | + /* 'no-warning-comments': 1, */ // should be enabled later |
| 56 | + 'require-await': 1, |
| 57 | + 'no-loop-func': 2, |
| 58 | + 'no-eval': 2, |
| 59 | + 'no-implied-eval': 2, |
| 60 | + 'no-var': 1, |
| 61 | + 'prefer-const': 2, |
| 62 | + 'prefer-arrow-callback': 1, |
| 63 | + 'prefer-rest-params': 2, |
| 64 | + 'prefer-spread': 2, |
| 65 | + 'prefer-template': 1, |
| 66 | + 'symbol-description': 2, |
| 67 | + 'object-shorthand': 1, |
| 68 | + 'prefer-promise-reject-errors': 2, |
| 69 | + /* 'prefer-destructuring': 1, */ // https://github.com/eslint/eslint/issues/10250 |
| 70 | + 'no-object-constructor': 2, |
| 71 | + }, |
| 72 | + } |
| 73 | +]); |
0 commit comments