-
Notifications
You must be signed in to change notification settings - Fork 137
Expand file tree
/
Copy patheslint.config.js
More file actions
40 lines (39 loc) · 1.16 KB
/
Copy patheslint.config.js
File metadata and controls
40 lines (39 loc) · 1.16 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
import tseslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import security from 'eslint-plugin-security';
export default [
// Type-aware rules for src (tsconfig covers these files)
{
files: ['src/**/*.ts'],
languageOptions: {
parser: tsParser,
parserOptions: { project: './tsconfig.json' },
},
plugins: {
'@typescript-eslint': tseslint,
'security': security,
},
rules: {
'@typescript-eslint/no-deprecated': 'warn',
...security.configs.recommended.rules,
// Too noisy in TypeScript: flags all bracket-notation array/map access (lines[i], arr[idx])
// which are safe integer-indexed accesses indistinguishable from object injection to the rule.
'security/detect-object-injection': 'off',
},
},
// Test files: parse without project (no type-aware rules)
{
files: ['__tests__/**/*.ts'],
languageOptions: {
parser: tsParser,
},
plugins: {
'@typescript-eslint': tseslint,
'security': security,
},
rules: {
...security.configs.recommended.rules,
'security/detect-object-injection': 'off',
},
},
];