-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.mjs
More file actions
41 lines (40 loc) · 1.42 KB
/
Copy patheslint.config.mjs
File metadata and controls
41 lines (40 loc) · 1.42 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
// @ts-check
import tseslint from 'typescript-eslint';
// Minimal, non-type-aware lint. Purpose: catch the class of issues `tsc` does
// NOT — the repo intentionally omits `noUnusedLocals`, so unused imports /
// variables and unreachable code slip through `npm run typecheck`. (See the
// dead `import { z }` that survived #262 and had to be caught by hand in #263.)
//
// All rules are WARNINGS by design: `npm run lint` exits 0 even with findings,
// so it is non-blocking — CI surfaces issues without gating merges. Promote a
// rule to 'error' (and add `--max-warnings 0`) later if/when the team wants it
// to gate.
export default tseslint.config(
{
ignores: ['dist/**', 'node_modules/**', '.forge/**', 'examples/**', 'coverage/**'],
},
{
files: ['src/**/*.ts', 'test/**/*.ts', 'scripts/**/*.mjs'],
plugins: { '@typescript-eslint': tseslint.plugin },
languageOptions: {
parser: tseslint.parser,
ecmaVersion: 2023,
sourceType: 'module',
},
rules: {
// The core rule misfires on TS type positions; use the TS-aware version.
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrors: 'none',
ignoreRestSiblings: true,
},
],
'no-unreachable': 'warn',
'no-constant-condition': ['warn', { checkLoops: false }],
},
},
);