-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
67 lines (58 loc) · 2.02 KB
/
Copy patheslint.config.js
File metadata and controls
67 lines (58 loc) · 2.02 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
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintConfigPrettier from 'eslint-config-prettier';
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
eslintConfigPrettier,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
// Core project rule: no any
'@typescript-eslint/no-explicit-any': 'error',
// Prefer type imports
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports', fixStyle: 'separate-type-imports' },
],
// Allow underscore-prefixed unused vars (common pattern for destructuring)
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
// Allow non-null assertions (common after Map.has() checks, array bounds)
'@typescript-eslint/no-non-null-assertion': 'warn',
// Allow template literals with numbers and booleans
'@typescript-eslint/restrict-template-expressions': [
'error',
{ allowNumber: true, allowBoolean: true },
],
// MCP tool handlers and CLI commands are async for interface conformance
'@typescript-eslint/require-await': 'off',
// Allow void expressions in arrow shorthand (e.g., logger calls)
'@typescript-eslint/no-confusing-void-expression': [
'error',
{ ignoreArrowShorthand: true },
],
// Warn on deprecated API usage (often from external deps)
'@typescript-eslint/no-deprecated': 'warn',
// Allow dynamic delete (used in mitm-proxy header manipulation)
'@typescript-eslint/no-dynamic-delete': 'off',
},
},
{
// Cookie validation regexes intentionally match control characters
files: ['src/auth.ts'],
rules: {
'no-control-regex': 'off',
},
},
{
ignores: ['dist/', 'node_modules/', 'test/', 'eslint.config.js'],
},
);