| 1 | /** @type {import("@types/eslint").Linter.Config} */ |
| 2 | module.exports = { |
| 3 | ignorePatterns: ["node_modules", "dist"], |
| 4 | root: true, |
| 5 | env: { |
| 6 | node: true, |
| 7 | }, |
| 8 | parser: "@typescript-eslint/parser", |
| 9 | plugins: ["@typescript-eslint", "prettier"], |
| 10 | extends: [ |
| 11 | "eslint:recommended", |
| 12 | "plugin:@typescript-eslint/recommended", |
| 13 | "plugin:prettier/recommended", |
| 14 | "plugin:astro/recommended", |
| 15 | "plugin:astro/jsx-a11y-recommended", |
| 16 | ], |
| 17 | overrides: [ |
| 18 | { |
| 19 | files: ["*.astro"], |
| 20 | parser: "astro-eslint-parser", |
| 21 | parserOptions: { |
| 22 | parser: "@typescript-eslint/parser", |
| 23 | extraFileExtensions: [".astro"], |
| 24 | }, |
| 25 | rules: { |
| 26 | "prettier/prettier": "off", |
| 27 | "import/no-named-as-default-member": "off", |
| 28 | "import/no-named-as-default": "off", |
| 29 | "@typescript-eslint/consistent-type-imports": "error", |
| 30 | "@typescript-eslint/no-unused-vars": "off", |
| 31 | }, |
| 32 | }, |
| 33 | { |
| 34 | files: ["**/*.mjs"], |
| 35 | parserOptions: { |
| 36 | sourceType: "module", |
| 37 | ecmaVersion: 2015, |
| 38 | }, |
| 39 | rules: { |
| 40 | "import/no-extraneous-dependencies": "off", |
| 41 | "import/no-unresolved": "off", |
| 42 | }, |
| 43 | }, |
| 44 | { |
| 45 | files: ["**/*.ts"], |
| 46 | parser: "@typescript-eslint/parser", |
| 47 | extends: ["plugin:@typescript-eslint/recommended"], |
| 48 | rules: { |
| 49 | "@typescript-eslint/no-unused-vars": [ |
| 50 | "error", |
| 51 | { argsIgnorePattern: "^_", destructuredArrayIgnorePattern: "^_" }, |
| 52 | ], |
| 53 | "@typescript-eslint/no-non-null-assertion": "off", |
| 54 | }, |
| 55 | }, |
| 56 | ], |
| 57 | rules: { |
| 58 | "@typescript-eslint/no-var-requires": "warn", |
| 59 | }, |
| 60 | }; |