forked from sjdemartini/mui-tiptap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
135 lines (135 loc) · 3.9 KB
/
.eslintrc.json
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
123
124
125
126
127
128
129
130
131
132
133
134
135
{
"root": true,
"env": {
"es2021": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"project": "./tsconfig.json"
},
"plugins": [
"react",
"import",
"@typescript-eslint",
"react-refresh",
"tss-unused-classes"
],
"extends": [
"eslint:recommended",
"plugin:eslint-comments/recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime", // Vite enables the automatic JSX runtime
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/strict",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:jsx-a11y/recommended",
"prettier"
],
"reportUnusedDisableDirectives": true,
"settings": {
"import/resolver": {
"typescript": {
"project": "tsconfig.json"
}
},
"react": {
"version": "detect"
}
},
"rules": {
"@typescript-eslint/ban-ts-comment": [
"error",
{
"ts-expect-error": "allow-with-description",
"minimumDescriptionLength": 10
}
],
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/consistent-type-exports": "error",
"@typescript-eslint/consistent-type-imports": [
"warn",
{ "fixStyle": "inline-type-imports" }
],
"@typescript-eslint/no-import-type-side-effects": "error",
"@typescript-eslint/no-misused-promises": [
"error",
{
"checksVoidReturn": false
}
],
"@typescript-eslint/no-unused-vars": [
"warn",
{ "argsIgnorePattern": "^_" } // Ignore arguments that start with an underscore
],
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": [
"./src/demo/**",
"./src/**/__tests__/**",
"vite.config.mts"
],
"includeTypes": true
}
],
"import/no-mutable-exports": "error",
"import/no-unused-modules": "error",
// Note that no-duplicates prefer-inline doesn't yet handle duplicate type
// imports properly
// https://github.com/import-js/eslint-plugin-import/issues/2715
// (improvements are unreleased in eslint-plugin-import)
"import/no-duplicates": ["error", { "prefer-inline": true }],
"no-console": [
"warn",
{
"allow": ["warn", "error"]
}
],
"no-restricted-imports": "off",
"@typescript-eslint/no-restricted-imports": [
"error",
{
"paths": [
{
"name": "lodash",
"message": "Please use specific module imports like \"lodash/foo\" instead of \"lodash\".",
"allowTypeImports": true
},
{
"name": "@mui/icons-material",
"message": "Please use second-level default path imports rather than top-level named imports. See https://github.com/sjdemartini/mui-tiptap/issues/154"
}
],
// Disallow imports of third-level MUI "private" paths per
// https://mui.com/material-ui/guides/minimizing-bundle-size/#option-one-use-path-imports
"patterns": [
{
"group": ["@mui/*/*/*"],
"message": "Imports of third-level MUI \"private\" paths are not allowed per https://mui.com/material-ui/guides/minimizing-bundle-size/#option-one-use-path-imports"
}
]
}
],
"react/function-component-definition": "warn",
"react/jsx-no-useless-fragment": ["warn", { "allowExpressions": true }],
"react-hooks/exhaustive-deps": [
"warn",
{
"additionalHooks": "(useUpdateEffect)"
}
],
"react-refresh/only-export-components": [
"warn",
{ "allowConstantExport": true }
],
"tss-unused-classes/unused-classes": "warn"
}
}