-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy patheslint.config.js
More file actions
78 lines (75 loc) · 2.76 KB
/
Copy patheslint.config.js
File metadata and controls
78 lines (75 loc) · 2.76 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
/**
* ESLint flat config — JS lint baseline for ClaudeAutoPM (#611, epic #605).
*
* Scope: bin/, lib/, scripts/, test/ (the framework runtime and its tests).
* Out of scope: autopm/.claude/ (distributed framework content, own lifecycle),
* packages/ (workspaces with their own configs), .claude/ (repo-local config).
*
* Ruleset: eslint:recommended plus no-unused-vars / no-undef / eqeqeq,
* relaxed in tests. Rules switched off below were measured against the
* baseline and are documented inline; re-enable them as cleanups land.
*/
const js = require('@eslint/js');
const globals = require('globals');
module.exports = [
{
ignores: [
'node_modules/**',
'autopm/**',
'packages/**',
'.claude/**',
'coverage/**',
'test-results/**',
'docs/**',
'**/*.backup.js'
]
},
js.configs.recommended,
{
files: ['bin/**/*.js', 'lib/**/*.js', 'scripts/**/*.js', 'test/**/*.js'],
languageOptions: {
ecmaVersion: 2023,
sourceType: 'commonjs',
globals: {
...globals.node
}
},
rules: {
// Real-bug detectors — keep as errors
'no-undef': 'error',
'no-unused-vars': ['error', {
args: 'none', // unused function args are pervasive in yargs handlers
caughtErrors: 'none', // `catch (error)` with intentionally ignored errors
varsIgnorePattern: '^_'
}],
eqeqeq: ['error', 'smart'], // allow `== null` idiom; everything else strict
// Baseline relaxations (measured on #611 baseline; tracked in epic #605).
// Each is OFF because the existing code trips it pervasively and the
// fixes are out of scope for the lint-introduction PR.
'no-empty': ['error', { allowEmptyCatch: true }], // empty catch = deliberate "best effort" pattern
'no-useless-escape': 'off', // regex-heavy parsers; escapes kept for readability
'no-prototype-builtins': 'off' // direct hasOwnProperty calls on plain objects
}
},
{
// Tests: jest globals and looser rules — mocks/stubs commonly shadow
// and redeclare, and intentionally trigger edge cases.
files: ['test/**/*.js'],
languageOptions: {
globals: {
...globals.node,
...globals.jest,
fail: 'readonly' // jasmine-style fail() used by legacy jest-tests suites
}
},
rules: {
'no-unused-vars': ['warn', { args: 'none', caughtErrors: 'none', varsIgnorePattern: '^_' }],
eqeqeq: 'off',
// Output-format assertions match literal multi-space/emoji strings
// (baseline: 10 + 9 hits in test/jest-tests, all intentional)
'no-regex-spaces': 'off',
'no-misleading-character-class': 'off',
'no-useless-catch': 'off' // legacy try/catch-rethrow wrappers around assertions
}
}
];