-
Notifications
You must be signed in to change notification settings - Fork 39
/
eslint.config.js
55 lines (54 loc) · 1.72 KB
/
eslint.config.js
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
import globals from 'globals';
import pluginJs from '@eslint/js';
import pluginJsdoc from 'eslint-plugin-jsdoc';
import pluginJson from 'eslint-plugin-json';
import pluginMocha from 'eslint-plugin-mocha';
import pluginNode from 'eslint-plugin-n';
import pluginChaiExpect from 'eslint-plugin-chai-expect';
import pluginSecurity from 'eslint-plugin-security';
import pluginSecurityNode from 'eslint-plugin-security-node';
// TODO wait for eslint-plugin-import to be usable in eslint v9; corresponding
// issue see https://github.com/import-js/eslint-plugin-import/issues/2948
export default [
{
ignores: ['**/.vscode/'],
},
pluginJs.configs.recommended,
pluginJsdoc.configs['flat/recommended'],
pluginMocha.configs.flat.recommended,
pluginNode.configs['flat/recommended-module'],
pluginChaiExpect.configs['recommended-flat'],
pluginSecurity.configs.recommended,
{
files: ['**/*.js'],
languageOptions: {
globals: {
...globals.nodeBuiltin,
...globals.mocha,
},
},
plugins: {
'security-node': pluginSecurityNode,
},
rules: {
'mocha/no-mocha-arrows': 'off',
'security/detect-non-literal-fs-filename': 'off',
'security/detect-object-injection': 'off',
...pluginSecurityNode.configs.recommended.rules,
// disable redundant checks (already exists as security/detect-possible-timing-attacks)
'security-node/detect-possible-timing-attacks': 'off',
'security-node/non-literal-reg-expr': 'off',
},
},
{
files: ['**/*.json'],
ignores: ['**/.vscode/launch.json'],
plugins: {
pluginJson,
},
processor: pluginJson.processors['.json'],
rules: {
'pluginJson/*': ['error', { allowComments: true }],
},
},
];