@morgs32/eslint-config 1.0.8 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +138 -13
- package/package.json +16 -12
- package/.eslintrc.example.js +0 -5
package/.eslintrc.js
CHANGED
|
@@ -1,29 +1,19 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
/** @type {import('@typescript-eslint/experimental-utils').TSESLint.Linter.Config} */
|
|
3
1
|
module.exports = {
|
|
4
2
|
extends: [
|
|
5
|
-
'
|
|
6
|
-
'react-app/jest'
|
|
3
|
+
'next/core-web-vitals'
|
|
7
4
|
],
|
|
8
|
-
settings: {
|
|
9
|
-
react: {
|
|
10
|
-
'version': 'detect',
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
5
|
ignorePatterns: [
|
|
14
6
|
'**/lib',
|
|
15
|
-
'
|
|
16
|
-
'public/*'
|
|
7
|
+
'**/dist',
|
|
17
8
|
],
|
|
18
9
|
plugins: [
|
|
19
10
|
'unused-imports',
|
|
11
|
+
'react'
|
|
20
12
|
],
|
|
21
13
|
rules: {
|
|
22
14
|
'spaced-comment': ['error', 'always', { 'markers': ['/'] }],
|
|
23
|
-
'indent': 'off',
|
|
24
15
|
'unused-imports/no-unused-imports': 'error',
|
|
25
16
|
'comma-spacing': ['error', { 'before': false, 'after': true }],
|
|
26
|
-
'@typescript-eslint/indent': ['error', 2],
|
|
27
17
|
'react/jsx-indent': ['error', 2],
|
|
28
18
|
'space-infix-ops': ['error'],
|
|
29
19
|
'react-hooks/rules-of-hooks': 0, // Checks rules of Hooks
|
|
@@ -57,6 +47,141 @@ module.exports = {
|
|
|
57
47
|
},
|
|
58
48
|
},
|
|
59
49
|
],
|
|
50
|
+
'react/jsx-indent-props': [2, 2],
|
|
51
|
+
'react/jsx-first-prop-new-line': [2, 'multiline'],
|
|
52
|
+
|
|
53
|
+
// https://github.com/facebook/create-react-app/blob/main/packages/eslint-config-react-app/index.js
|
|
54
|
+
'array-callback-return': 'warn',
|
|
55
|
+
'default-case': ['warn', { commentPattern: '^no default$' }],
|
|
56
|
+
'dot-location': ['warn', 'property'],
|
|
57
|
+
eqeqeq: ['warn', 'smart'],
|
|
58
|
+
'new-parens': 'warn',
|
|
59
|
+
'no-array-constructor': 'warn',
|
|
60
|
+
'no-caller': 'warn',
|
|
61
|
+
'no-cond-assign': ['warn', 'except-parens'],
|
|
62
|
+
'no-const-assign': 'warn',
|
|
63
|
+
'no-control-regex': 'warn',
|
|
64
|
+
'no-delete-var': 'warn',
|
|
65
|
+
'no-dupe-args': 'warn',
|
|
66
|
+
'no-dupe-class-members': 'warn',
|
|
67
|
+
'no-dupe-keys': 'warn',
|
|
68
|
+
'no-duplicate-case': 'warn',
|
|
69
|
+
'no-empty-character-class': 'warn',
|
|
70
|
+
'no-empty-pattern': 'warn',
|
|
71
|
+
'no-eval': 'warn',
|
|
72
|
+
'no-ex-assign': 'warn',
|
|
73
|
+
'no-extend-native': 'warn',
|
|
74
|
+
'no-extra-bind': 'warn',
|
|
75
|
+
'no-extra-label': 'warn',
|
|
76
|
+
'no-fallthrough': 'warn',
|
|
77
|
+
'no-func-assign': 'warn',
|
|
78
|
+
'no-implied-eval': 'warn',
|
|
79
|
+
'no-invalid-regexp': 'warn',
|
|
80
|
+
'no-iterator': 'warn',
|
|
81
|
+
'no-label-var': 'warn',
|
|
82
|
+
'no-labels': ['warn', { allowLoop: true, allowSwitch: false }],
|
|
83
|
+
'no-lone-blocks': 'warn',
|
|
84
|
+
'no-loop-func': 'warn',
|
|
85
|
+
'no-mixed-operators': [
|
|
86
|
+
'warn',
|
|
87
|
+
{
|
|
88
|
+
groups: [
|
|
89
|
+
['&', '|', '^', '~', '<<', '>>', '>>>'],
|
|
90
|
+
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
|
|
91
|
+
['&&', '||'],
|
|
92
|
+
['in', 'instanceof'],
|
|
93
|
+
],
|
|
94
|
+
allowSamePrecedence: false,
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
'no-multi-str': 'warn',
|
|
98
|
+
'no-global-assign': 'warn',
|
|
99
|
+
'no-unsafe-negation': 'warn',
|
|
100
|
+
'no-new-func': 'warn',
|
|
101
|
+
'no-new-object': 'warn',
|
|
102
|
+
'no-new-symbol': 'warn',
|
|
103
|
+
'no-new-wrappers': 'warn',
|
|
104
|
+
'no-obj-calls': 'warn',
|
|
105
|
+
'no-octal': 'warn',
|
|
106
|
+
'no-octal-escape': 'warn',
|
|
107
|
+
'no-redeclare': 'warn',
|
|
108
|
+
'no-regex-spaces': 'warn',
|
|
109
|
+
'no-restricted-syntax': ['warn', 'WithStatement'],
|
|
110
|
+
'no-script-url': 'warn',
|
|
111
|
+
'no-self-assign': 'warn',
|
|
112
|
+
'no-self-compare': 'warn',
|
|
113
|
+
'no-sequences': 'warn',
|
|
114
|
+
'no-shadow-restricted-names': 'warn',
|
|
115
|
+
'no-sparse-arrays': 'warn',
|
|
116
|
+
'no-template-curly-in-string': 'warn',
|
|
117
|
+
'no-this-before-super': 'warn',
|
|
118
|
+
'no-throw-literal': 'warn',
|
|
119
|
+
'no-undef': 'error',
|
|
120
|
+
'no-unreachable': 'warn',
|
|
121
|
+
'no-unused-expressions': [
|
|
122
|
+
'error',
|
|
123
|
+
{
|
|
124
|
+
allowShortCircuit: true,
|
|
125
|
+
allowTernary: true,
|
|
126
|
+
allowTaggedTemplates: true,
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
'no-unused-labels': 'warn',
|
|
130
|
+
'no-unused-vars': [
|
|
131
|
+
'warn',
|
|
132
|
+
{
|
|
133
|
+
args: 'none',
|
|
134
|
+
ignoreRestSiblings: true,
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
'no-use-before-define': [
|
|
138
|
+
'warn',
|
|
139
|
+
{
|
|
140
|
+
functions: false,
|
|
141
|
+
classes: false,
|
|
142
|
+
variables: false,
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
'no-useless-computed-key': 'warn',
|
|
146
|
+
'no-useless-concat': 'warn',
|
|
147
|
+
'no-useless-constructor': 'warn',
|
|
148
|
+
'no-useless-escape': 'warn',
|
|
149
|
+
'no-useless-rename': [
|
|
150
|
+
'warn',
|
|
151
|
+
{
|
|
152
|
+
ignoreDestructuring: false,
|
|
153
|
+
ignoreImport: false,
|
|
154
|
+
ignoreExport: false,
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
'no-with': 'warn',
|
|
158
|
+
'no-whitespace-before-property': 'warn',
|
|
159
|
+
'react-hooks/exhaustive-deps': 'warn',
|
|
160
|
+
'require-yield': 'warn',
|
|
161
|
+
'rest-spread-spacing': ['warn', 'never'],
|
|
162
|
+
|
|
163
|
+
'react/jsx-no-comment-textnodes': 'warn',
|
|
164
|
+
'react/jsx-no-duplicate-props': 'warn',
|
|
165
|
+
'react/jsx-no-target-blank': 'warn',
|
|
166
|
+
'react/jsx-no-undef': 'error',
|
|
167
|
+
'react/jsx-pascal-case': [
|
|
168
|
+
'warn',
|
|
169
|
+
{
|
|
170
|
+
allowAllCaps: true,
|
|
171
|
+
ignore: [],
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
'react/no-danger-with-children': 'warn',
|
|
175
|
+
// Disabled because of undesirable warnings
|
|
176
|
+
// See https://github.com/facebook/create-react-app/issues/5204 for
|
|
177
|
+
// blockers until its re-enabled
|
|
178
|
+
// 'react/no-deprecated': 'warn',
|
|
179
|
+
'react/no-direct-mutation-state': 'warn',
|
|
180
|
+
'react/no-is-mounted': 'warn',
|
|
181
|
+
'react/no-typos': 'error',
|
|
182
|
+
'react/require-render-return': 'error',
|
|
183
|
+
'react/style-prop-object': 'warn'
|
|
184
|
+
|
|
60
185
|
},
|
|
61
186
|
overrides: [
|
|
62
187
|
{
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morgs32/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": ".eslintrc.js",
|
|
6
6
|
"files": [
|
|
7
|
-
".eslintrc.js"
|
|
8
|
-
".eslintrc.example.js"
|
|
7
|
+
".eslintrc.js"
|
|
9
8
|
],
|
|
10
9
|
"repository": {
|
|
11
10
|
"type": "git",
|
|
@@ -18,19 +17,24 @@
|
|
|
18
17
|
},
|
|
19
18
|
"homepage": "https://github.com/morgs32/eslint-config#readme",
|
|
20
19
|
"dependencies": {
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"eslint": "^
|
|
24
|
-
"eslint-config-react-app": "^7.0.1",
|
|
25
|
-
"eslint-plugin-unused-imports": "^2.0.0"
|
|
20
|
+
"eslint-config-next": "^13.4.12",
|
|
21
|
+
"eslint-plugin-react": "^7.33.1",
|
|
22
|
+
"eslint-plugin-unused-imports": "^3.0.0"
|
|
26
23
|
},
|
|
27
|
-
"
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"eslint": "*",
|
|
26
|
+
"next": "*",
|
|
28
27
|
"react": "*",
|
|
29
28
|
"typescript": "*"
|
|
30
29
|
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/react": "^18.2.17",
|
|
32
|
+
"eslint": "^8.46.0",
|
|
33
|
+
"next": "^13.4.12",
|
|
34
|
+
"react": "^18.2.0",
|
|
35
|
+
"typescript": "^5.1.6"
|
|
36
|
+
},
|
|
31
37
|
"scripts": {
|
|
32
|
-
"lint": "
|
|
33
|
-
"postinstall": "npm run copy || exit 0",
|
|
34
|
-
"copy": "cp -n .eslintrc.example.js $INIT_CWD/.eslintrc.js"
|
|
38
|
+
"lint": "eslint ."
|
|
35
39
|
}
|
|
36
40
|
}
|