-
Notifications
You must be signed in to change notification settings - Fork 132
Expand file tree
/
Copy patheslint.config.js
More file actions
73 lines (72 loc) · 2.13 KB
/
Copy patheslint.config.js
File metadata and controls
73 lines (72 loc) · 2.13 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
65
66
67
68
69
70
71
72
73
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({ semi: true }),
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/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',
'no-unused-vars': ['error', {
args: 'none',
caughtErrors: 'all',
ignoreRestSiblings: true,
vars: 'all',
}],
'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) {
let pkgExport;
if (relativePath) {
pkgExport = pkg.exports?.[`./${relativePath}`];
}
if (!relativePath || (!pkgExport && relativePath === 'index')) {
pkgExport = pkg.exports?.['.'] ?? pkg.exports;
}
return pkgExport?.import?.default ??
pkgExport?.import ??
pkgExport?.[0]?.import ??
pkgExport?.default ??
pkgExport ??
(relativePath || pkg.main);
},
},
},
},
},
];