|
| 1 | +import { fixupConfigRules } from "@eslint/compat" |
| 2 | +import globals from "globals" |
| 3 | +import tsParser from "@typescript-eslint/parser" |
| 4 | +import path from "node:path" |
| 5 | +import { fileURLToPath } from "node:url" |
| 6 | +import js from "@eslint/js" |
| 7 | +import { FlatCompat } from "@eslint/eslintrc" |
| 8 | + |
| 9 | +const __filename = fileURLToPath(import.meta.url) |
| 10 | +const __dirname = path.dirname(__filename) |
| 11 | +const compat = new FlatCompat({ |
| 12 | + baseDirectory: __dirname, |
| 13 | + recommendedConfig: js.configs.recommended, |
| 14 | + allConfig: js.configs.all, |
| 15 | +}) |
| 16 | + |
| 17 | +export default [ |
| 18 | + ...fixupConfigRules( |
| 19 | + compat.extends( |
| 20 | + "eslint:recommended", |
| 21 | + "plugin:@typescript-eslint/recommended", |
| 22 | + "plugin:import/recommended", |
| 23 | + "plugin:import/typescript", |
| 24 | + "plugin:prettier/recommended", |
| 25 | + "prettier", |
| 26 | + ), |
| 27 | + ), |
| 28 | + { |
| 29 | + languageOptions: { |
| 30 | + globals: { |
| 31 | + ...globals.browser, |
| 32 | + ...globals.jest, |
| 33 | + ...globals.node, |
| 34 | + }, |
| 35 | + |
| 36 | + parser: tsParser, |
| 37 | + ecmaVersion: 2018, |
| 38 | + sourceType: "module", |
| 39 | + }, |
| 40 | + |
| 41 | + settings: { |
| 42 | + "import/resolver": { |
| 43 | + typescript: { |
| 44 | + alwaysTryTypes: true, |
| 45 | + }, |
| 46 | + }, |
| 47 | + }, |
| 48 | + |
| 49 | + rules: { |
| 50 | + "@typescript-eslint/no-unused-vars": [ |
| 51 | + "error", |
| 52 | + { |
| 53 | + args: "none", |
| 54 | + }, |
| 55 | + ], |
| 56 | + |
| 57 | + "no-dupe-class-members": "off", |
| 58 | + "@typescript-eslint/no-use-before-define": "off", |
| 59 | + "@typescript-eslint/no-non-null-assertion": "off", |
| 60 | + "@typescript-eslint/ban-types": "off", |
| 61 | + "@typescript-eslint/no-var-requires": "off", |
| 62 | + "@typescript-eslint/explicit-module-boundary-types": "off", |
| 63 | + "@typescript-eslint/no-explicit-any": "off", |
| 64 | + "@typescript-eslint/no-extra-semi": "off", |
| 65 | + "@typescript-eslint/no-require-imports": "off", |
| 66 | + "@typescript-eslint/no-unused-vars": "off", // TODO: Fix these. |
| 67 | + eqeqeq: "error", |
| 68 | + |
| 69 | + "import/order": [ |
| 70 | + "error", |
| 71 | + { |
| 72 | + alphabetize: { |
| 73 | + order: "asc", |
| 74 | + }, |
| 75 | + |
| 76 | + groups: [["builtin", "external", "internal"], "parent", "sibling"], |
| 77 | + }, |
| 78 | + ], |
| 79 | + |
| 80 | + "no-async-promise-executor": "off", |
| 81 | + }, |
| 82 | + }, |
| 83 | +] |
0 commit comments