@aarongoldenthal/eslint-config-standard 18.0.0 → 19.0.1

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 CHANGED
@@ -1,6 +1,8 @@
1
1
  # @aarongoldenthal/eslint-config-standard
2
2
 
3
- Custom standard ESLint configuration for all projects. Includes configurations for `eslint`, `eslint-plugin-jest`, `eslint-plugin-jsdoc`, `eslint-plugin-n` (formerly `eslint-plugin-node`), `eslint-plugin-playwright`, `eslint-plugin-sonarjs`, and `eslint-plugin-unicorn`. This package defines all required configurations as `dependencies` so they are installed and do not have to be defined in each project.
3
+ ## Summary
4
+
5
+ Custom standard ESLint configuration for all projects. Includes configurations for `eslint`, `eslint-plugin-jest`, `eslint-plugin-jsdoc`, `eslint-plugin-n` (formerly `eslint-plugin-node`), `eslint-plugin-playwright`, `eslint-plugin-promise`, `eslint-plugin-sonarjs`, and `eslint-plugin-unicorn`. This package defines all required configurations as `dependencies` so they are installed and do not have to be defined in each project.
4
6
 
5
7
  Per recommended best practices, the following configurations include `overrides` so they are only applicable to a subset of files:
6
8
 
@@ -8,25 +10,19 @@ Per recommended best practices, the following configurations include `overrides`
8
10
  which is the [default filter for Jest test files](https://jestjs.io/docs/configuration#testmatch-arraystring).
9
11
  - `playwright-config`: applicable to files matching `['**/*.pwtest.[jt]s']`, which differentiates them from Jest test files.
10
12
 
11
- To configure .eslintrc.json for all plugins:
13
+ The configuration as-defined includes a number of formatting rules. The `eslint-config-prettier` package is included as well, and can be added to the config if `prettier` is also being used so it takes priority for formatting.
14
+
15
+ ### Usage
16
+
17
+ There is a `recommended` configuration with all plugin configurations enabled (including `prettier`). To configure .eslintrc.json with this configuration:
12
18
 
13
19
  ```json
14
20
  {
15
- "extends": [
16
- "@aarongoldenthal/eslint-config-standard/jest-config",
17
- "@aarongoldenthal/eslint-config-standard/jsdoc-config",
18
- "@aarongoldenthal/eslint-config-standard/node-config",
19
- "@aarongoldenthal/eslint-config-standard/playwright-config",
20
- "@aarongoldenthal/eslint-config-standard/sonarjs-config",
21
- "@aarongoldenthal/eslint-config-standard/unicorn-config",
22
- "@aarongoldenthal/eslint-config-standard"
23
- ]
21
+ "extends": ["@aarongoldenthal/eslint-config-standard/recommended"]
24
22
  }
25
23
  ```
26
24
 
27
- Note `@aarongoldenthal/eslint-config-standard` is included last so those settings take precedence.
28
-
29
- The configuration as-defined includes a number of formatting rules. The `eslint-config-prettier` package is included as well, and can be added to the config if `prettier` is also being used so it takes priority for formatting.
25
+ To configure .eslintrc.json with individual plugins, use the appropriate subset of the options below:
30
26
 
31
27
  ```json
32
28
  {
@@ -35,6 +31,7 @@ The configuration as-defined includes a number of formatting rules. The `eslint-
35
31
  "@aarongoldenthal/eslint-config-standard/jsdoc-config",
36
32
  "@aarongoldenthal/eslint-config-standard/node-config",
37
33
  "@aarongoldenthal/eslint-config-standard/playwright-config",
34
+ "@aarongoldenthal/eslint-config-standard/promise-config",
38
35
  "@aarongoldenthal/eslint-config-standard/sonarjs-config",
39
36
  "@aarongoldenthal/eslint-config-standard/unicorn-config",
40
37
  "@aarongoldenthal/eslint-config-standard",
@@ -43,4 +40,7 @@ The configuration as-defined includes a number of formatting rules. The `eslint-
43
40
  }
44
41
  ```
45
42
 
46
- In this case `prettier` is included last to take priority in disabling the applicable rules from all other configurations.
43
+ Notes:
44
+
45
+ - If used, the `@aarongoldenthal/eslint-config-standard` config should be included after any other `@aarongoldenthal/eslint-config-standard/*` configurations so those settings take precedence.
46
+ - If used, the `prettier` should be included last to take priority in disabling the applicable rules from all other configurations.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aarongoldenthal/eslint-config-standard",
3
- "version": "18.0.0",
3
+ "version": "19.0.1",
4
4
  "description": "Standard ESLint configuration settings",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -27,7 +27,8 @@
27
27
  },
28
28
  "files": [
29
29
  "index.js",
30
- "*-config.js"
30
+ "*-config.js",
31
+ "recommended.js"
31
32
  ],
32
33
  "bugs": {
33
34
  "url": "https://gitlab.com/gitlab-ci-utils/eslint-config-standard/issues"
@@ -35,19 +36,20 @@
35
36
  "homepage": "https://gitlab.com/gitlab-ci-utils/eslint-config-standard",
36
37
  "dependencies": {
37
38
  "eslint-config-prettier": "^8.5.0",
38
- "eslint-plugin-jest": "^27.1.5",
39
- "eslint-plugin-jsdoc": "^39.6.2",
40
- "eslint-plugin-n": "^15.5.1",
39
+ "eslint-plugin-jest": "^27.1.7",
40
+ "eslint-plugin-jsdoc": "^39.6.4",
41
+ "eslint-plugin-n": "^15.6.0",
41
42
  "eslint-plugin-playwright": "^0.11.2",
42
- "eslint-plugin-sonarjs": "^0.16.0",
43
- "eslint-plugin-unicorn": "^44.0.2"
43
+ "eslint-plugin-promise": "^6.1.1",
44
+ "eslint-plugin-sonarjs": "^0.17.0",
45
+ "eslint-plugin-unicorn": "^45.0.2"
44
46
  },
45
47
  "devDependencies": {
46
- "eslint": "^8.27.0",
48
+ "eslint": "^8.30.0",
47
49
  "jest": "^29.3.1",
48
- "jest-junit": "^14.0.1",
50
+ "jest-junit": "^15.0.0",
49
51
  "markdownlint-cli": "^0.32.2",
50
- "prettier": "^2.7.1"
52
+ "prettier": "^2.8.1"
51
53
  },
52
54
  "peerDependencies": {
53
55
  "eslint": "^8.27.0"
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ plugins: ['promise'],
5
+ rules: {
6
+ 'promise/always-return': 'error',
7
+ 'promise/avoid-new': 'error',
8
+ 'promise/catch-or-return': 'error',
9
+ 'promise/no-callback-in-promise': 'error',
10
+ 'promise/no-multiple-resolved': 'error',
11
+ 'promise/no-native': 'off',
12
+ 'promise/no-nesting': 'error',
13
+ 'promise/no-new-statics': 'error',
14
+ 'promise/no-promise-in-callback': 'error',
15
+ 'promise/no-return-in-finally': 'error',
16
+ 'promise/no-return-wrap': 'error',
17
+ 'promise/param-names': [
18
+ 'error',
19
+ { resolvePattern: '^resolve$', rejectPattern: '^reject$' }
20
+ ],
21
+ 'promise/prefer-await-to-callbacks': 'error',
22
+ 'promise/prefer-await-to-then': 'error',
23
+ 'promise/valid-params': 'error'
24
+ }
25
+ };
package/recommended.js ADDED
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ extends: [
5
+ './jest-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
+ './index.js',
13
+ 'prettier'
14
+ ]
15
+ };
package/unicorn-config.js CHANGED
@@ -32,6 +32,7 @@ module.exports = {
32
32
  'unicorn/no-invalid-remove-event-listener': 'error',
33
33
  'unicorn/no-keyword-prefix': 'off',
34
34
  'unicorn/no-lonely-if': 'error',
35
+ 'unicorn/no-negated-condition': 'error',
35
36
  'unicorn/no-nested-ternary': 'error',
36
37
  'unicorn/no-new-array': 'error',
37
38
  'unicorn/no-new-buffer': 'off',
@@ -41,6 +42,7 @@ module.exports = {
41
42
  'unicorn/no-static-only-class': 'error',
42
43
  'unicorn/no-thenable': 'error',
43
44
  'unicorn/no-this-assignment': 'error',
45
+ 'unicorn/no-typeof-undefined': 'error',
44
46
  'unicorn/no-unnecessary-await': 'error',
45
47
  'unicorn/no-unreadable-array-destructuring': 'error',
46
48
  'unicorn/no-unreadable-iife': 'error',
@@ -90,6 +92,7 @@ module.exports = {
90
92
  'unicorn/prefer-reflect-apply': 'off',
91
93
  'unicorn/prefer-regexp-test': 'error',
92
94
  'unicorn/prefer-set-has': 'error',
95
+ 'unicorn/prefer-set-size': 'error',
93
96
  'unicorn/prefer-spread': 'error',
94
97
  'unicorn/prefer-string-replace-all': 'off',
95
98
  'unicorn/prefer-string-slice': 'error',