-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
57 lines (56 loc) · 2.13 KB
/
Copy patheslint.config.mjs
File metadata and controls
57 lines (56 loc) · 2.13 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
import js from '@eslint/js'
import tseslint from 'typescript-eslint'
import reactHooks from 'eslint-plugin-react-hooks'
import globals from 'globals'
/**
* Flat ESLint config (ESLint v9). Lints the TypeScript/React sources without
* type-checking (fast, no tsconfig project needed) — `npm run typecheck` covers
* type correctness. Rules are kept pragmatic so the check is a useful signal on
* this codebase rather than a wall of stylistic noise.
*/
export default tseslint.config(
{
ignores: [
'out/**',
'dist/**',
'node_modules/**',
'coverage/**',
'**/*.config.{js,mjs,cjs,ts}',
'scripts/**',
],
},
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.{ts,tsx}'],
plugins: { 'react-hooks': reactHooks },
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: { ...globals.node, ...globals.browser },
},
rules: {
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
// `any` is used deliberately at several boundaries (WS payloads, JSON).
'@typescript-eslint/no-explicit-any': 'off',
// Non-null assertions are used intentionally after invariant checks.
'@typescript-eslint/no-non-null-assertion': 'off',
// Allow intentionally-unused args/vars when prefixed with _.
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' },
],
// Empty catch/blocks are sometimes intentional (best-effort cleanup).
'no-empty': ['warn', { allowEmptyCatch: true }],
// \x1b ANSI-escape handling in log/output parsing is intentional.
'no-control-regex': 'off',
// `declare namespace` is used to augment Express Request typing.
'@typescript-eslint/no-namespace': 'off',
// Empty interfaces extending a supertype are a common React props pattern.
'@typescript-eslint/no-empty-object-type': 'off',
// Cross-runtime dynamic require() (e.g. optional electron) is intentional.
'@typescript-eslint/no-require-imports': 'off',
},
}
)