-
Notifications
You must be signed in to change notification settings - Fork 123
Expand file tree
/
Copy patheslint.config.js
More file actions
64 lines (63 loc) · 1.86 KB
/
eslint.config.js
File metadata and controls
64 lines (63 loc) · 1.86 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
63
64
import globals from 'globals';
import pluginJs from '@eslint/js';
import neostandard from 'neostandard';
import nodePlugin from 'eslint-plugin-n';
import pluginPromise from 'eslint-plugin-promise';
import importPlugin from 'eslint-plugin-import';
export default [
pluginJs.configs.recommended,
...neostandard(),
nodePlugin.configs['flat/recommended'],
pluginPromise.configs['flat/recommended'],
importPlugin.flatConfigs.recommended,
{
ignores: [
'**/.git',
'**/.nyc_output',
'coverage/',
'node_modules/',
'lib/wpt/templates/',
'test/fixtures/release/*.js', // Copied from the nodejs/node repo
],
},
{
languageOptions: {
globals: globals.nodeBuiltin,
sourceType: 'module',
ecmaVersion: 'latest',
},
rules: {
'@stylistic/semi': ['error', 'always'],
'@stylistic/space-before-function-paren': ['error', 'never'],
'@stylistic/no-multi-spaces': ['error', { ignoreEOLComments: true }],
camelcase: 'off',
'@stylistic/max-len': [
2,
100,
4,
{ ignoreRegExpLiterals: true, ignoreUrls: true },
],
'@stylistic/object-property-newline': 'off',
'promise/always-return': ['error', { ignoreLastCallback: true }],
'n/no-process-exit': 'off',
'n/no-unsupported-features/node-builtins': 'off',
},
settings: {
'import/resolver': {
node: {
pathFilter(pkg, path, relativePath) {
const pkgExport = relativePath
? pkg.exports?.[`./${relativePath}`]
: pkg.exports?.['.'];
return pkgExport?.import?.default ??
pkgExport?.import ??
pkgExport?.[0]?.import ??
pkgExport?.default ??
pkgExport ??
(relativePath || pkg.main);
},
},
},
},
},
];