Replace .eslintrc.json with eslint.config.js using the new flat config format required by ESLint 10. Swap @typescript-eslint/eslint-plugin and @typescript-eslint/parser for the unified typescript-eslint package. Upgrade TypeScript to 5.9 and @types/node to 25. Apply automatic code fixes: remove unused catch bindings and preserve error cause in auth header parsing.
55 lines
1.4 KiB
JavaScript
55 lines
1.4 KiB
JavaScript
import { defineConfig } from "@eslint/config-helpers";
|
|
import eslint from "@eslint/js";
|
|
import tseslint from "typescript-eslint";
|
|
import eslintConfigPrettier from "eslint-config-prettier";
|
|
import globals from "globals";
|
|
|
|
export default defineConfig(
|
|
{
|
|
ignores: ["dist/", "test/*.js"],
|
|
},
|
|
eslint.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
eslintConfigPrettier,
|
|
{
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.es2022,
|
|
...globals.node,
|
|
},
|
|
parserOptions: {
|
|
projectService: true,
|
|
tsconfigRootDir: import.meta.dirname,
|
|
},
|
|
},
|
|
rules: {
|
|
"no-shadow": ["error", { allow: ["err"] }],
|
|
"handle-callback-err": "error",
|
|
"prefer-arrow-callback": "error",
|
|
"no-buffer-constructor": "error",
|
|
"prefer-const": ["error", { destructuring: "all" }],
|
|
eqeqeq: ["error", "always", { null: "ignore" }],
|
|
"@typescript-eslint/no-explicit-any": "off",
|
|
"@typescript-eslint/no-use-before-define": [
|
|
"error",
|
|
{ functions: false },
|
|
],
|
|
"@typescript-eslint/explicit-function-return-type": [
|
|
"error",
|
|
{ allowExpressions: true },
|
|
],
|
|
"@typescript-eslint/no-floating-promises": "error",
|
|
"@typescript-eslint/no-misused-promises": "error",
|
|
"no-prototype-builtins": "off",
|
|
},
|
|
},
|
|
{
|
|
files: ["ui/**/*.ts", "ui/**/*.tsx"],
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.browser,
|
|
},
|
|
},
|
|
},
|
|
);
|