@aarongoldenthal/eslint-config-standard 23.0.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 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` (but including `prettier`). To configure .eslintrc.json
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aarongoldenthal/eslint-config-standard",
3
- "version": "23.0.0",
3
+ "version": "23.1.0",
4
4
  "description": "Standard ESLint configuration settings",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -28,7 +28,7 @@
28
28
  "files": [
29
29
  "index.js",
30
30
  "*-config.js",
31
- "recommended.js"
31
+ "recommended*.js"
32
32
  ],
33
33
  "bugs": {
34
34
  "url": "https://gitlab.com/gitlab-ci-utils/eslint-config-standard/issues"
@@ -51,6 +51,7 @@
51
51
  "eslint-plugin-playwright": "0.15.3",
52
52
  "eslint-plugin-promise": "6.1.1",
53
53
  "eslint-plugin-sonarjs": "0.19.0",
54
- "eslint-plugin-unicorn": "48.0.0"
54
+ "eslint-plugin-unicorn": "48.0.1",
55
+ "eslint-plugin-vitest": "0.2.6"
55
56
  }
56
57
  }
@@ -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
+ };
@@ -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
+ };