-
Notifications
You must be signed in to change notification settings - Fork 148
Expand file tree
/
Copy patheslint.config.js
More file actions
51 lines (50 loc) · 1.47 KB
/
Copy patheslint.config.js
File metadata and controls
51 lines (50 loc) · 1.47 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
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',
},
},
// Release scripts handle registry output and temporary paths, so keep the
// security rules active and require narrow, justified suppressions.
{
files: ['scripts/**/*.{js,mjs}'],
plugins: {
'security': security,
},
rules: {
...security.configs.recommended.rules,
},
},
];