-
Notifications
You must be signed in to change notification settings - Fork 161
Expand file tree
/
Copy path.eslintrc.security.js
More file actions
43 lines (41 loc) · 1.49 KB
/
Copy path.eslintrc.security.js
File metadata and controls
43 lines (41 loc) · 1.49 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
/**
* ESLint Security Configuration
*
* This configuration enables security-focused linting rules for the security scanner.
* It extends the base ESLint configuration with security-specific plugins and rules.
*/
module.exports = {
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
plugins: ["@typescript-eslint", "security"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2022,
sourceType: "module",
},
env: {
node: true,
es2022: true,
},
rules: {
// Security plugin rules
"security/detect-object-injection": "error",
"security/detect-non-literal-regexp": "warn",
"security/detect-non-literal-require": "error",
"security/detect-non-literal-fs-filename": "error",
"security/detect-eval-with-expression": "error",
"security/detect-pseudoRandomBytes": "error",
"security/detect-possible-timing-attacks": "warn",
"security/detect-no-csrf-before-method-override": "error",
"security/detect-buffer-noassert": "error",
"security/detect-child-process": "warn",
"security/detect-disable-mustache-escape": "error",
"security/detect-new-buffer": "error",
"security/detect-unsafe-regex": "error",
// TypeScript security rules
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
},
};