-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
62 lines (61 loc) · 2.11 KB
/
Copy patheslint.config.mjs
File metadata and controls
62 lines (61 loc) · 2.11 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
import eslint from "@eslint/js";
import globals from "globals";
import tseslint from "typescript-eslint";
import jsdoc from "eslint-plugin-jsdoc";
import eslintConfigPrettier from "eslint-config-prettier";
import eslintTypecheckConfig from "./eslint-typecheck.config.mjs";
import eslintSecurityConfig from "./eslint-security.config.mjs";
export default tseslint.config(
...eslintTypecheckConfig,
...eslintSecurityConfig,
{
ignores: ["eslint.config.mjs", "dist/**", "node_modules/**"],
},
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
jsdoc.configs["flat/recommended-typescript"],
eslintConfigPrettier,
{
languageOptions: {
globals: {
...globals.node,
},
sourceType: "commonjs",
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
rules: {
"@typescript-eslint/no-unsafe-argument": "warn",
"max-params": ["error", 5], // max-args = 5
"max-statements": ["error", 30], // max-statements = 30
"jsdoc/require-jsdoc": [
"error",
{
contexts: [
"FunctionDeclaration",
"MethodDefinition",
"ClassDeclaration",
],
},
],
"jsdoc/require-description": "error",
"jsdoc/require-param-description": "error",
"jsdoc/require-returns-description": "error",
"no-unreachable": "error",
"default-case": "error", // Exhaustive switch cases
"consistent-return": "error", // Explicit returns
"prefer-const": "error", // Immutability like Rust
"@typescript-eslint/switch-exhaustiveness-check": "error", // Match Rust pattern exhaustiveness
// Anti-agent-bias rules
complexity: ["error", 15], // Cognitive complexity limit
// "no-magic-numbers": ["error", {"ignore": [0, 1, -1]}], // Disabled - no equivalent scope to Python PLR2004 (comparison-only)
"id-length": ["error", { min: 2, max: 30 }], // Variable name length
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/no-floating-promises": "off",
},
}
);