-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
76 lines (75 loc) · 2.54 KB
/
.eslintrc.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
const path = require('path');
module.exports = {
root: true,
plugins: ['prettier', 'react', 'react-hooks', 'import'],
extends: [
'eslint:recommended',
'plugin:prettier/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:import/errors',
'plugin:import/warnings',
],
env: {
es6: true,
node: false,
},
ignorePatterns: ['./node_modules', './package.json', './package-lock.json'],
rules: {
'no-inner-declarations': 'off',
'semi': 'error',
'space-infix-ops': 'error',
'prettier/prettier': [
'error',
{
tabWidth: 4,
singleQuote: true,
printWidth: 140,
quoteProps: 'consistent',
},
],
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react/react-in-jsx-scope': 'error',
'react-hooks/exhaustive-deps': 'error',
'import/order': 'error',
},
overrides: [
{
files: ['*.ts', '*.tsx'],
plugins: ['@typescript-eslint'],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: [path.resolve(__dirname, './tsconfig.json')],
},
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:import/typescript',
],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-enum': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: '^_', argsIgnorePattern: '^_' }],
'@typescript-eslint/explicit-module-boundary-types': 'error',
'no-restricted-syntax': [
'error',
{
selector: 'TSEnumDeclaration',
message: "Don't use enums. Use union type instead.",
},
],
},
},
{
files: ['.eslintrc.js', 'webpack.config.js', 'babel.config.js'],
env: {
node: true,
},
},
],
};