-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
84 lines (74 loc) · 3.1 KB
/
Copy patheslint.config.mjs
File metadata and controls
84 lines (74 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import js from "@eslint/js";
import {FlatCompat} from "@eslint/eslintrc";
import tseslint from "typescript-eslint";
import importX from "eslint-plugin-import-x";
import prettier from "eslint-config-prettier";
import {fileURLToPath} from "url";
import {dirname} from "path";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
// FlatCompat helper to use legacy configs in flat config format
const compat = new FlatCompat({
baseDirectory: __dirname,
});
export default [
// Global ignores
{
ignores: ["dist/", "node_modules/", "coverage/", "scripts/", "**/*.d.ts", "**/*.js"],
},
// Base ESLint recommended rules
js.configs.recommended,
// TypeScript ESLint recommended configuration
...tseslint.configs.recommended,
// TypeScript files configuration
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
},
},
plugins: {
"import-x": importX,
},
settings: {
"import-x/resolver": {
typescript: true,
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
},
},
rules: {
// Import plugin rules
"import-x/no-cycle": ["error", {maxDepth: 1}],
"import-x/named": "off", // Disable named import checks, as they can conflict with TypeScript's own checks
// ESLint 10 new rules - disabled to maintain existing codebase behavior
"no-useless-assignment": "warn", // Changed from error to warn for gradual adoption
"preserve-caught-error": "warn", // Changed from error to warn for gradual adoption
// Custom rule overrides
"no-cond-assign": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-unnecessary-type-assertion": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-unsafe-function-type": "off",
"@typescript-eslint/no-require-imports": "off",
},
},
// Prettier config (must be last to override formatting rules)
prettier,
// FIXME update eslint-config-katxupa to be ESLint 9+ compatible and remove FlatCompat usage
// Use FlatCompat for eslint-config-katxupa if it's not ESLint 9+ compatible
...compat.extends("katxupa"),
];