-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
63 lines (62 loc) · 1.99 KB
/
Copy patheslint.config.js
File metadata and controls
63 lines (62 loc) · 1.99 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
import { defineConfig } from 'eslint/config';
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
export default defineConfig(
{
ignores: [
'dist/**',
'node_modules/**',
'coverage/**',
'.worktrees/**',
'package-lock.json',
'.claude/worktrees/**',
// subagent-driven-development scratch (ledger, task briefs, review
// diffs) — throwaway, deleted at the end of each apply run.
'.superpowers/**',
],
},
js.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
// import.meta.dirname requires Node >= 20.11 (engines says >=20; CI uses latest 20.x)
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
},
},
{
// Test-only relaxation: these rules false-positive on the mock/fixture
// idiom — async interface conformance without await, expect(mock.method),
// probing unknown payloads. Promise-safety rules (no-floating-promises,
// no-misused-promises) stay ON here deliberately: an un-awaited assertion
// is exactly the bug class tests must not have.
files: ['test/**'],
rules: {
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
},
},
{
// JS config files (eslint.config.js, commitlint.config.js) sit outside
// tsconfig — no type info, so type-aware rules must not run on them.
files: ['**/*.{js,mjs,cjs}'],
...tseslint.configs.disableTypeChecked,
},
);