|
| 1 | +import babelParser from '@babel/eslint-parser' |
| 2 | +import js from '@eslint/js' |
| 3 | +import prettier from 'eslint-plugin-prettier' |
| 4 | +import sort from 'eslint-plugin-sort' |
| 5 | +import widen from 'eslint-plugin-widen' |
| 6 | +import sharedGlobals from './sharedGlobals.js' |
| 7 | + |
| 8 | +export default [ |
| 9 | + { |
| 10 | + languageOptions: { |
| 11 | + globals: sharedGlobals, |
| 12 | + parser: babelParser, |
| 13 | + parserOptions: { |
| 14 | + requireConfigFile: false, |
| 15 | + }, |
| 16 | + }, |
| 17 | + plugins: { |
| 18 | + prettier, |
| 19 | + sort, |
| 20 | + widen, |
| 21 | + }, |
| 22 | + rules: { |
| 23 | + 'default-param-last': 'error', |
| 24 | + 'dot-notation': 'error', |
| 25 | + eqeqeq: [ |
| 26 | + 'error', |
| 27 | + 'always', |
| 28 | + { |
| 29 | + null: 'ignore', |
| 30 | + }, |
| 31 | + ], |
| 32 | + 'no-console': ['error', { allow: ['error'] }], |
| 33 | + 'no-dupe-args': 'error', |
| 34 | + 'no-duplicate-imports': 'error', |
| 35 | + 'no-else-return': 'error', |
| 36 | + 'no-empty': ['error', { allowEmptyCatch: true }], |
| 37 | + 'no-extra-bind': 'error', |
| 38 | + 'no-param-reassign': 'error', |
| 39 | + 'no-return-await': 'error', |
| 40 | + 'no-template-curly-in-string': 'error', |
| 41 | + 'no-unneeded-ternary': 'error', |
| 42 | + 'no-unused-expressions': 'off', |
| 43 | + 'no-unused-vars': [ |
| 44 | + 'error', |
| 45 | + { |
| 46 | + ignoreRestSiblings: true, |
| 47 | + varsIgnorePattern: '^_', |
| 48 | + }, |
| 49 | + ], |
| 50 | + 'no-useless-computed-key': 'error', |
| 51 | + 'no-var': 'error', |
| 52 | + 'object-shorthand': 'error', |
| 53 | + 'prefer-const': [ |
| 54 | + 'error', |
| 55 | + { |
| 56 | + destructuring: 'all', |
| 57 | + }, |
| 58 | + ], |
| 59 | + 'require-await': 'error', |
| 60 | + 'sort/exports': [ |
| 61 | + 'warn', |
| 62 | + { |
| 63 | + groups: [ |
| 64 | + { order: 6, type: 'default' }, |
| 65 | + { order: 5, type: 'sourceless' }, |
| 66 | + { order: 2, regex: '^@widen\\/' }, |
| 67 | + { order: 4, regex: '^\\.+' }, |
| 68 | + { order: 1, type: 'dependency' }, |
| 69 | + { order: 3, type: 'other' }, |
| 70 | + ], |
| 71 | + }, |
| 72 | + ], |
| 73 | + 'sort/imports': [ |
| 74 | + 'warn', |
| 75 | + { |
| 76 | + groups: [ |
| 77 | + { order: 1, type: 'side-effect' }, |
| 78 | + { order: 3, regex: '^@widen\\/' }, |
| 79 | + { order: 5, regex: '^\\.+' }, |
| 80 | + { order: 2, type: 'dependency' }, |
| 81 | + { order: 4, type: 'other' }, |
| 82 | + ], |
| 83 | + }, |
| 84 | + ], |
| 85 | + }, |
| 86 | + }, |
| 87 | + js.configs.recommended, |
| 88 | + { |
| 89 | + plugins: { |
| 90 | + prettier, |
| 91 | + }, |
| 92 | + rules: { |
| 93 | + ...prettier.configs.recommended.rules, |
| 94 | + }, |
| 95 | + }, |
| 96 | +] |
0 commit comments