-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc.js
124 lines (124 loc) · 3.97 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2021,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
project: './tsconfig.json',
tsconfigRootDir: __dirname,
createDefaultProgram: true,
},
plugins: ['@typescript-eslint', 'promise', 'import', 'jest'],
extends: [
'airbnb',
'airbnb/hooks',
'prettier/@typescript-eslint',
'prettier-react',
'plugin:prettier/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:node/recommended',
'plugin:jest/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
env: {
node: true,
browser: true,
es6: true,
commonjs: true,
jest: true,
},
rules: {
'no-unused-vars': 'off',
'explicit-function-return-type': 0,
'class-methods-use-this': 0,
'global-require': [0],
'comma-dangle': 0,
'prefer-destructuring': 0,
'promise/always-return': 'error',
'promise/param-names': 'error',
'promise/catch-or-return': 'error',
'promise/no-native': 'off',
'promise/no-nesting': 'off',
"react/jsx-props-no-spreading": "off",
'promise/no-callback-in-promise': [
'error',
{
exceptions: ['next'],
},
],
'promise/no-new-statics': 'error',
'promise/no-return-in-finally': 'warn',
'import/no-unresolved': [
2,
{
commonjs: true,
amd: true,
},
],
'import/namespace': 2,
'import/default': 2,
'import/export': 2,
'node/exports-style': ['error', 'module.exports'],
'node/prefer-global/buffer': ['error', 'always'],
'node/prefer-global/console': ['error', 'always'],
'node/prefer-global/process': ['error', 'always'],
'node/prefer-global/url-search-params': ['error', 'always'],
'node/prefer-global/url': ['error', 'always'],
'node/no-unsupported-features/es-syntax': [0],
'node/no-missing-import': [0],
'react/jsx-uses-react': 'off',
'react/jsx-uses-vars': 'error',
'react/jsx-filename-extension': ['error', { extensions: ['.js', '.jsx', '.ts', '.tsx'] }],
'react/static-property-placement': 'off',
'react/jsx-fragments': [2, 'syntax'],
'react/prop-types': [2, { skipUndeclared: true }],
'react/react-in-jsx-scope': 'off',
'import/no-extraneous-dependencies': [0],
'import/named': [0],
'@typescript-eslint/prefer-optional-chain': ['error'],
'@typescript-eslint/explicit-function-return-type': [0],
// rules for https://github.com/prettier/eslint-plugin-prettier
'prettier/prettier': [
'error',
{
bracketSpacing: true,
jsxBracketSameLine: true,
printWidth: 120,
semi: true,
singleQuote: true,
tabWidth: 4,
trailingComma: 'es5',
},
],
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
// use <root>/tsconfig.json
typescript: {},
},
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
},
overrides: [
{
files: ["test/**/*.js"],
rules: {
"node/no-unpublished-require": "off"
}
},
{
files: ['webpack.config.*.js'],
rules: {'@typescript-eslint/no-var-requires': 'off'},
}
],
ignorePatterns: ["node_modules/", "dist/"],
};