-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.cjs
90 lines (90 loc) · 2.14 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
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
module.exports = {
env: {
es6: true,
jest: true,
node: true,
},
extends: [
'eslint:recommended', // eslint
'plugin:@typescript-eslint/eslint-recommended', // typescript
'plugin:@typescript-eslint/recommended', // typescript
'prettier', // prettier
'plugin:prettier/recommended', // prettier
'plugin:jest/recommended', // jest
'plugin:unicorn/recommended', // unicorn
'plugin:import/recommended', // import
'plugin:import/typescript', // import
],
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
parser: '@typescript-eslint/parser',
rules: {
'no-undef': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
{
files: [
'.eslintrc.js',
'.prettierrc.js',
'babel.config.js',
'.huskyrc.js',
'.lintstagedrc.js',
],
rules: {
'unicorn/prefer-module': 'off',
},
},
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'prettier', 'jest', 'unicorn', 'import'],
root: true,
rules: {
'@typescript-eslint/explicit-function-return-type': 'warn',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'after-used',
ignoreRestSiblings: false,
vars: 'all',
},
],
eqeqeq: ['error', 'smart'],
indent: ['error', 2],
'linebreak-style': ['error', 'unix'],
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-empty': 'warn',
'no-unused-vars': 'off',
'prefer-const': ['error'],
quotes: ['error', 'single'],
semi: ['error', 'always'],
'unicorn/filename-case': [
'error',
{
case: 'snakeCase',
},
],
'unicorn/prevent-abbreviations': 'off',
'unicorn/no-for-loop': 'off',
'unicorn/no-null': 'off',
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
jest: {
version: 27,
},
},
};