@aarongoldenthal/eslint-config-standard 22.1.0 → 23.1.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/README.md +15 -2
- package/jsdoc-config.js +2 -1
- package/package.json +19 -20
- package/playwright-config.js +7 -0
- package/recommended-vitest.js +16 -0
- package/unicorn-config.js +0 -1
- package/vitest-config.js +73 -0
package/README.md
CHANGED
|
@@ -28,8 +28,8 @@ modules instead of Common JS modules.
|
|
|
28
28
|
### Usage
|
|
29
29
|
|
|
30
30
|
There is a `recommended` configuration with all plugin configurations enabled
|
|
31
|
-
except `esm-config` (
|
|
32
|
-
with this configuration:
|
|
31
|
+
except `esm-config` and `vitest-config` (it includes `jest-config`). To
|
|
32
|
+
configure .eslintrc.json with this configuration:
|
|
33
33
|
|
|
34
34
|
```json
|
|
35
35
|
{
|
|
@@ -37,6 +37,16 @@ with this configuration:
|
|
|
37
37
|
}
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
+
There is also a `recommended-vitest` configuration that is the same as the
|
|
41
|
+
`recommended` config, but includes the `vitest-config` instead of the
|
|
42
|
+
`jest-config`, and can be configured with:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"extends": ["@aarongoldenthal/eslint-config-standard/recommended-vitest"]
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
40
50
|
To configure .eslintrc.json with individual plugins, use the appropriate subset
|
|
41
51
|
of the options below:
|
|
42
52
|
|
|
@@ -51,6 +61,7 @@ of the options below:
|
|
|
51
61
|
"@aarongoldenthal/eslint-config-standard/promise-config",
|
|
52
62
|
"@aarongoldenthal/eslint-config-standard/sonarjs-config",
|
|
53
63
|
"@aarongoldenthal/eslint-config-standard/unicorn-config",
|
|
64
|
+
"@aarongoldenthal/eslint-config-standard/vitest-config",
|
|
54
65
|
"@aarongoldenthal/eslint-config-standard",
|
|
55
66
|
"@aarongoldenthal/eslint-config-standard/esm-config",
|
|
56
67
|
"prettier"
|
|
@@ -63,6 +74,8 @@ Notes:
|
|
|
63
74
|
- If used, the `@aarongoldenthal/eslint-config-standard` config should be
|
|
64
75
|
included after any other `@aarongoldenthal/eslint-config-standard/*`
|
|
65
76
|
configurations except `esm-config` so those settings take precedence.
|
|
77
|
+
- The `jest-config` and `vitest-config` have the same file overrides, so only
|
|
78
|
+
one should be used.
|
|
66
79
|
- If used, the `esm-config` should be configured after all functional rules
|
|
67
80
|
to ensure the overridden settings take precedence.
|
|
68
81
|
- If used, the `prettier` should be included last to take priority in disabling
|
package/jsdoc-config.js
CHANGED
|
@@ -35,12 +35,13 @@ module.exports = {
|
|
|
35
35
|
'jsdoc/check-values': 'error', // Recommended
|
|
36
36
|
'jsdoc/empty-tags': 'error', // Recommended
|
|
37
37
|
'jsdoc/implements-on-classes': 'error', // Recommended
|
|
38
|
+
'jsdoc/imports-as-dependencies': 'error',
|
|
38
39
|
'jsdoc/informative-docs': 'error',
|
|
39
40
|
'jsdoc/match-description': 'error',
|
|
40
41
|
'jsdoc/multiline-blocks': 'error', // Recommended
|
|
41
42
|
'jsdoc/no-bad-blocks': 'error',
|
|
42
43
|
'jsdoc/no-blank-blocks': 'error',
|
|
43
|
-
'jsdoc/no-defaults': '
|
|
44
|
+
'jsdoc/no-defaults': ['error', { contexts: ['any'] }],
|
|
44
45
|
'jsdoc/no-missing-syntax': 'off',
|
|
45
46
|
'jsdoc/no-multi-asterisks': 'error', // Recommended
|
|
46
47
|
'jsdoc/no-restricted-syntax': 'off',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aarongoldenthal/eslint-config-standard",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "23.1.0",
|
|
4
4
|
"description": "Standard ESLint configuration settings",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"lint": "npm run lint-js && npm run lint-md",
|
|
10
10
|
"lint-js": "eslint .",
|
|
11
11
|
"lint-md": "markdownlint-cli2 \"**/*.md\" \"#node_modules\"",
|
|
12
|
-
"prettier-check": "prettier --check
|
|
13
|
-
"prettier-fix": "prettier --write
|
|
12
|
+
"prettier-check": "prettier --check .",
|
|
13
|
+
"prettier-fix": "prettier --write .",
|
|
14
14
|
"test": "jest --ci"
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
@@ -28,31 +28,30 @@
|
|
|
28
28
|
"files": [
|
|
29
29
|
"index.js",
|
|
30
30
|
"*-config.js",
|
|
31
|
-
"recommended
|
|
31
|
+
"recommended*.js"
|
|
32
32
|
],
|
|
33
33
|
"bugs": {
|
|
34
34
|
"url": "https://gitlab.com/gitlab-ci-utils/eslint-config-standard/issues"
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://gitlab.com/gitlab-ci-utils/eslint-config-standard",
|
|
37
|
-
"
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"eslint": "8.45.0",
|
|
39
|
+
"jest": "29.6.1",
|
|
40
|
+
"jest-junit": "16.0.0",
|
|
41
|
+
"markdownlint-cli2": "0.8.1",
|
|
42
|
+
"prettier": "3.0.0"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
38
45
|
"@eslint-community/eslint-plugin-eslint-comments": "3.2.1",
|
|
46
|
+
"eslint": "^8.27.0",
|
|
39
47
|
"eslint-config-prettier": "8.8.0",
|
|
40
|
-
"eslint-plugin-jest": "27.2.
|
|
41
|
-
"eslint-plugin-jsdoc": "
|
|
42
|
-
"eslint-plugin-n": "16.0.
|
|
43
|
-
"eslint-plugin-playwright": "0.
|
|
48
|
+
"eslint-plugin-jest": "27.2.3",
|
|
49
|
+
"eslint-plugin-jsdoc": "46.4.4",
|
|
50
|
+
"eslint-plugin-n": "16.0.1",
|
|
51
|
+
"eslint-plugin-playwright": "0.15.3",
|
|
44
52
|
"eslint-plugin-promise": "6.1.1",
|
|
45
53
|
"eslint-plugin-sonarjs": "0.19.0",
|
|
46
|
-
"eslint-plugin-unicorn": "
|
|
47
|
-
|
|
48
|
-
"devDependencies": {
|
|
49
|
-
"eslint": "^8.41.0",
|
|
50
|
-
"jest": "^29.5.0",
|
|
51
|
-
"jest-junit": "^16.0.0",
|
|
52
|
-
"markdownlint-cli2": "^0.7.1",
|
|
53
|
-
"prettier": "^2.8.8"
|
|
54
|
-
},
|
|
55
|
-
"peerDependencies": {
|
|
56
|
-
"eslint": "^8.27.0"
|
|
54
|
+
"eslint-plugin-unicorn": "48.0.1",
|
|
55
|
+
"eslint-plugin-vitest": "0.2.6"
|
|
57
56
|
}
|
|
58
57
|
}
|
package/playwright-config.js
CHANGED
|
@@ -9,6 +9,7 @@ module.exports = {
|
|
|
9
9
|
files: ['**/*.pwtest.[jt]s'],
|
|
10
10
|
plugins: ['playwright'],
|
|
11
11
|
rules: {
|
|
12
|
+
'playwright/expect-expect': 'error',
|
|
12
13
|
'playwright/max-nested-describe': 'error',
|
|
13
14
|
'playwright/missing-playwright-await': 'error',
|
|
14
15
|
'playwright/no-conditional-in-test': 'error',
|
|
@@ -16,14 +17,20 @@ module.exports = {
|
|
|
16
17
|
'playwright/no-eval': 'error',
|
|
17
18
|
'playwright/no-focused-test': 'error',
|
|
18
19
|
'playwright/no-force-option': 'error',
|
|
20
|
+
'playwright/no-nested-step': 'error',
|
|
21
|
+
'playwright/no-networkidle': 'error',
|
|
22
|
+
'playwright/no-nth-methods': 'error',
|
|
19
23
|
'playwright/no-page-pause': 'error',
|
|
20
24
|
'playwright/no-skipped-test': 'error',
|
|
25
|
+
'playwright/no-useless-await': 'error',
|
|
21
26
|
'playwright/no-useless-not': 'error',
|
|
22
27
|
'playwright/no-wait-for-timeout': 'error',
|
|
23
28
|
'playwright/prefer-lowercase-title': 'error',
|
|
24
29
|
'playwright/prefer-strict-equal': 'error',
|
|
25
30
|
'playwright/prefer-to-be': 'error',
|
|
31
|
+
'playwright/prefer-to-contain': 'error',
|
|
26
32
|
'playwright/prefer-to-have-length': 'error',
|
|
33
|
+
'playwright/prefer-web-first-assertions': 'error',
|
|
27
34
|
'playwright/require-soft-assertions': 'off',
|
|
28
35
|
'playwright/require-top-level-describe': 'error',
|
|
29
36
|
'playwright/valid-expect': 'error'
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
extends: [
|
|
5
|
+
'./eslint-comments-config.js',
|
|
6
|
+
'./jsdoc-config.js',
|
|
7
|
+
'./node-config.js',
|
|
8
|
+
'./playwright-config.js',
|
|
9
|
+
'./promise-config.js',
|
|
10
|
+
'./sonarjs-config.js',
|
|
11
|
+
'./unicorn-config.js',
|
|
12
|
+
'./vitest-config.js',
|
|
13
|
+
'./index.js',
|
|
14
|
+
'prettier'
|
|
15
|
+
]
|
|
16
|
+
};
|
package/unicorn-config.js
CHANGED
|
@@ -56,7 +56,6 @@ module.exports = {
|
|
|
56
56
|
'unicorn/no-unnecessary-await': 'error', // Recommended
|
|
57
57
|
'unicorn/no-unreadable-array-destructuring': 'error', // Recommended
|
|
58
58
|
'unicorn/no-unreadable-iife': 'error', // Recommended
|
|
59
|
-
'unicorn/no-unsafe-regex': 'error',
|
|
60
59
|
'unicorn/no-unused-properties': 'error',
|
|
61
60
|
'unicorn/no-useless-fallback-in-spread': 'error', // Recommended
|
|
62
61
|
'unicorn/no-useless-length-check': 'error', // Recommended
|
package/vitest-config.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
overrides: [
|
|
5
|
+
{
|
|
6
|
+
files: [
|
|
7
|
+
'**/__tests__/**/*.[jt]s?(x)',
|
|
8
|
+
'**/?(*.)+(spec|test).[jt]s?(x)'
|
|
9
|
+
],
|
|
10
|
+
plugins: ['vitest'],
|
|
11
|
+
rules: {
|
|
12
|
+
'vitest/consistent-test-filename': [
|
|
13
|
+
'error',
|
|
14
|
+
{
|
|
15
|
+
allTestPattern: '.*\\.test\\.[tj]sx?$',
|
|
16
|
+
pattern: '.*\\.test\\.[tj]sx?$'
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
'vitest/consistent-test-it': [
|
|
20
|
+
'error',
|
|
21
|
+
{ fn: 'it', withinDescribe: 'it' }
|
|
22
|
+
],
|
|
23
|
+
'vitest/expect-expect': 'error', // Recommended
|
|
24
|
+
'vitest/max-expects': ['error', { max: 5 }],
|
|
25
|
+
'vitest/max-nested-describe': ['error', { max: 3 }],
|
|
26
|
+
'vitest/no-alias-methods': 'error',
|
|
27
|
+
'vitest/no-commented-out-tests': 'error', // Recommended
|
|
28
|
+
'vitest/no-conditional-expect': 'error',
|
|
29
|
+
'vitest/no-conditional-in-test': 'error',
|
|
30
|
+
'vitest/no-conditional-tests': 'error',
|
|
31
|
+
'vitest/no-disabled-tests': 'error',
|
|
32
|
+
'vitest/no-done-callback': 'error',
|
|
33
|
+
'vitest/no-duplicate-hooks': 'error',
|
|
34
|
+
'vitest/no-focused-tests': 'error',
|
|
35
|
+
'vitest/no-hooks': 'off',
|
|
36
|
+
'vitest/no-identical-title': 'error', // Recommended
|
|
37
|
+
'vitest/no-interpolation-in-snapshots': 'error',
|
|
38
|
+
'vitest/no-large-snapshots': 'off',
|
|
39
|
+
'vitest/no-mocks-import': 'error',
|
|
40
|
+
'vitest/no-restricted-matchers': 'off',
|
|
41
|
+
'vitest/no-restricted-vi-methods': 'off',
|
|
42
|
+
'vitest/no-standalone-expect': 'error',
|
|
43
|
+
'vitest/no-test-prefixes': 'error',
|
|
44
|
+
'vitest/no-test-return-statement': 'error',
|
|
45
|
+
'vitest/prefer-called-with': 'error',
|
|
46
|
+
'vitest/prefer-comparison-matcher': 'error',
|
|
47
|
+
'vitest/prefer-each': 'error',
|
|
48
|
+
'vitest/prefer-equality-matcher': 'error',
|
|
49
|
+
'vitest/prefer-expect-resolves': 'error',
|
|
50
|
+
'vitest/prefer-hooks-in-order': 'error',
|
|
51
|
+
'vitest/prefer-hooks-on-top': 'error',
|
|
52
|
+
'vitest/prefer-lowercase-title': 'error',
|
|
53
|
+
'vitest/prefer-mock-promise-shorthand': 'error',
|
|
54
|
+
'vitest/prefer-snapshot-hint': 'error',
|
|
55
|
+
'vitest/prefer-spy-on': 'error',
|
|
56
|
+
'vitest/prefer-strict-equal': 'error',
|
|
57
|
+
'vitest/prefer-to-be': 'error', // Recommended
|
|
58
|
+
'vitest/prefer-to-be-falsy': 'off',
|
|
59
|
+
'vitest/prefer-to-be-object': 'error',
|
|
60
|
+
'vitest/prefer-to-be-truthy': 'off',
|
|
61
|
+
'vitest/prefer-to-contain': 'error',
|
|
62
|
+
'vitest/prefer-to-have-length': 'error',
|
|
63
|
+
'vitest/prefer-todo': 'error',
|
|
64
|
+
'vitest/require-hook': 'error',
|
|
65
|
+
'vitest/require-to-throw-message': 'error',
|
|
66
|
+
'vitest/require-top-level-describe': 'error',
|
|
67
|
+
'vitest/valid-describe-callback': 'error', // Recommended
|
|
68
|
+
'vitest/valid-expect': 'error', // Recommended
|
|
69
|
+
'vitest/valid-title': 'error' // Recommended
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
};
|