|
| 1 | +import { defineConfig } from "eslint/config"; |
| 2 | +import typescriptEslint from "@typescript-eslint/eslint-plugin"; |
| 3 | +import prettier from "eslint-plugin-prettier"; |
| 4 | +import tsParser from "@typescript-eslint/parser"; |
| 5 | +import path from "node:path"; |
| 6 | +import { fileURLToPath } from "node:url"; |
| 7 | +import js from "@eslint/js"; |
| 8 | +import { FlatCompat } from "@eslint/eslintrc"; |
| 9 | + |
| 10 | +const __filename = fileURLToPath(import.meta.url); |
| 11 | +const __dirname = path.dirname(__filename); |
| 12 | +const compat = new FlatCompat({ |
| 13 | + baseDirectory: __dirname, |
| 14 | + recommendedConfig: js.configs.recommended, |
| 15 | + allConfig: js.configs.all, |
| 16 | +}); |
| 17 | + |
| 18 | +export default defineConfig([ |
| 19 | + { |
| 20 | + extends: compat.extends( |
| 21 | + "plugin:@typescript-eslint/recommended", |
| 22 | + "plugin:prettier/recommended", |
| 23 | + ), |
| 24 | + |
| 25 | + plugins: { |
| 26 | + "@typescript-eslint": typescriptEslint, |
| 27 | + prettier, |
| 28 | + }, |
| 29 | + |
| 30 | + languageOptions: { |
| 31 | + parser: tsParser, |
| 32 | + }, |
| 33 | + |
| 34 | + settings: { |
| 35 | + "import/resolver": { |
| 36 | + node: { |
| 37 | + extensions: [".js", ".ts"], |
| 38 | + }, |
| 39 | + }, |
| 40 | + }, |
| 41 | + |
| 42 | + rules: { |
| 43 | + "@typescript-eslint/no-unused-vars": [ |
| 44 | + "error", |
| 45 | + { |
| 46 | + ignoreRestSiblings: true, |
| 47 | + }, |
| 48 | + ], |
| 49 | + }, |
| 50 | + }, |
| 51 | +]); |
0 commit comments