|
| 1 | +import eslint from "@eslint/js"; |
| 2 | +import { globalIgnores } from "eslint/config"; |
| 3 | +import github from "eslint-plugin-github"; |
| 4 | +import tseslint from "typescript-eslint"; |
| 5 | + |
| 6 | +export default tseslint.config( |
| 7 | + globalIgnores(["dist/", "node_modules/", "script/", "jest.config.ts", "eslint.config.mjs", "build.mjs"]), |
| 8 | + github.getFlatConfigs().recommended, |
| 9 | + ...github.getFlatConfigs().typescript, |
| 10 | + tseslint.configs.recommendedTypeChecked, |
| 11 | + eslint.configs.recommended, |
| 12 | + tseslint.configs.recommended, |
| 13 | + { |
| 14 | + rules: { |
| 15 | + "sort-imports": "off", |
| 16 | + "i18n-text/no-en": "off", |
| 17 | + "import/extensions": [ |
| 18 | + "error", |
| 19 | + { |
| 20 | + json: "always", |
| 21 | + }, |
| 22 | + ], |
| 23 | + "import/named": "off", |
| 24 | + "import/no-amd": "error", |
| 25 | + "import/no-commonjs": "error", |
| 26 | + "import/no-dynamic-require": "error", |
| 27 | + "import/no-extraneous-dependencies": [ |
| 28 | + "error", |
| 29 | + { |
| 30 | + devDependencies: true, |
| 31 | + }, |
| 32 | + ], |
| 33 | + "import/no-namespace": "off", |
| 34 | + "import/no-unresolved": "error", |
| 35 | + "import/no-webpack-loader-syntax": "error", |
| 36 | + "import/order": [ |
| 37 | + "error", |
| 38 | + { |
| 39 | + alphabetize: { |
| 40 | + order: "asc", |
| 41 | + }, |
| 42 | + "newlines-between": "always", |
| 43 | + }, |
| 44 | + ], |
| 45 | + "no-console": "off", |
| 46 | + "no-sequences": "error", |
| 47 | + "no-shadow": "off", |
| 48 | + "@typescript-eslint/naming-convention": "error", |
| 49 | + "eslint-comments/no-use": [ |
| 50 | + "error", |
| 51 | + { |
| 52 | + allow: [ |
| 53 | + "eslint-disable", |
| 54 | + "eslint-enable", |
| 55 | + "eslint-disable-next-line", |
| 56 | + ], |
| 57 | + }, |
| 58 | + ], |
| 59 | + "@typescript-eslint/no-shadow": "error", |
| 60 | + "one-var": ["error", "never"], |
| 61 | + "@typescript-eslint/restrict-template-expressions": "off", |
| 62 | + }, |
| 63 | + settings: { |
| 64 | + "import/parsers": { |
| 65 | + "@typescript-eslint/parser": [".ts", ".tsx"] |
| 66 | + }, |
| 67 | + "import/resolver": { |
| 68 | + "typescript": {} |
| 69 | + } |
| 70 | + }, |
| 71 | + languageOptions: { |
| 72 | + parserOptions: { |
| 73 | + projectService: true, |
| 74 | + tsconfigRootDir: import.meta.dirname, |
| 75 | + }, |
| 76 | + }, |
| 77 | + }, |
| 78 | +); |
0 commit comments