generated from yandex-praktikum/client-server-template-with-vite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
75 lines (75 loc) · 2.11 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
module.exports = {
env: {
browser: true,
es2020: true,
node: true,
},
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'airbnb', 'airbnb/hooks', 'prettier'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 11,
},
plugins: ['@typescript-eslint', 'react', 'prettier'],
rules: {
'@typescript-eslint/ban-ts-comment': 1,
'import/prefer-default-export': 'off',
'no-multiple-empty-lines': 'error',
'prefer-const': 'error',
'no-use-before-define': 'error',
'object-curly-spacing': [2, 'always'],
'array-bracket-spacing': [2, 'never'],
'jsx-quotes': [2, 'prefer-double'],
quotes: [2, 'single', { allowTemplateLiterals: true }],
'import/extensions': 'off',
'no-param-reassign': 'off', // for reduxtoolkit
// next 2 string for fix bug with using enum with eslint
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
'react/function-component-definition': [
2,
{
namedComponents: 'arrow-function',
unnamedComponents: 'arrow-function',
},
],
'react/jsx-filename-extension': [2, { extensions: ['.js', '.jsx', '.ts', '.tsx'] }],
'no-console': 'error',
semi: 'error',
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
semi: true,
},
],
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'import/no-unresolved': ['error', { ignore: ['@*'] }],
'react-hooks/exhaustive-deps': 2,
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'no-plusplus': 'off',
'react/require-default-props': 'off',
'react/jsx-props-no-spreading': 'off',
'no-underscore-dangle': 'off',
'max-len': ['error', { code: 120, ignoreComments: true }],
'react/destructuring-assignment': 'off',
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
overrides: [
{
files: ['**/*.test.tsx', '**/*.test.ts'],
env: {
jest: true,
},
},
],
globals: {
JSX: true,
},
};