-
Notifications
You must be signed in to change notification settings - Fork 265
Expand file tree
/
Copy patheslint.config.js
More file actions
67 lines (61 loc) · 1.69 KB
/
Copy patheslint.config.js
File metadata and controls
67 lines (61 loc) · 1.69 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
import js from '@eslint/js';
import importPlugin from 'eslint-plugin-import';
import prettierRecommended from 'eslint-plugin-prettier/recommended';
import globals from 'globals';
import { EOL } from 'os';
export default [
// Replaces .eslintignore, which flat config does not read
{
ignores: [
'dist/**',
'.cache/**',
'tmp/**',
'log/**',
'tests/**/_results/**'
]
},
js.configs.recommended,
importPlugin.flatConfigs.recommended,
prettierRecommended,
{
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.browser,
...globals.node
}
},
settings: {
// NOTE: import/no-unresolved cannot see these. Both declare their entry
// points through a package.json "exports" map with conditional keys,
// and the resolver eslint-plugin-import uses does not implement
// "exports" - Node resolves them without trouble, and they work at
// runtime and under test.
//
// Listing them here keeps the rule doing its job everywhere else,
// rather than turning it off or taking on a resolver that is still
// pre-release. Add to this only for packages verified to resolve
// correctly at runtime.
'import/core-modules': ['uuid', 'https-proxy-agent']
},
rules: {
'no-unused-vars': 0,
'import/no-cycle': 2,
'prettier/prettier': [
'error',
{
endOfLine: EOL === '\r\n' ? 'crlf' : 'lf'
}
]
}
},
{
files: ['**/*.test.js', '**/*.spec.js'],
languageOptions: {
globals: {
...globals.jest
}
}
}
];