-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
122 lines (122 loc) · 3.03 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
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
112
113
114
115
116
117
118
119
120
121
122
module.exports = {
env: {
browser: true,
es6: true,
},
settings: {
react: {
version: '17.0.2',
},
},
extends: [
'airbnb',
'airbnb/hooks',
'plugin:json/recommended',
'prettier',
'plugin:markdown/recommended',
'plugin:storybook/recommended',
],
parser: '@typescript-eslint/parser',
plugins: [
'import',
'unused-imports',
'promise',
'react',
'tss-unused-classes',
'sort-exports',
],
overrides: [
{
files: '*.mdx',
extends: 'plugin:mdx/recommended',
},
{
files: ['**/*.ts', '**/*.tsx'],
plugins: ['@typescript-eslint'],
extends: ['airbnb-typescript', 'plugin:@typescript-eslint/recommended'],
parserOptions: {
extraFileExtensions: ['.json', '.md'],
ecmaVersion: 2022,
ecmaFeatures: {
jsx: true,
},
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
sourceType: 'module',
},
rules: {
'@typescript-eslint/object-curly-spacing': ['error', 'never'],
'@typescript-eslint/indent': 'off',
'@typescript-eslint/no-loop-func': 'off',
'react/require-default-props': 'off',
'react/jsx-props-no-spreading': 'off',
'react/destructuring-assignment': 'off',
'react/function-component-definition': 'off',
'react/prop-types': 'off',
'no-restricted-exports': 'off',
'no-restricted-syntax': 'off',
'import/prefer-default-export': 'off',
'sort-exports/sort-exports': 'error',
'react/button-has-type': 'off',
'import/order': [
'error',
{
'newlines-between': 'always',
alphabetize: {
order: 'asc',
},
groups: [
'builtin',
'external',
'internal',
'parent',
['index', 'sibling'],
],
},
],
},
},
],
rules: {
'arrow-body-style': 'off',
'no-use-before-define': [
'error',
{
functions: false,
},
],
'react/jsx-filename-extension': [
'error',
{
extensions: ['.js', '.jsx', '.ts', '.tsx', '.mdx'],
},
],
'import/no-extraneous-dependencies': 'off',
'no-restricted-imports': [
'error',
{
patterns: [
{
// https://mui.com/material-ui/guides/minimizing-bundle-size#option-one-use-path-imports
group: ['@mui/*/*/*'],
message: `Please use second-level imports: '@mui/*/*'. `,
},
],
paths: [
{
name: '@mui/material',
message: `Please use '@mui/material/*' path imports instead. `,
},
{
name: '@mui/icons-material',
message: `Please use '@mui/icons-material/*' path imports instead. `,
},
{
name: '@mui/lab',
message: `Please use '@mui/lab/*' path imports instead. `,
},
],
},
],
},
};