@morgs32/eslint-config 2.0.2 → 2.0.4
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 +53 -1
- package/package.json +7 -5
package/.eslintrc.js
CHANGED
|
@@ -7,13 +7,20 @@ module.exports = {
|
|
|
7
7
|
"**/lib",
|
|
8
8
|
"**/dist",
|
|
9
9
|
],
|
|
10
|
+
settings: {
|
|
11
|
+
react: {
|
|
12
|
+
version: "detect"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
10
15
|
plugins: [
|
|
11
16
|
"import",
|
|
12
17
|
"unused-imports",
|
|
13
18
|
"react",
|
|
14
19
|
"react-hooks",
|
|
15
20
|
"jsx-a11y",
|
|
16
|
-
"@typescript-eslint"
|
|
21
|
+
"@typescript-eslint",
|
|
22
|
+
"jest",
|
|
23
|
+
"testing-library",
|
|
17
24
|
],
|
|
18
25
|
|
|
19
26
|
rules: {
|
|
@@ -250,6 +257,51 @@ module.exports = {
|
|
|
250
257
|
"import/no-anonymous-default-export": "off",
|
|
251
258
|
},
|
|
252
259
|
},
|
|
260
|
+
|
|
261
|
+
// https://github.com/facebook/create-react-app/blob/main/packages/eslint-config-react-app/jest.js
|
|
262
|
+
{
|
|
263
|
+
files: ["**/__tests__/**/*", "**/*.{spec,test}.*"],
|
|
264
|
+
env: {
|
|
265
|
+
"jest/globals": true,
|
|
266
|
+
},
|
|
267
|
+
// A subset of the recommended rules:
|
|
268
|
+
rules: {
|
|
269
|
+
// https://github.com/jest-community/eslint-plugin-jest
|
|
270
|
+
"jest/no-conditional-expect": "error",
|
|
271
|
+
"jest/no-identical-title": "error",
|
|
272
|
+
"jest/no-interpolation-in-snapshots": "error",
|
|
273
|
+
"jest/no-jasmine-globals": "error",
|
|
274
|
+
"jest/no-mocks-import": "error",
|
|
275
|
+
"jest/valid-describe-callback": "error",
|
|
276
|
+
"jest/valid-expect": "error",
|
|
277
|
+
"jest/valid-expect-in-promise": "error",
|
|
278
|
+
"jest/valid-title": "warn",
|
|
279
|
+
|
|
280
|
+
// https://github.com/testing-library/eslint-plugin-testing-library
|
|
281
|
+
"testing-library/await-async-query": "error",
|
|
282
|
+
"testing-library/await-async-utils": "error",
|
|
283
|
+
"testing-library/no-await-sync-query": "error",
|
|
284
|
+
"testing-library/no-container": "error",
|
|
285
|
+
"testing-library/no-debugging-utils": "error",
|
|
286
|
+
"testing-library/no-dom-import": ["error", "react"],
|
|
287
|
+
"testing-library/no-node-access": "error",
|
|
288
|
+
"testing-library/no-promise-in-fire-event": "error",
|
|
289
|
+
"testing-library/no-render-in-setup": "error",
|
|
290
|
+
"testing-library/no-unnecessary-act": "error",
|
|
291
|
+
"testing-library/no-wait-for-empty-callback": "error",
|
|
292
|
+
"testing-library/no-wait-for-multiple-assertions": "error",
|
|
293
|
+
"testing-library/no-wait-for-side-effects": "error",
|
|
294
|
+
"testing-library/no-wait-for-snapshot": "error",
|
|
295
|
+
"testing-library/prefer-find-by": "error",
|
|
296
|
+
"testing-library/prefer-presence-queries": "error",
|
|
297
|
+
"testing-library/prefer-query-by-disappearance": "error",
|
|
298
|
+
"testing-library/prefer-screen-queries": "error",
|
|
299
|
+
"testing-library/render-result-naming-convention": "error",
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
// https://github.com/facebook/create-react-app/blob/main/packages/eslint-config-react-app/index.js
|
|
253
305
|
{
|
|
254
306
|
files: ["**/*.ts?(x)"],
|
|
255
307
|
// parser: "@typescript-eslint/parser",
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morgs32/eslint-config",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": ".eslintrc.js",
|
|
6
6
|
"files": [
|
|
7
7
|
".eslintrc.js"
|
|
8
8
|
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"lint": "eslint ."
|
|
11
|
+
},
|
|
9
12
|
"repository": {
|
|
10
13
|
"type": "git",
|
|
11
14
|
"url": "git+https://github.com/morgs32/eslint-config.git"
|
|
@@ -19,7 +22,9 @@
|
|
|
19
22
|
"dependencies": {
|
|
20
23
|
"@typescript-eslint/eslint-plugin": "^6.2.0",
|
|
21
24
|
"eslint-config-next": "^13.4.12",
|
|
25
|
+
"eslint-plugin-jest": "^27.2.3",
|
|
22
26
|
"eslint-plugin-react": "^7.33.1",
|
|
27
|
+
"eslint-plugin-testing-library": "^5.11.0",
|
|
23
28
|
"eslint-plugin-unused-imports": "^3.0.0"
|
|
24
29
|
},
|
|
25
30
|
"peerDependencies": {
|
|
@@ -34,8 +39,5 @@
|
|
|
34
39
|
"next": "^13.4.12",
|
|
35
40
|
"react": "^18.2.0",
|
|
36
41
|
"typescript": "^5.1.6"
|
|
37
|
-
},
|
|
38
|
-
"scripts": {
|
|
39
|
-
"lint": "eslint ."
|
|
40
42
|
}
|
|
41
|
-
}
|
|
43
|
+
}
|