forked from mkosir/react-parallax-tilt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
85 lines (74 loc) · 2.24 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
const eslintConfig = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.dev.json'],
},
plugins: ['@typescript-eslint', 'testing-library', 'jest-dom', 'jest', 'import'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:@typescript-eslint/strict',
'prettier',
'plugin:prettier/recommended',
'plugin:jsx-a11y/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:no-array-reduce/recommended',
'plugin:testing-library/react',
'plugin:jest-dom/recommended',
'plugin:storybook/recommended',
],
rules: {
'react/prop-types': 'off',
'prefer-template': 'error',
'no-nested-ternary': 'error',
'no-unneeded-ternary': 'error',
'spaced-comment': 'error',
'id-length': ['error', { min: 2, properties: 'never' }],
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }],
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/array-type': ['error', { default: 'generic' }],
'@typescript-eslint/ban-types': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/no-unnecessary-condition': 'error',
'jest/valid-title': [
'error',
{
mustMatch: {
it: [/should.*when/u.source, "Test title must include 'should' and 'when'"],
},
},
],
'import/no-default-export': 'error',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
},
overrides: [
{
files: ['stories/**/*.demozap.*'],
rules: {
'import/no-default-export': 'off',
},
},
],
// ESlint default behaviour ignores file/folders starting with "." - https://github.com/eslint/eslint/issues/10341
ignorePatterns: ['!.*', 'dist', 'node_modules'],
settings: {
'import/resolver': {
typescript: {},
},
react: {
version: 'detect',
},
},
};
module.exports = eslintConfig;