|
| 1 | +/** |
| 2 | + * This file was originally generated by @eslint/migrate-config |
| 3 | + * |
| 4 | + * Yes it's messy. If you hate it, PR welcome to clean this up! |
| 5 | + */ |
| 6 | +import typescriptEslint from "@typescript-eslint/eslint-plugin"; |
| 7 | +import globals from "globals"; |
| 8 | +import tsParser from "@typescript-eslint/parser"; |
| 9 | +import path from "node:path"; |
| 10 | +import { fileURLToPath } from "node:url"; |
| 11 | +import js from "@eslint/js"; |
| 12 | +import { FlatCompat } from "@eslint/eslintrc"; |
| 13 | + |
| 14 | +const __filename = fileURLToPath(import.meta.url); |
| 15 | +const __dirname = path.dirname(__filename); |
| 16 | +const compat = new FlatCompat({ |
| 17 | + baseDirectory: __dirname, |
| 18 | + recommendedConfig: js.configs.recommended, |
| 19 | + allConfig: js.configs.all |
| 20 | +}); |
| 21 | + |
| 22 | +export default [...compat.extends( |
| 23 | + "eslint:recommended", |
| 24 | + "plugin:@typescript-eslint/eslint-recommended", |
| 25 | + "plugin:@typescript-eslint/recommended", |
| 26 | +), { |
| 27 | + plugins: { |
| 28 | + "@typescript-eslint": typescriptEslint, |
| 29 | + }, |
| 30 | + |
| 31 | + languageOptions: { |
| 32 | + globals: { |
| 33 | + ...globals.browser, |
| 34 | + ...globals.node, |
| 35 | + ...globals.mocha, |
| 36 | + Atomics: "readonly", |
| 37 | + SharedArrayBuffer: "readonly", |
| 38 | + }, |
| 39 | + |
| 40 | + parser: tsParser, |
| 41 | + ecmaVersion: 2018, |
| 42 | + sourceType: "module", |
| 43 | + }, |
| 44 | + |
| 45 | + rules: { |
| 46 | + indent: ["error", 2, { |
| 47 | + SwitchCase: 1, |
| 48 | + }], |
| 49 | + |
| 50 | + "linebreak-style": ["error", "unix"], |
| 51 | + |
| 52 | + "no-constant-condition": ["error", { |
| 53 | + checkLoops: false, |
| 54 | + }], |
| 55 | + |
| 56 | + quotes: ["error", "single", { |
| 57 | + allowTemplateLiterals: false, |
| 58 | + avoidEscape: true, |
| 59 | + }], |
| 60 | + |
| 61 | + semi: ["error", "always"], |
| 62 | + |
| 63 | + "no-console": ["error", { |
| 64 | + allow: ["warn", "error", "info", "debug"], |
| 65 | + }], |
| 66 | + |
| 67 | + "no-trailing-spaces": "error", |
| 68 | + "eol-last": "error", |
| 69 | + |
| 70 | + "@typescript-eslint/ban-ts-comment": ["error", { |
| 71 | + "ts-expect-error": "allow-with-description", |
| 72 | + "ts-nocheck": "allow-with-description", |
| 73 | + }], |
| 74 | + |
| 75 | + "@typescript-eslint/ban-tslint-comment": "error", |
| 76 | + |
| 77 | + "@typescript-eslint/consistent-type-assertions": ["error", { |
| 78 | + assertionStyle: "as", |
| 79 | + objectLiteralTypeAssertions: "never", |
| 80 | + }], |
| 81 | + |
| 82 | + "@typescript-eslint/no-inferrable-types": "off", |
| 83 | + "@typescript-eslint/no-explicit-any": 0, |
| 84 | + "@typescript-eslint/no-for-in-array": "error", |
| 85 | + "@typescript-eslint/no-invalid-void-type": "error", |
| 86 | + "@typescript-eslint/no-namespace": "error", |
| 87 | + "@typescript-eslint/no-non-null-asserted-optional-chain": "error", |
| 88 | + |
| 89 | + "@typescript-eslint/no-unused-vars": ["error", { |
| 90 | + ignoreRestSiblings: true, |
| 91 | + args: "none", |
| 92 | + }], |
| 93 | + |
| 94 | + "@typescript-eslint/prefer-for-of": ["error"], |
| 95 | + "@typescript-eslint/prefer-ts-expect-error": ["error"], |
| 96 | + }, |
| 97 | +}]; |
0 commit comments