@aarongoldenthal/eslint-config-standard 17.0.1 → 18.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 CHANGED
@@ -1,6 +1,12 @@
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-node`, `eslint-plugin-sonarjs`, and `eslint-plugin-unicorn`. Defines all required configurations as `dependencies` so they are installed and do not have to be defined in each project.
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.
4
+
5
+ Per recommended best practices, the following configurations include `overrides` so they are only applicable to a subset of files:
6
+
7
+ - `jest-config`: applicable to files matching `['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)']`,
8
+ which is the [default filter for Jest test files](https://jestjs.io/docs/configuration#testmatch-arraystring).
9
+ - `playwright-config`: applicable to files matching `['**/*.pwtest.[jt]s']`, which differentiates them from Jest test files.
4
10
 
5
11
  To configure .eslintrc.json for all plugins:
6
12
 
@@ -10,6 +16,7 @@ To configure .eslintrc.json for all plugins:
10
16
  "@aarongoldenthal/eslint-config-standard/jest-config",
11
17
  "@aarongoldenthal/eslint-config-standard/jsdoc-config",
12
18
  "@aarongoldenthal/eslint-config-standard/node-config",
19
+ "@aarongoldenthal/eslint-config-standard/playwright-config",
13
20
  "@aarongoldenthal/eslint-config-standard/sonarjs-config",
14
21
  "@aarongoldenthal/eslint-config-standard/unicorn-config",
15
22
  "@aarongoldenthal/eslint-config-standard"
@@ -17,7 +24,7 @@ To configure .eslintrc.json for all plugins:
17
24
  }
18
25
  ```
19
26
 
20
- Note `@aarongoldenthal/eslint-config-standard` is included last so those settings take precendence.
27
+ Note `@aarongoldenthal/eslint-config-standard` is included last so those settings take precedence.
21
28
 
22
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.
23
30
 
@@ -27,6 +34,7 @@ The configuration as-defined includes a number of formatting rules. The `eslint-
27
34
  "@aarongoldenthal/eslint-config-standard/jest-config",
28
35
  "@aarongoldenthal/eslint-config-standard/jsdoc-config",
29
36
  "@aarongoldenthal/eslint-config-standard/node-config",
37
+ "@aarongoldenthal/eslint-config-standard/playwright-config",
30
38
  "@aarongoldenthal/eslint-config-standard/sonarjs-config",
31
39
  "@aarongoldenthal/eslint-config-standard/unicorn-config",
32
40
  "@aarongoldenthal/eslint-config-standard",
package/index.js CHANGED
@@ -8,12 +8,12 @@ const nestedThreshold = 5;
8
8
 
9
9
  module.exports = {
10
10
  env: {
11
- es6: true,
11
+ es2022: true,
12
12
  node: true
13
13
  },
14
14
  extends: ['eslint:recommended'],
15
15
  parserOptions: {
16
- ecmaVersion: 2021,
16
+ ecmaVersion: 2022,
17
17
  sourceType: 'script'
18
18
  },
19
19
  reportUnusedDisableDirectives: true,
@@ -42,6 +42,7 @@ module.exports = {
42
42
  'keyword-spacing': ['error', { before: true, after: true }],
43
43
  'linebreak-style': ['error', 'unix'],
44
44
  'lines-between-class-members': ['error', 'always'],
45
+ 'logical-assignment-operators': ['error', 'always'],
45
46
  'max-depth': ['error', { max: nestedThreshold }],
46
47
  'max-lines': ['error', maxLinesThreshold],
47
48
  'max-lines-per-function': [
@@ -62,6 +63,7 @@ module.exports = {
62
63
  'no-div-regex': 'error',
63
64
  'no-duplicate-imports': 'error',
64
65
  'no-else-return': 'error',
66
+ 'no-empty-static-block': 'error',
65
67
  'no-eq-null': 'error',
66
68
  'no-eval': 'error',
67
69
  'no-extend-native': 'error',
@@ -81,6 +83,7 @@ module.exports = {
81
83
  'no-nested-ternary': 'off',
82
84
  'no-new': 'error',
83
85
  'no-new-func': 'error',
86
+ 'no-new-native-nonconstructor': 'error',
84
87
  'no-new-object': 'error',
85
88
  'no-new-wrappers': 'error',
86
89
  'no-param-reassign': ['error', { props: false }],
package/node-config.js CHANGED
@@ -2,46 +2,46 @@
2
2
 
3
3
  module.exports = {
4
4
  // Included to set various globals, all rules are explicitly defined
5
- extends: ['plugin:node/recommended'],
6
- plugins: ['node'],
5
+ extends: ['plugin:n/recommended'],
6
+ plugins: ['n'],
7
7
  rules: {
8
- 'node/callback-return': 'error',
9
- 'node/exports-style': 'error',
10
- 'node/file-extension-in-import': 'error',
11
- 'node/global-require': 'error',
12
- 'node/handle-callback-err': 'error',
13
- 'node/no-callback-literal': 'off',
14
- 'node/no-deprecated-api': 'error',
15
- 'node/no-exports-assign': 'error',
16
- 'node/no-extraneous-import': 'error',
17
- 'node/no-extraneous-require': 'error',
18
- 'node/no-missing-import': 'error',
19
- 'node/no-missing-require': 'error',
20
- 'node/no-mixed-requires': 'off',
21
- 'node/no-new-require': 'error',
22
- 'node/no-path-concat': 'error',
23
- 'node/no-process-env': 'off',
8
+ 'n/callback-return': 'error',
9
+ 'n/exports-style': 'error',
10
+ 'n/file-extension-in-import': 'error',
11
+ 'n/global-require': 'error',
12
+ 'n/handle-callback-err': 'error',
13
+ 'n/no-callback-literal': 'off',
14
+ 'n/no-deprecated-api': 'error',
15
+ 'n/no-exports-assign': 'error',
16
+ 'n/no-extraneous-import': 'error',
17
+ 'n/no-extraneous-require': 'error',
18
+ 'n/no-missing-import': 'error',
19
+ 'n/no-missing-require': 'error',
20
+ 'n/no-mixed-requires': 'off',
21
+ 'n/no-new-require': 'error',
22
+ 'n/no-path-concat': 'error',
23
+ 'n/no-process-env': 'off',
24
24
  // Disabled in favor of unicorn/no-process-exit
25
- 'node/no-process-exit': 'off',
26
- 'node/no-restricted-import': 'off',
27
- 'node/no-restricted-require': 'off',
28
- 'node/no-sync': 'off',
29
- 'node/no-unpublished-bin': 'error',
30
- 'node/no-unpublished-import': 'error',
31
- 'node/no-unpublished-require': 'error',
32
- 'node/no-unsupported-features/es-builtins': 'error',
33
- 'node/no-unsupported-features/es-syntax': 'error',
34
- 'node/no-unsupported-features/node-builtins': 'error',
35
- 'node/prefer-global/buffer': ['error', 'always'],
36
- 'node/prefer-global/console': ['error', 'always'],
37
- 'node/prefer-global/process': ['error', 'always'],
38
- 'node/prefer-global/text-decoder': ['error', 'always'],
39
- 'node/prefer-global/text-encoder': ['error', 'always'],
40
- 'node/prefer-global/url-search-params': ['error', 'always'],
41
- 'node/prefer-global/url': ['error', 'always'],
42
- 'node/prefer-promises/dns': 'error',
43
- 'node/prefer-promises/fs': 'error',
44
- 'node/process-exit-as-throw': 'error',
45
- 'node/shebang': 'error'
25
+ 'n/no-process-exit': 'off',
26
+ 'n/no-restricted-import': 'off',
27
+ 'n/no-restricted-require': 'off',
28
+ 'n/no-sync': 'off',
29
+ 'n/no-unpublished-bin': 'error',
30
+ 'n/no-unpublished-import': 'error',
31
+ 'n/no-unpublished-require': 'error',
32
+ 'n/no-unsupported-features/es-builtins': 'error',
33
+ 'n/no-unsupported-features/es-syntax': 'error',
34
+ 'n/no-unsupported-features/node-builtins': 'error',
35
+ 'n/prefer-global/buffer': ['error', 'always'],
36
+ 'n/prefer-global/console': ['error', 'always'],
37
+ 'n/prefer-global/process': ['error', 'always'],
38
+ 'n/prefer-global/text-decoder': ['error', 'always'],
39
+ 'n/prefer-global/text-encoder': ['error', 'always'],
40
+ 'n/prefer-global/url-search-params': ['error', 'always'],
41
+ 'n/prefer-global/url': ['error', 'always'],
42
+ 'n/prefer-promises/dns': 'error',
43
+ 'n/prefer-promises/fs': 'error',
44
+ 'n/process-exit-as-throw': 'error',
45
+ 'n/shebang': 'error'
46
46
  }
47
47
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aarongoldenthal/eslint-config-standard",
3
- "version": "17.0.1",
3
+ "version": "18.0.0",
4
4
  "description": "Standard ESLint configuration settings",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -35,20 +35,21 @@
35
35
  "homepage": "https://gitlab.com/gitlab-ci-utils/eslint-config-standard",
36
36
  "dependencies": {
37
37
  "eslint-config-prettier": "^8.5.0",
38
- "eslint-plugin-jest": "^27.0.1",
39
- "eslint-plugin-jsdoc": "^39.3.6",
40
- "eslint-plugin-node": "^11.1.0",
41
- "eslint-plugin-sonarjs": "^0.15.0",
42
- "eslint-plugin-unicorn": "^43.0.2"
38
+ "eslint-plugin-jest": "^27.1.5",
39
+ "eslint-plugin-jsdoc": "^39.6.2",
40
+ "eslint-plugin-n": "^15.5.1",
41
+ "eslint-plugin-playwright": "^0.11.2",
42
+ "eslint-plugin-sonarjs": "^0.16.0",
43
+ "eslint-plugin-unicorn": "^44.0.2"
43
44
  },
44
45
  "devDependencies": {
45
- "eslint": "^8.23.0",
46
- "jest": "^29.0.2",
46
+ "eslint": "^8.27.0",
47
+ "jest": "^29.3.1",
47
48
  "jest-junit": "^14.0.1",
48
49
  "markdownlint-cli": "^0.32.2",
49
50
  "prettier": "^2.7.1"
50
51
  },
51
52
  "peerDependencies": {
52
- "eslint": "^8.14.0"
53
+ "eslint": "^8.27.0"
53
54
  }
54
55
  }
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ overrides: [
5
+ {
6
+ files: ['**/*.pwtest.[jt]s'],
7
+ plugins: ['playwright'],
8
+ env: {
9
+ 'shared-node-browser': true
10
+ },
11
+ rules: {
12
+ 'playwright/max-nested-describe': 'error',
13
+ 'playwright/missing-playwright-await': 'error',
14
+ 'playwright/no-conditional-in-test': 'error',
15
+ 'playwright/no-element-handle': 'error',
16
+ 'playwright/no-eval': 'error',
17
+ 'playwright/no-focused-test': 'error',
18
+ 'playwright/no-force-option': 'error',
19
+ 'playwright/no-page-pause': 'error',
20
+ 'playwright/no-skipped-test': 'error',
21
+ 'playwright/no-useless-not': 'error',
22
+ 'playwright/no-wait-for-timeout': 'error',
23
+ 'playwright/prefer-lowercase-title': 'error',
24
+ 'playwright/prefer-to-have-length': 'error',
25
+ 'playwright/require-top-level-describe': 'error',
26
+ 'playwright/valid-expect': 'error'
27
+ }
28
+ }
29
+ ]
30
+ };
package/unicorn-config.js CHANGED
@@ -41,6 +41,7 @@ module.exports = {
41
41
  'unicorn/no-static-only-class': 'error',
42
42
  'unicorn/no-thenable': 'error',
43
43
  'unicorn/no-this-assignment': 'error',
44
+ 'unicorn/no-unnecessary-await': 'error',
44
45
  'unicorn/no-unreadable-array-destructuring': 'error',
45
46
  'unicorn/no-unreadable-iife': 'error',
46
47
  'unicorn/no-unsafe-regex': 'error',
@@ -114,6 +115,7 @@ module.exports = {
114
115
  'unicorn/require-number-to-fixed-digits-argument': 'error',
115
116
  'unicorn/require-post-message-target-origin': 'off',
116
117
  'unicorn/string-content': 'off',
118
+ 'unicorn/switch-case-braces': ['error', 'always'],
117
119
  'unicorn/template-indent': 'off',
118
120
  'unicorn/text-encoding-identifier-case': 'error',
119
121
  'unicorn/throw-new-error': 'error'