-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
62 lines (57 loc) · 1.72 KB
/
eslint.config.js
File metadata and controls
62 lines (57 loc) · 1.72 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
// ESLint flat config for ZeroAuth (eslint v9 + typescript-eslint v8)
// Run with `npm run lint`.
import tseslint from 'typescript-eslint';
export default tseslint.config(
{
// ignored everywhere
ignores: [
'node_modules/**',
'dist/**',
'coverage/**',
'dashboard/**',
'website/**',
'circuits/**',
'contracts/**',
'artifacts/**',
'cache/**',
'typechain-types/**',
'scripts/generate-whitepaper.py',
],
},
// Base TypeScript recommended rules (non-type-aware = fast, no project lookup)
...tseslint.configs.recommended,
{
files: ['src/**/*.ts', 'tests/**/*.ts', 'scripts/**/*.ts'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
},
rules: {
// Express middleware needs `(req as any).foo = bar` to attach context.
// We could swap to module augmentation later, but for now allow any.
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
// We intentionally use `void promise.catch(...)` for fire-and-forget work
'@typescript-eslint/no-floating-promises': 'off',
// Empty catch blocks are sometimes intentional (swallow optional ops)
'no-empty': ['warn', { allowEmptyCatch: true }],
// Hardhat scripts use console output
'no-console': 'off',
},
},
{
files: ['tests/**/*.ts'],
rules: {
// Tests reach into private internals via casts on purpose
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'off',
},
},
);