-
Notifications
You must be signed in to change notification settings - Fork 262
Expand file tree
/
Copy patheslint.config.mjs
More file actions
58 lines (56 loc) · 1.63 KB
/
Copy patheslint.config.mjs
File metadata and controls
58 lines (56 loc) · 1.63 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
import {eslintConfigScratch} from 'eslint-config-scratch';
import {globalIgnores} from 'eslint/config';
import globals from 'globals';
const {defineConfig, legacy} = eslintConfigScratch;
export default defineConfig(
{
files: ['**/*.{js,jsx,cjs,mjs}'],
extends: [legacy.base, legacy.es6, legacy.node],
languageOptions: {
globals: globals.node
}
},
{
files: ['src/**/*.{js,jsx}'],
extends: [legacy.base, legacy.es6],
languageOptions: {
globals: {
...globals.node,
__static: 'readonly'
}
}
},
{
files: ['src/main/**/*.{js,jsx}'],
extends: [legacy.base, legacy.es6, legacy.node]
},
{
files: ['src/renderer/**/*.{js,jsx}'],
extends: [legacy.base, legacy.es6, legacy.react],
languageOptions: {
globals: {
...globals.browser,
...globals.node
}
},
settings: {
react: {
version: '16.2'
}
},
rules: {
// This project uses @babel/preset-react with the classic JSX runtime,
// so React must be imported in every JSX file and the linter must
// recognize JSX as a "use" of the React identifier.
'react/jsx-uses-react': 'error',
'react/react-in-jsx-scope': 'error'
}
},
{
files: ['scripts/**/*.{js,jsx,cjs,mjs}', 'webpack.*.js'],
rules: {
'no-console': 'off'
}
},
globalIgnores(['dist/**', 'static/fetched/**', 'node_modules/**'])
);