-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.cjs
49 lines (48 loc) · 1.25 KB
/
.eslintrc.cjs
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
/* eslint-env node */
module.exports = {
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:react-hooks/recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'prettier' // this prevents conflicts between eslint and prettier (eslint-config-prettier)
],
parser: '@typescript-eslint/parser',
root: true,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
tsconfigRootDir: __dirname,
project: true
},
plugins: ['react-refresh', 'unused-imports'],
overrides: [
{
extends: ['plugin:@typescript-eslint/disable-type-checked'],
files: ['./**/*.{js,cjs}']
}
],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'react-refresh/only-export-components': 'warn',
// no unused vars/imports
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_'
}
]
},
settings: {
react: { // eslint-plugin-react
version: 'detect'
}
}
}