|
| 1 | +import js from '@eslint/js' |
| 2 | +import tseslint from 'typescript-eslint' |
| 3 | +import unicorn from 'eslint-plugin-unicorn' |
| 4 | +import importPlugin from 'eslint-plugin-import' |
| 5 | + |
| 6 | +export default tseslint.config( |
| 7 | + js.configs.recommended, |
| 8 | + { |
| 9 | + plugins: { |
| 10 | + '@typescript-eslint': tseslint.plugin, |
| 11 | + unicorn, |
| 12 | + import: importPlugin, |
| 13 | + }, |
| 14 | + languageOptions: { |
| 15 | + ecmaVersion: 2020, |
| 16 | + sourceType: 'module', |
| 17 | + }, |
| 18 | + rules: { |
| 19 | + quotes: ['error', 'single', { avoidEscape: true }], |
| 20 | + camelcase: ['error', { properties: 'never' }], |
| 21 | + semi: ['error', 'never'], |
| 22 | + eqeqeq: ['error', 'always'], |
| 23 | + 'prefer-const': 'error', |
| 24 | + 'no-multiple-empty-lines': [2, { max: 1, maxEOF: 1 }], |
| 25 | + 'array-bracket-spacing': ['error', 'never'], |
| 26 | + 'brace-style': ['error', '1tbs', { allowSingleLine: true }], |
| 27 | + 'comma-spacing': ['error', { before: false, after: true }], |
| 28 | + 'no-lonely-if': 'error', |
| 29 | + 'dot-notation': 'error', |
| 30 | + 'no-else-return': 'error', |
| 31 | + 'no-tabs': 'error', |
| 32 | + 'no-trailing-spaces': ['error', { skipBlankLines: false, ignoreComments: false }], |
| 33 | + 'no-var': 'error', |
| 34 | + 'unicode-bom': ['error', 'never'], |
| 35 | + curly: ['error', 'all'], |
| 36 | + 'object-curly-spacing': ['error', 'always'], |
| 37 | + 'keyword-spacing': ['error'], |
| 38 | + 'require-atomic-updates': 0, |
| 39 | + 'linebreak-style': ['error', 'unix'], |
| 40 | + 'unicorn/prefer-node-protocol': ['error'], |
| 41 | + 'unicorn/template-indent': ['error'], |
| 42 | + 'import/extensions': ['error', 'ignorePackages'], |
| 43 | + 'no-restricted-syntax': ['error', 'IfStatement > ExpressionStatement > AssignmentExpression'], |
| 44 | + 'unicorn/prefer-ternary': 'error', |
| 45 | + }, |
| 46 | + }, |
| 47 | + { |
| 48 | + files: ['**/*.ts'], |
| 49 | + rules: { |
| 50 | + 'no-unused-vars': 'off', |
| 51 | + '@typescript-eslint/no-unused-vars': 'error', |
| 52 | + '@typescript-eslint/consistent-type-imports': 'error', |
| 53 | + 'no-undef': 'off', |
| 54 | + 'no-redeclare': 'off', |
| 55 | + }, |
| 56 | + }, |
| 57 | + { |
| 58 | + files: ['**/*.test.ts'], |
| 59 | + rules: { |
| 60 | + 'dot-notation': 'off', |
| 61 | + }, |
| 62 | + } |
| 63 | +) |
0 commit comments