|
| 1 | +module.exports = { |
| 2 | + extends: ['eslint:recommended', 'prettier'], |
| 3 | + plugins: ['prettier', '@typescript-eslint', 'unused-imports', 'simple-import-sort', 'import'], |
| 4 | + parser: '@typescript-eslint/parser', |
| 5 | + env: { |
| 6 | + node: true, |
| 7 | + commonjs: true, |
| 8 | + }, |
| 9 | + rules: { |
| 10 | + 'prettier/prettier': 'error', |
| 11 | + 'no-new': 0, |
| 12 | + camelcase: 0, |
| 13 | + 'no-nested-ternary': 0, |
| 14 | + 'no-underscore-dangle': 0, |
| 15 | + 'no-shadow': 0, |
| 16 | + 'no-useless-return': 0, |
| 17 | + '@typescript-eslint/no-explicit-any': 0, |
| 18 | + '@typescript-eslint/no-non-null-assertion': 0, |
| 19 | + '@typescript-eslint/no-shadow': ['error'], |
| 20 | + '@typescript-eslint/no-unused-vars': [ |
| 21 | + 'error', |
| 22 | + { |
| 23 | + argsIgnorePattern: '^_', |
| 24 | + varsIgnorePattern: '^_', |
| 25 | + caughtErrorsIgnorePattern: '^_', |
| 26 | + }, |
| 27 | + ], |
| 28 | + 'unused-imports/no-unused-imports': 'error', |
| 29 | + 'no-multi-spaces': 'error', |
| 30 | + 'no-trailing-spaces': 'error', |
| 31 | + 'no-multiple-empty-lines': 'error', |
| 32 | + 'space-in-parens': 'error', |
| 33 | + 'no-mixed-spaces-and-tabs': 'warn', |
| 34 | + eqeqeq: ['warn', 'always'], |
| 35 | + 'no-unused-vars': 'off', |
| 36 | + 'simple-import-sort/imports': [ |
| 37 | + 'error', |
| 38 | + { |
| 39 | + groups: [ |
| 40 | + ['^react$'], |
| 41 | + // Side effect imports. |
| 42 | + ['^\\u0000'], |
| 43 | + // Node.js builtins prefixed with `node:`. |
| 44 | + ['^node:'], |
| 45 | + // Packages. |
| 46 | + // Things that start with a letter (or digit or underscore), or `@` followed by a letter. |
| 47 | + ['^@?\\w'], |
| 48 | + // Absolute imports and other imports such as Vue-style `@/foo`. |
| 49 | + // Anything not matched in another group. |
| 50 | + ['^@fllite-fe/*'], |
| 51 | + ['^'], |
| 52 | + // Relative imports. |
| 53 | + // Anything that starts with a dot. |
| 54 | + ['^\\.'], |
| 55 | + ], |
| 56 | + }, |
| 57 | + ], |
| 58 | + 'simple-import-sort/exports': 'error', |
| 59 | + 'import/first': 'error', |
| 60 | + 'import/newline-after-import': 'error', |
| 61 | + 'import/no-duplicates': 'error', |
| 62 | + 'max-len': 'off', |
| 63 | + 'no-duplicate-imports': 'error', |
| 64 | + 'object-curly-spacing': ['error', 'always'], |
| 65 | + 'array-bracket-spacing': ['error', 'never'], |
| 66 | + 'computed-property-spacing': ['error', 'never'], |
| 67 | + }, |
| 68 | +} |
0 commit comments