|
| 1 | +import typescriptEslint from "@typescript-eslint/eslint-plugin"; |
| 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 | + ignores: [ |
| 19 | + "dist", |
| 20 | + "node_modules", |
| 21 | + "index.js", |
| 22 | + ], |
| 23 | +}, ...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"), { |
| 24 | + plugins: { |
| 25 | + "@typescript-eslint": typescriptEslint, |
| 26 | + }, |
| 27 | + |
| 28 | + languageOptions: { |
| 29 | + globals: { |
| 30 | + ...globals.node, |
| 31 | + ...globals.browser, |
| 32 | + }, |
| 33 | + |
| 34 | + parser: tsParser, |
| 35 | + }, |
| 36 | + |
| 37 | + rules: { |
| 38 | + semi: [2, "always"], |
| 39 | + quotes: [2, "double", { |
| 40 | + avoidEscape: true, |
| 41 | + }], |
| 42 | + "@typescript-eslint/no-unused-vars": ["warn", {caughtErrors: "none"}], |
| 43 | + "no-async-promise-executor": "off", |
| 44 | + "no-prototype-builtins": "off", |
| 45 | + "no-useless-escape": "off", |
| 46 | + "no-irregular-whitespace": "off", |
| 47 | + "@typescript-eslint/ban-ts-comment": "off", |
| 48 | + "@typescript-eslint/no-var-requires": "off", |
| 49 | + "@typescript-eslint/explicit-function-return-type": "off", |
| 50 | + "@typescript-eslint/explicit-module-boundary-types": "off", |
| 51 | + "@typescript-eslint/no-explicit-any": "off", |
| 52 | + "@typescript-eslint/no-require-imports": "off", |
| 53 | + }, |
| 54 | +}]; |
0 commit comments