-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
75 lines (75 loc) · 2.35 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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.eslint.json',
},
ignorePatterns: ['dist'],
plugins: ['react', 'react-hooks', '@typescript-eslint', 'unused-imports', 'no-relative-import-paths'],
extends: ['eslint:recommended', 'plugin:@tanstack/eslint-plugin-query/recommended', 'plugin:@typescript-eslint/recommended', 'plugin:import/recommended', 'plugin:import/typescript', 'airbnb', 'airbnb-typescript', 'plugin:react/jsx-runtime', 'prettier', 'plugin:storybook/recommended'],
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'consistent-return': 'off',
'import/order': [
'error',
{
alphabetize: { order: 'asc', caseInsensitive: true },
pathGroups: [
{ pattern: 'react*', group: 'builtin', position: 'before' },
{ pattern: '@/**', group: 'external', position: 'after' },
],
pathGroupsExcludedImportTypes: ['builtin'],
},
],
'import/prefer-default-export': 'off',
'newline-before-return': 'error',
'no-relative-import-paths/no-relative-import-paths': [
'error',
{ allowSameFolder: true, prefix: '@', rootDir: 'src' },
],
'no-empty': ['error', { allowEmptyCatch: true }],
'react/function-component-definition': [
'error',
{ namedComponents: 'arrow-function', unnamedComponents: 'arrow-function' },
],
'react/hook-use-state': 'error',
'react/jsx-key': ["error", { "checkFragmentShorthand": true }],
'react/jsx-no-useless-fragment': ['error', { allowExpressions: true }],
'react/jsx-props-no-spreading': 'off',
'react/jsx-sort-props': [
'error',
{
callbacksLast: true,
ignoreCase: true,
multiline: 'last',
noSortAlphabetically: false,
reservedFirst: true,
shorthandFirst: true,
shorthandLast: false,
},
],
'react/require-default-props': 'off',
'react-hooks/exhaustive-deps': 'error',
'sort-imports': [
'error',
{
ignoreCase: true,
ignoreDeclarationSort: true,
},
],
'unused-imports/no-unused-imports': 'error',
},
settings: {
'import/resolver': {
typescript: {},
},
},
overrides: [
{
files: ['**/*', '!src/**/*'],
rules: {
'import/no-extraneous-dependencies': 'off',
},
},
],
};