-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
56 lines (53 loc) · 1.83 KB
/
eslint.config.js
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
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { FlatCompat } from '@eslint/eslintrc'
import path from 'path'
import { fileURLToPath } from 'url'
import eslintjs from '@eslint/js'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const compat = new FlatCompat({
baseDirectory: __dirname
})
export default [
eslintjs.configs.recommended,
...compat.extends(
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
// 'plugin:react/recommended', // throws error in ESLint, waiting for fix
'plugin:react/jsx-runtime'
),
...compat.config({
root: true,
env: { browser: true, es2020: true },
plugins: [
'react-refresh',
'@stylistic/js'
],
ignorePatterns: [
'/dist/',
'/dist-electron/',
'/release/'
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname
},
rules: {
'react-refresh/only-export-components': ['warn', { allowConstantExport: true } ],
'@stylistic/js/indent': ['warn', 4, { 'SwitchCase': 1 }],
'@stylistic/js/quotes': ['warn', 'single'],
'@stylistic/js/semi': ['warn', 'never'],
'no-empty': ['warn'],
'@typescript-eslint/no-empty-function': ['warn'],
'@typescript-eslint/no-unused-vars': ['warn']
},
settings: {
'react': {
'version': 'detect'
}
}
})
]