This repository was archived by the owner on Jul 19, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.ts
More file actions
98 lines (90 loc) · 2.79 KB
/
Copy patheslint.config.ts
File metadata and controls
98 lines (90 loc) · 2.79 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import eslintConfigPrettier from "eslint-config-prettier";
import unicorn from "eslint-plugin-unicorn";
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
eslintConfigPrettier,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
plugins: {
unicorn,
},
rules: {
/* No any. Enforced at lint level as well as tsconfig */
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-unsafe-assignment": "error",
"@typescript-eslint/no-unsafe-call": "error",
"@typescript-eslint/no-unsafe-member-access": "error",
"@typescript-eslint/no-unsafe-return": "error",
/* Prefer as-const objects over enums (per project standards) */
"no-restricted-syntax": [
"error",
{
selector: "TSEnumDeclaration",
message:
"Use `as const` objects with type inference instead of enums for better tree-shaking and DX.",
},
],
/* Explicit return types on exported functions */
"@typescript-eslint/explicit-function-return-type": [
"error",
{
allowExpressions: true,
allowTypedFunctionExpressions: true,
allowHigherOrderFunctions: true,
},
],
/* Named exports only */
"no-restricted-exports": ["error", { restrictDefaultExports: { direct: true } }],
/* Prefer readonly */
"@typescript-eslint/prefer-readonly": "error",
/* Consistent type imports */
"@typescript-eslint/consistent-type-imports": [
"error",
{ prefer: "type-imports", fixStyle: "inline-type-imports" },
],
/* No non-null assertions */
"@typescript-eslint/no-non-null-assertion": "error",
/* Unicorn rules for code quality */
"unicorn/prefer-node-protocol": "error",
"unicorn/no-array-for-each": "error",
"unicorn/prefer-ternary": "error",
},
},
{
files: ["vitest.config.ts"],
rules: {
/* Vitest expects a default export from this file. */
"no-restricted-exports": "off",
},
},
{
ignores: [
"dist/",
"coverage/",
"node_modules/",
"docs/",
"vendor/",
"eslint.config.ts",
"tsup.config.ts",
/* Packaged .mcpb output; not part of tsconfig project */
"extension-pack/**",
"scripts/multicorn-ops/**",
"scripts/stage-local-proxy-server.mjs",
/* Claude Code plugin hooks: plain Node scripts, not part of tsconfig */
"plugins/**/hooks/**/*.js",
"plugins/**/hooks/**/*.cjs",
"src/commands/__fixtures__/**",
],
},
);