// @ts-check import eslint from "@eslint/js"; import { defineConfig } from "eslint/config"; import stylistic from "@stylistic/eslint-plugin"; import tseslint from "typescript-eslint"; export { eslint, tseslint }; /** @type {import("eslint").Linter.RulesRecord} */ export const baseRules = { "@typescript-eslint/no-explicit-any": "off", "no-constructor-return": "error", "no-duplicate-imports": "error", "no-unreachable-loop": "error", "require-atomic-updates": "error", "class-methods-use-this": "error", complexity: "warn", "max-params": "warn", "max-depth": "warn", "max-lines": "warn", "max-lines-per-function": "warn", "max-statements": "warn", "max-nested-callbacks": "warn", "no-magic-numbers": [ "warn", { ignore: [0, 1, 10, 100, 1000, 60, 200, 201, 204, 301, 302, 304, 400, 401, 403, 404, 500], ignoreArrayIndexes: true, ignoreDefaultValues: true, ignoreClassFieldInitialValues: true, enforceConst: true, detectObjects: true, ignoreEnums: true, ignoreNumericLiteralTypes: true, ignoreReadonlyClassProperties: true, ignoreTypeIndexes: true, }, ], "no-eval": "error", "no-implicit-coercion": "error", "no-negated-condition": "warn", "no-useless-rename": "error", "no-var": "error", "prefer-const": "error", "@stylistic/quotes": ["error", "double"], "@stylistic/semi": "off", "@stylistic/comma-dangle": "off", }; export const base = defineConfig(eslint.configs.recommended, ...tseslint.configs.recommendedTypeChecked, { plugins: { "@stylistic": stylistic, }, rules: baseRules, });