-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnode.js
More file actions
62 lines (59 loc) · 1.77 KB
/
node.js
File metadata and controls
62 lines (59 loc) · 1.77 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
import node from 'eslint-plugin-n';
import globals from 'globals';
const baseConfig = node.configs['flat/recommended-script'];
export const nodeConfig = [
{
plugins: {
n: node,
},
languageOptions: {
...baseConfig.languageOptions,
globals: {
...baseConfig.languageOptions.globals,
...globals.es2021,
...globals.nodeBuiltin,
...globals.node,
},
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
rules: {
...baseConfig.rules,
'n/file-extension-in-import': ['error', 'always'],
'n/no-extraneous-import': 'error',
'n/no-extraneous-require': 'error',
'n/no-missing-import': 'error',
'n/no-missing-require': 'error',
'n/no-unpublished-bin': 'error',
'n/no-unpublished-import': 'off',
'n/no-unpublished-require': 'off',
'n/process-exit-as-throw': 'error',
'n/no-deprecated-api': 'error',
'n/prefer-global/console': ['error', 'always'],
'n/prefer-global/process': ['error', 'never'],
'n/prefer-global/text-decoder': ['error', 'always'],
'n/prefer-global/text-encoder': ['error', 'always'],
'n/prefer-global/url-search-params': ['error', 'always'],
'n/prefer-global/url': ['error', 'always'],
'n/prefer-promises/dns': 'error',
'n/prefer-promises/fs': 'error',
'n/no-mixed-requires': ['error', {
grouping: true,
allowCall: true,
}],
'n/no-new-require': 'error',
'n/no-path-concat': 'error',
'n/no-unsupported-features/es-syntax': 'off',
'@stylistic/curly-newline': ['error', {
multiline: true,
minElements: 1,
}],
},
},
];
export default nodeConfig;