|
| 1 | +import tseslint from "typescript-eslint"; |
| 2 | +import stylistic from "@stylistic/eslint-plugin"; |
| 3 | +// @ts-expect-error No types available |
| 4 | +import importPlugin from "eslint-plugin-import"; |
| 5 | + |
| 6 | +export default tseslint.config( |
| 7 | + ...tseslint.configs.recommendedTypeChecked, |
| 8 | + ...tseslint.configs.stylisticTypeChecked, |
| 9 | + importPlugin.flatConfigs.recommended, // eslint-disable-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access |
| 10 | + importPlugin.flatConfigs.typescript, // eslint-disable-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access |
| 11 | + stylistic.configs.customize({ |
| 12 | + arrowParens: true, |
| 13 | + braceStyle: "1tbs", |
| 14 | + commaDangle: "never", |
| 15 | + jsx: false, |
| 16 | + quotes: "double", |
| 17 | + semi: true |
| 18 | + }), |
| 19 | + { |
| 20 | + languageOptions: { |
| 21 | + parserOptions: { |
| 22 | + projectService: true, |
| 23 | + tsconfigRootDir: import.meta.dirname |
| 24 | + } |
| 25 | + }, |
| 26 | + settings: { |
| 27 | + "import/resolver": { |
| 28 | + typescript: {} |
| 29 | + } |
| 30 | + }, |
| 31 | + rules: { |
| 32 | + // TypeScript |
| 33 | + "@typescript-eslint/no-unused-vars": ["error", { |
| 34 | + argsIgnorePattern: "^_", |
| 35 | + varsIgnorePattern: "^_", |
| 36 | + caughtErrorsIgnorePattern: "^_" |
| 37 | + }], |
| 38 | + "@typescript-eslint/no-empty-function": "off", |
| 39 | + "@typescript-eslint/consistent-type-definitions": "off", |
| 40 | + "no-console": "error", |
| 41 | + |
| 42 | + // Imports |
| 43 | + "import/extensions": ["error", "ignorePackages"], |
| 44 | + |
| 45 | + // Stylistic |
| 46 | + "@stylistic/yield-star-spacing": ["error", "after"], |
| 47 | + "@stylistic/multiline-ternary": "off", |
| 48 | + "@stylistic/no-mixed-operators": "off", |
| 49 | + "@stylistic/quote-props": ["error", "as-needed"] |
| 50 | + } |
| 51 | + } |
| 52 | +); |
0 commit comments