|
| 1 | +import gitHubPlugin from "eslint-plugin-github"; |
| 2 | +import globals from "globals"; |
| 3 | +import tseslint from "typescript-eslint"; |
| 4 | + |
| 5 | +export default tseslint.config( |
| 6 | + tseslint.configs.recommended, |
| 7 | + { |
| 8 | + languageOptions: { |
| 9 | + parserOptions: { |
| 10 | + projectService: true, |
| 11 | + tsconfigRootDir: import.meta.dirname, |
| 12 | + }, |
| 13 | + |
| 14 | + ecmaVersion: 9, |
| 15 | + sourceType: "module", |
| 16 | + globals: { |
| 17 | + ...globals.node, |
| 18 | + ...globals.es2015, |
| 19 | + }, |
| 20 | + }, |
| 21 | + }, |
| 22 | + { |
| 23 | + settings: { |
| 24 | + "import/resolver": { |
| 25 | + typescript: {}, |
| 26 | + }, |
| 27 | + "import/parsers": { |
| 28 | + "@typescript-eslint/parser": [".ts"], |
| 29 | + }, |
| 30 | + }, |
| 31 | + }, |
| 32 | + gitHubPlugin.getFlatConfigs().recommended, |
| 33 | + { |
| 34 | + rules: { |
| 35 | + "@typescript-eslint/no-base-to-string": "error", |
| 36 | + camelcase: "error", |
| 37 | + "i18n-text/no-en": "off", |
| 38 | + "@typescript-eslint/no-shadow": "error", |
| 39 | + "eslint-comments/no-use": "off", |
| 40 | + "import/extensions": [ |
| 41 | + "error", |
| 42 | + "ignorePackages", |
| 43 | + { json: "always", ts: "never" }, |
| 44 | + ], |
| 45 | + "import/no-namespace": "off", |
| 46 | + "no-unused-vars": "off", |
| 47 | + "@typescript-eslint/no-unused-vars": [ |
| 48 | + "error", |
| 49 | + { |
| 50 | + argsIgnorePattern: "^_", |
| 51 | + }, |
| 52 | + ], |
| 53 | + "@typescript-eslint/explicit-member-accessibility": [ |
| 54 | + "error", |
| 55 | + { |
| 56 | + accessibility: "no-public", |
| 57 | + }, |
| 58 | + ], |
| 59 | + "@typescript-eslint/no-require-imports": "error", |
| 60 | + "@typescript-eslint/array-type": "error", |
| 61 | + "@typescript-eslint/await-thenable": "error", |
| 62 | + "@typescript-eslint/ban-ts-comment": "error", |
| 63 | + "@typescript-eslint/consistent-type-assertions": "error", |
| 64 | + "@typescript-eslint/explicit-function-return-type": [ |
| 65 | + "error", |
| 66 | + { |
| 67 | + allowExpressions: true, |
| 68 | + }, |
| 69 | + ], |
| 70 | + "@typescript-eslint/no-array-constructor": "error", |
| 71 | + "@typescript-eslint/no-empty-interface": "error", |
| 72 | + "@typescript-eslint/no-explicit-any": "error", |
| 73 | + "@typescript-eslint/no-floating-promises": "error", |
| 74 | + "@typescript-eslint/no-extraneous-class": "error", |
| 75 | + "@typescript-eslint/no-for-in-array": "error", |
| 76 | + "@typescript-eslint/no-inferrable-types": "error", |
| 77 | + "@typescript-eslint/no-misused-new": "error", |
| 78 | + "@typescript-eslint/no-namespace": "error", |
| 79 | + "@typescript-eslint/no-non-null-assertion": "warn", |
| 80 | + "@typescript-eslint/no-unnecessary-qualifier": "error", |
| 81 | + "@typescript-eslint/no-unnecessary-type-assertion": "error", |
| 82 | + "@typescript-eslint/no-useless-constructor": "error", |
| 83 | + "@typescript-eslint/no-var-requires": "error", |
| 84 | + "@typescript-eslint/prefer-for-of": "warn", |
| 85 | + "@typescript-eslint/prefer-function-type": "warn", |
| 86 | + "@typescript-eslint/prefer-includes": "error", |
| 87 | + "@typescript-eslint/prefer-string-starts-ends-with": "error", |
| 88 | + "@typescript-eslint/promise-function-async": "error", |
| 89 | + "@typescript-eslint/require-array-sort-compare": "error", |
| 90 | + "@typescript-eslint/restrict-plus-operands": "error", |
| 91 | + "@typescript-eslint/unbound-method": "error", |
| 92 | + }, |
| 93 | + }, |
| 94 | +); |
0 commit comments