-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
111 lines (111 loc) · 3.07 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:react/jsx-runtime',
'plugin:storybook/recommended',
'plugin:jsx-a11y/recommended',
'plugin:prettier/recommended',
],
plugins: ['react', 'react-hooks', 'react-refresh', 'storybook', 'import', 'jsx-a11y', 'prettier'],
env: {
node: true,
browser: true,
},
settings: {
ecmaVersion: 'latest',
react: {
version: 'detect',
},
'import/resolver': {
node: true,
typescript: {},
},
},
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
ignorePatterns: ['!*.js', '!.storybook', '.*.js', '*.json', 'scripts', 'src/graphql/generated/*'],
rules: {
'react-refresh/only-export-components': 'off',
'newline-before-return': 'error',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'no-console': 'warn',
'no-debugger': 'warn',
'no-warning-comments': 'warn',
'object-shorthand': 'error',
'no-param-reassign': 'off',
'react/prop-types': 'off',
'react/self-closing-comp': [
'error',
{
component: true,
html: true,
},
],
'react/jsx-props-no-spreading': 'off',
'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }],
'jsx-a11y/anchor-is-valid': [
'error',
{
components: ['Link', 'NextLink', 'RouterLink'],
aspects: ['invalidHref'],
},
],
'import/order': [
'error',
{
'newlines-between': 'always',
pathGroups: [
{
pattern: '@/*',
group: 'internal',
},
{
pattern: '@/components/**/*',
group: 'internal',
},
],
pathGroupsExcludedImportTypes: ['builtin'],
groups: [['builtin', 'external'], ['internal'], ['parent', 'sibling', 'index'], 'unknown'],
},
],
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
},
ignorePatterns: ['.eslintrc.cjs', 'vitest.config.ts', 'tests.config.ts', './src/components'],
overrides: [
{
files: ['*.ts', '*.tsx'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:import/typescript',
],
plugins: ['@typescript-eslint/eslint-plugin'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.json'],
tsconfigRootDir: __dirname,
},
rules: {
'@typescript-eslint/no-use-before-define': ['error', { functions: false }],
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
},
},
{
files: ['*story.*', '*stories.*', 'src/pages/**/*.tsx', 'additional.d.ts', '**/__mocks__/**'],
rules: {
'import/no-anonymous-default-export': 'off',
'import/no-default-export': 'off',
},
},
],
};