|
| 1 | +import typescriptEslint from "@typescript-eslint/eslint-plugin"; |
| 2 | +import stylistic from "@stylistic/eslint-plugin"; |
| 3 | +import antiTrojanSource from "eslint-plugin-anti-trojan-source"; |
| 4 | +import jest from "eslint-plugin-jest"; |
| 5 | +import globals from "globals"; |
| 6 | +import tsParser from "@typescript-eslint/parser"; |
| 7 | +import tseslint from 'typescript-eslint'; |
| 8 | +import github from 'eslint-plugin-github'; |
| 9 | +import importPlugin from 'eslint-plugin-import'; |
| 10 | + |
| 11 | +export default tseslint.config([ |
| 12 | + github.getFlatConfigs().recommended, |
| 13 | + ...github.getFlatConfigs().typescript, |
| 14 | + importPlugin.flatConfigs.typescript, |
| 15 | + { |
| 16 | + ignores: ["**/dist/", "**/lib/", "**/node_modules/", "**/jest.config.js"], |
| 17 | + plugins: { |
| 18 | + "@typescript-eslint": typescriptEslint, |
| 19 | + "@stylistic": stylistic, |
| 20 | + "anti-trojan-source": antiTrojanSource, |
| 21 | + jest, |
| 22 | + }, |
| 23 | + languageOptions: { |
| 24 | + globals: { |
| 25 | + ...globals.jest, |
| 26 | + ...jest.environments.globals.globals, |
| 27 | + ...globals.node, |
| 28 | + }, |
| 29 | + parser: tsParser, |
| 30 | + ecmaVersion: 9, |
| 31 | + sourceType: "module", |
| 32 | + parserOptions: { |
| 33 | + project: "./tsconfig.json", |
| 34 | + }, |
| 35 | + }, |
| 36 | + rules: { |
| 37 | + "@typescript-eslint/array-type": "error", |
| 38 | + "@typescript-eslint/await-thenable": "error", |
| 39 | + "@typescript-eslint/ban-ts-comment": "error", |
| 40 | + "@typescript-eslint/consistent-type-assertions": "error", |
| 41 | + "@typescript-eslint/explicit-function-return-type": ["error", { |
| 42 | + allowExpressions: true, |
| 43 | + }], |
| 44 | + "@typescript-eslint/explicit-member-accessibility": ["error", { |
| 45 | + accessibility: "no-public", |
| 46 | + }], |
| 47 | + "@stylistic/func-call-spacing": ["error", "never"], |
| 48 | + "@typescript-eslint/no-array-constructor": "error", |
| 49 | + "@typescript-eslint/no-empty-interface": "error", |
| 50 | + "@typescript-eslint/no-explicit-any": "error", |
| 51 | + "@typescript-eslint/no-extraneous-class": "error", |
| 52 | + "@typescript-eslint/no-for-in-array": "error", |
| 53 | + "@typescript-eslint/no-inferrable-types": "error", |
| 54 | + "@typescript-eslint/no-misused-new": "error", |
| 55 | + "@typescript-eslint/no-namespace": "error", |
| 56 | + "@typescript-eslint/no-non-null-assertion": "warn", |
| 57 | + "@typescript-eslint/no-require-imports": "error", |
| 58 | + "@typescript-eslint/no-unnecessary-qualifier": "error", |
| 59 | + "@typescript-eslint/no-unnecessary-type-assertion": "error", |
| 60 | + "@typescript-eslint/no-unused-vars": "off", |
| 61 | + "@typescript-eslint/no-useless-constructor": "error", |
| 62 | + "@typescript-eslint/no-var-requires": "error", |
| 63 | + "@typescript-eslint/prefer-for-of": "warn", |
| 64 | + "@typescript-eslint/prefer-function-type": "warn", |
| 65 | + "@typescript-eslint/prefer-includes": "error", |
| 66 | + "@typescript-eslint/prefer-string-starts-ends-with": "error", |
| 67 | + "@typescript-eslint/promise-function-async": "error", |
| 68 | + "@typescript-eslint/require-array-sort-compare": "error", |
| 69 | + "@typescript-eslint/restrict-plus-operands": "error", |
| 70 | + "@stylistic/semi": ["error", "never"], |
| 71 | + "@stylistic/type-annotation-spacing": "error", |
| 72 | + "@typescript-eslint/unbound-method": "error", |
| 73 | + "anti-trojan-source/no-bidi": "error", |
| 74 | + camelcase: "off", |
| 75 | + "eslint-comments/no-use": "off", |
| 76 | + "github/filenames-match-regex": ["error", "^[a-z_]+(\\.test|\\.d)?$"], |
| 77 | + "i18n-text/no-en": "off", |
| 78 | + "importPlugin/no-namespace": "off", |
| 79 | + "no-unused-vars": "off", |
| 80 | + semi: "off", |
| 81 | + }, |
| 82 | + } |
| 83 | +]); |
0 commit comments