-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode.ts
More file actions
31 lines (28 loc) · 879 Bytes
/
node.ts
File metadata and controls
31 lines (28 loc) · 879 Bytes
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
import pluginNode from 'eslint-plugin-n';
import { GLOB_SRC, RULE_PREFIX } from '../consts';
import type { Linter } from 'eslint';
import type { INodeConfigsOptions } from '../types';
export function node(options: INodeConfigsOptions = {}): Linter.Config[] {
const { overrides = {} } = options;
const config = pluginNode.configs['flat/recommended'];
return [
{
...config,
name: `${RULE_PREFIX}/node/shared`,
files: GLOB_SRC,
},
{
name: `${RULE_PREFIX}/node/customize`,
files: GLOB_SRC,
rules: {
'n/handle-callback-err': ['error', '^(err|error)$'],
'n/no-new-require': 'error',
'n/no-path-concat': 'error',
'n/prefer-global/buffer': ['error', 'never'],
'n/prefer-global/process': ['error', 'never'],
'n/no-missing-import': 'off',
...overrides,
},
},
];
}