@aarongoldenthal/eslint-config-standard 20.0.0 → 21.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/README.md +31 -8
- package/eslint-comments-config.js +28 -0
- package/esm-config.js +14 -0
- package/jsdoc-config.js +1 -0
- package/package.json +11 -10
- package/recommended.js +1 -0
package/README.md
CHANGED
|
@@ -2,19 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
## Summary
|
|
4
4
|
|
|
5
|
-
Custom standard ESLint configuration for all projects. Includes configurations
|
|
5
|
+
Custom standard ESLint configuration for all projects. Includes configurations
|
|
6
|
+
for `eslint`, `@eslint-community/eslint-plugin-eslint-comments` (formerly
|
|
7
|
+
`eslint-plugin-eslint-comments`), `eslint-plugin-jest`, `eslint-plugin-jsdoc`,
|
|
8
|
+
`eslint-plugin-n` (formerly `eslint-plugin-node`), `eslint-plugin-playwright`,
|
|
9
|
+
`eslint-plugin-promise`, `eslint-plugin-sonarjs`, and `eslint-plugin-unicorn`.
|
|
10
|
+
This package defines all required configurations as `dependencies` so they are
|
|
11
|
+
installed and do not have to be defined in each project.
|
|
6
12
|
|
|
7
|
-
Per recommended best practices, the following configurations include `overrides`
|
|
13
|
+
Per recommended best practices, the following configurations include `overrides`
|
|
14
|
+
so they are only applicable to a subset of files:
|
|
8
15
|
|
|
9
16
|
- `jest-config`: applicable to files matching `['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)']`,
|
|
10
17
|
which is the [default filter for Jest test files](https://jestjs.io/docs/configuration#testmatch-arraystring).
|
|
11
|
-
- `playwright-config`: applicable to files matching `['**/*.pwtest.[jt]s']`,
|
|
18
|
+
- `playwright-config`: applicable to files matching `['**/*.pwtest.[jt]s']`,
|
|
19
|
+
which differentiates them from Jest test files.
|
|
12
20
|
|
|
13
|
-
The configuration as-defined includes a number of formatting rules. The
|
|
21
|
+
The configuration as-defined includes a number of formatting rules. The
|
|
22
|
+
`eslint-config-prettier` package is included as well, and can be added to the
|
|
23
|
+
config if `prettier` is also being used so it takes priority for formatting.
|
|
24
|
+
|
|
25
|
+
There is also an `esm-config` included with overrides for projects using ES
|
|
26
|
+
modules instead of Common JS modules.
|
|
14
27
|
|
|
15
28
|
### Usage
|
|
16
29
|
|
|
17
|
-
There is a `recommended` configuration with all plugin configurations enabled
|
|
30
|
+
There is a `recommended` configuration with all plugin configurations enabled
|
|
31
|
+
except `esm-config` (but including `prettier`). To configure .eslintrc.json
|
|
32
|
+
with this configuration:
|
|
18
33
|
|
|
19
34
|
```json
|
|
20
35
|
{
|
|
@@ -22,11 +37,13 @@ There is a `recommended` configuration with all plugin configurations enabled (i
|
|
|
22
37
|
}
|
|
23
38
|
```
|
|
24
39
|
|
|
25
|
-
To configure .eslintrc.json with individual plugins, use the appropriate subset
|
|
40
|
+
To configure .eslintrc.json with individual plugins, use the appropriate subset
|
|
41
|
+
of the options below:
|
|
26
42
|
|
|
27
43
|
```json
|
|
28
44
|
{
|
|
29
45
|
"extends": [
|
|
46
|
+
"@aarongoldenthal/eslint-config-standard/eslint-comments-config.js",
|
|
30
47
|
"@aarongoldenthal/eslint-config-standard/jest-config",
|
|
31
48
|
"@aarongoldenthal/eslint-config-standard/jsdoc-config",
|
|
32
49
|
"@aarongoldenthal/eslint-config-standard/node-config",
|
|
@@ -35,6 +52,7 @@ To configure .eslintrc.json with individual plugins, use the appropriate subset
|
|
|
35
52
|
"@aarongoldenthal/eslint-config-standard/sonarjs-config",
|
|
36
53
|
"@aarongoldenthal/eslint-config-standard/unicorn-config",
|
|
37
54
|
"@aarongoldenthal/eslint-config-standard",
|
|
55
|
+
"@aarongoldenthal/eslint-config-standard/esm-config",
|
|
38
56
|
"prettier"
|
|
39
57
|
]
|
|
40
58
|
}
|
|
@@ -42,5 +60,10 @@ To configure .eslintrc.json with individual plugins, use the appropriate subset
|
|
|
42
60
|
|
|
43
61
|
Notes:
|
|
44
62
|
|
|
45
|
-
- If used, the `@aarongoldenthal/eslint-config-standard` config should be
|
|
46
|
-
|
|
63
|
+
- If used, the `@aarongoldenthal/eslint-config-standard` config should be
|
|
64
|
+
included after any other `@aarongoldenthal/eslint-config-standard/*`
|
|
65
|
+
configurations except `esm-config` so those settings take precedence.
|
|
66
|
+
- If used, the `esm-config` should be configured after all functional rules
|
|
67
|
+
to ensure the overridden settings take precedence.
|
|
68
|
+
- If used, the `prettier` should be included last to take priority in disabling
|
|
69
|
+
the applicable rules from all other configurations.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
plugins: ['@eslint-community/eslint-comments'],
|
|
5
|
+
rules: {
|
|
6
|
+
'@eslint-community/eslint-comments/disable-enable-pair': [
|
|
7
|
+
'error',
|
|
8
|
+
{ allowWholeFile: true }
|
|
9
|
+
],
|
|
10
|
+
'@eslint-community/eslint-comments/no-aggregating-enable': 'error',
|
|
11
|
+
'@eslint-community/eslint-comments/no-duplicate-disable': 'error',
|
|
12
|
+
'@eslint-community/eslint-comments/no-unlimited-disable': 'error',
|
|
13
|
+
'@eslint-community/eslint-comments/no-unused-disable': 'error',
|
|
14
|
+
'@eslint-community/eslint-comments/no-unused-enable': 'error',
|
|
15
|
+
'@eslint-community/eslint-comments/no-use': [
|
|
16
|
+
'error',
|
|
17
|
+
{
|
|
18
|
+
allow: [
|
|
19
|
+
'eslint-disable',
|
|
20
|
+
'eslint-disable-line',
|
|
21
|
+
'eslint-disable-next-line',
|
|
22
|
+
'eslint-enable'
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
'@eslint-community/eslint-comments/require-description': 'error'
|
|
27
|
+
}
|
|
28
|
+
};
|
package/esm-config.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
parserOptions: {
|
|
5
|
+
sourceType: 'module'
|
|
6
|
+
},
|
|
7
|
+
plugins: ['unicorn'],
|
|
8
|
+
rules: {
|
|
9
|
+
'unicorn/prefer-export-from': 'error',
|
|
10
|
+
'unicorn/prefer-module': 'error',
|
|
11
|
+
'unicorn/prefer-node-protocol': 'error',
|
|
12
|
+
'unicorn/prefer-top-level-await': 'error'
|
|
13
|
+
}
|
|
14
|
+
};
|
package/jsdoc-config.js
CHANGED
|
@@ -35,6 +35,7 @@ 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/informative-docs': 'error',
|
|
38
39
|
'jsdoc/match-description': 'error',
|
|
39
40
|
'jsdoc/multiline-blocks': 'error', // Recommended
|
|
40
41
|
'jsdoc/newline-after-description': 'error', // Recommended
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aarongoldenthal/eslint-config-standard",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "21.0.0",
|
|
4
4
|
"description": "Standard ESLint configuration settings",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
|
-
"url": "
|
|
18
|
+
"url": "https://gitlab.com/gitlab-ci-utils/eslint-config-standard.git"
|
|
19
19
|
},
|
|
20
20
|
"keywords": [
|
|
21
21
|
"eslint"
|
|
@@ -35,21 +35,22 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://gitlab.com/gitlab-ci-utils/eslint-config-standard",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"eslint-
|
|
38
|
+
"@eslint-community/eslint-plugin-eslint-comments": "3.2.1",
|
|
39
|
+
"eslint-config-prettier": "8.8.0",
|
|
39
40
|
"eslint-plugin-jest": "27.2.1",
|
|
40
|
-
"eslint-plugin-jsdoc": "
|
|
41
|
-
"eslint-plugin-n": "15.
|
|
41
|
+
"eslint-plugin-jsdoc": "41.1.1",
|
|
42
|
+
"eslint-plugin-n": "15.7.0",
|
|
42
43
|
"eslint-plugin-playwright": "0.12.0",
|
|
43
44
|
"eslint-plugin-promise": "6.1.1",
|
|
44
|
-
"eslint-plugin-sonarjs": "0.
|
|
45
|
-
"eslint-plugin-unicorn": "
|
|
45
|
+
"eslint-plugin-sonarjs": "0.19.0",
|
|
46
|
+
"eslint-plugin-unicorn": "46.0.0"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"eslint": "^8.
|
|
49
|
-
"jest": "^29.
|
|
49
|
+
"eslint": "^8.38.0",
|
|
50
|
+
"jest": "^29.5.0",
|
|
50
51
|
"jest-junit": "^15.0.0",
|
|
51
52
|
"markdownlint-cli": "^0.33.0",
|
|
52
|
-
"prettier": "^2.8.
|
|
53
|
+
"prettier": "^2.8.7"
|
|
53
54
|
},
|
|
54
55
|
"peerDependencies": {
|
|
55
56
|
"eslint": "^8.27.0"
|