@wistia/eslint-config 2.2.0 → 2.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @wistia/eslint-config
2
2
 
3
+ ## 2.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#442](https://github.com/wistia/eslint-config/pull/442) [`adc7fe4`](https://github.com/wistia/eslint-config/commit/adc7fe4e8cc21f8fecaee08d254220a97f3584d5) Thanks [@okize](https://github.com/okize)! - feat: remove jest config & rules
8
+
3
9
  ## 2.2.0
4
10
 
5
11
  ### Minor Changes
package/package.json CHANGED
@@ -1,18 +1,17 @@
1
1
  {
2
2
  "name": "@wistia/eslint-config",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Wistia's ESLint configurations",
5
5
  "packageManager": "yarn@4.12.0",
6
6
  "type": "module",
7
7
  "main": "index.mjs",
8
8
  "engines": {
9
- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
9
+ "node": "^20.19.0 || ^22.13.0 || >=24"
10
10
  },
11
11
  "exports": {
12
12
  "./package.json": "./package.json",
13
13
  ".": "./src/configs/javascript.mjs",
14
14
  "./javascript": "./src/configs/javascript.mjs",
15
- "./jest": "./src/configs/jest.mjs",
16
15
  "./node": "./src/configs/node.mjs",
17
16
  "./playwright": "./src/configs/playwright.mjs",
18
17
  "./react": "./src/configs/react.mjs",
@@ -50,9 +49,7 @@
50
49
  "eslint-plugin-barrel-files": "^3.0.1",
51
50
  "eslint-plugin-filenames": "^1.3.2",
52
51
  "eslint-plugin-import-x": "^4.16.2",
53
- "eslint-plugin-jest": "^29.15.0",
54
52
  "eslint-plugin-jest-dom": "^5.5.0",
55
- "eslint-plugin-jest-formatting": "^3.1.0",
56
53
  "eslint-plugin-jsx-a11y": "^6.10.2",
57
54
  "eslint-plugin-n": "^17.24.0",
58
55
  "eslint-plugin-no-only-tests": "^3.3.0",
@@ -64,7 +64,7 @@
64
64
  "undefined": false,
65
65
  "unescape": false,
66
66
  },
67
- "parser": "typescript-eslint/parser@8.57.1",
67
+ "parser": "typescript-eslint/parser@8.57.2",
68
68
  "parserOptions": {
69
69
  "requireConfigFile": false,
70
70
  },
@@ -64,7 +64,7 @@
64
64
  "undefined": false,
65
65
  "unescape": false,
66
66
  },
67
- "parser": "typescript-eslint/parser@8.57.1",
67
+ "parser": "typescript-eslint/parser@8.57.2",
68
68
  "parserOptions": {
69
69
  "ecmaVersion": 2024,
70
70
  "project": "./tsconfig.json",
@@ -78,7 +78,7 @@
78
78
  "plugins": [
79
79
  "@",
80
80
  "@stylistic:@stylistic/eslint-plugin@5.10.0",
81
- "@typescript-eslint:@typescript-eslint/eslint-plugin@8.57.1",
81
+ "@typescript-eslint:@typescript-eslint/eslint-plugin@8.57.2",
82
82
  "barrel-files:eslint-plugin-barrel-files@3.0.1",
83
83
  "filenames",
84
84
  "import-x:eslint-plugin-import-x@4.16.2",
@@ -1,22 +0,0 @@
1
- import jestPlugin from 'eslint-plugin-jest';
2
- import jestFormattingPlugin from 'eslint-plugin-jest-formatting';
3
- import noOnlyTestsPlugin from 'eslint-plugin-no-only-tests';
4
- import jestRules from '../rules/jest.mjs';
5
- import jestFormattingRules from '../rules/jest-formatting.mjs';
6
-
7
- export default [
8
- {
9
- languageOptions: {
10
- globals: jestPlugin.environments.globals.globals,
11
- },
12
- plugins: {
13
- jest: jestPlugin,
14
- 'jest-formatting': jestFormattingPlugin,
15
- 'no-only-tests': noOnlyTestsPlugin,
16
- },
17
- rules: {
18
- ...jestRules,
19
- ...jestFormattingRules,
20
- },
21
- },
22
- ];
@@ -1,36 +0,0 @@
1
- // only add jest-formatting rules (plugin works for vitest as well as jest)
2
- // see: https://github.com/dangreenisrael/eslint-plugin-jest-formatting#rule-documentation
3
-
4
- export default {
5
- // This rule enforces a line of padding before and after 1 or more `afterAll` statements.
6
- // https://github.com/dangreenisrael/eslint-plugin-jest-formatting/blob/master/docs/rules/padding-around-after-all-blocks.md
7
- 'jest-formatting/padding-around-after-all-blocks': 'error',
8
-
9
- // This rule enforces a line of padding before and after 1 or more `afterEach` statements.
10
- // https://github.com/dangreenisrael/eslint-plugin-jest-formatting/blob/master/docs/rules/padding-around-after-each-blocks.md
11
- 'jest-formatting/padding-around-after-each-blocks': 'error',
12
-
13
- // This rule enforces a line of padding before and after `beforeAll` statements.
14
- // https://github.com/dangreenisrael/eslint-plugin-jest-formatting/blob/master/docs/rules/padding-around-before-all-blocks.md
15
- 'jest-formatting/padding-around-before-all-blocks': 'error',
16
-
17
- // This rule enforces a line of padding before and after 1 or more `beforeEach` statements
18
- // https://github.com/dangreenisrael/eslint-plugin-jest-formatting/blob/master/docs/rules/padding-around-before-each-blocks.md
19
- 'jest-formatting/padding-around-before-each-blocks': 'error',
20
-
21
- // This rule enforces a line of padding before and after 1 or more `expect` statements
22
- // https://github.com/dangreenisrael/eslint-plugin-jest-formatting/blob/master/docs/rules/padding-around-expect-groups.md
23
- 'jest-formatting/padding-around-expect-groups': 'error',
24
-
25
- // This rule enforces a line of padding before and after 1 or more `describe` statements
26
- // https://github.com/dangreenisrael/eslint-plugin-jest-formatting/blob/master/docs/rules/padding-around-describe-blocks.md
27
- 'jest-formatting/padding-around-describe-blocks': 'error',
28
-
29
- // This rule enforces a line of padding before and after 1 or more `test`/`it` statements
30
- // https://github.com/dangreenisrael/eslint-plugin-jest-formatting/blob/master/docs/rules/padding-around-test-blocks.md
31
- 'jest-formatting/padding-around-test-blocks': 'error',
32
-
33
- // This is a meta rule that simply enables all of the previous rules
34
- // https://github.com/dangreenisrael/eslint-plugin-jest-formatting/blob/master/docs/rules/padding-around-all.md
35
- 'jest-formatting/padding-around-all': 'off',
36
- };
@@ -1,203 +0,0 @@
1
- // only add jest rules
2
- // see: https://github.com/jest-community/eslint-plugin-jest#rules
3
-
4
- export default {
5
- // Prevent focused tests (.only)
6
- // https://github.com/levibuzolic/eslint-plugin-no-only-tests#usage
7
- 'no-only-tests/no-only-tests': 'error',
8
-
9
- // Have control over `test` and `it` usages
10
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/consistent-test-it.md
11
- 'jest/consistent-test-it': 'error',
12
-
13
- // Enforce assertion to be made in a test body
14
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/expect-expect.md
15
- 'jest/expect-expect': 'error',
16
-
17
- // Enforces a maximum number assertion calls in a test body
18
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/max-expects.md
19
- 'jest/max-expects': [
20
- 'error',
21
- {
22
- max: 15,
23
- },
24
- ],
25
-
26
- // Enforces a maximum depth to nested describe calls
27
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/max-nested-describe.md
28
- 'jest/max-nested-describe': 'error',
29
-
30
- // Disallow alias methods
31
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-alias-methods.md
32
- 'jest/no-alias-methods': 'error',
33
-
34
- // Disallow commented out tests
35
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-commented-out-tests.md
36
- 'jest/no-commented-out-tests': 'error',
37
-
38
- // Prevent calling `expect` conditionally
39
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-conditional-expect.md
40
- 'jest/no-conditional-expect': 'error',
41
-
42
- // Disallow conditional logic in tests
43
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-conditional-in-test.md
44
- 'jest/no-conditional-in-test': 'error',
45
-
46
- // Disallow use of deprecated functions
47
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-deprecated-functions.md
48
- 'jest/no-deprecated-functions': 'error',
49
-
50
- // Disallow disabled tests
51
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-disabled-tests.md
52
- // decision: it is often useful to be allowed to add a .skip
53
- 'jest/no-disabled-tests': 'off',
54
-
55
- // Avoid using a callback in asynchronous tests and hooks
56
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-done-callback.md
57
- 'jest/no-done-callback': 'error',
58
-
59
- // Disallow duplicate setup and teardown hooks
60
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-duplicate-hooks.md
61
- 'jest/no-duplicate-hooks': 'error',
62
-
63
- // Disallow using `exports` in files containing tests
64
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-export.md
65
- 'jest/no-export': 'error',
66
-
67
- // Disallow focused tests
68
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-focused-tests.md
69
- // decision: turned off in favor of the `no-only-tests` rule
70
- 'jest/no-focused-tests': 'off',
71
-
72
- // Disallow setup and teardown hooks
73
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-hooks.md
74
- // decision: hooks are useful even though they *potentially* promote shared state between tests
75
- 'jest/no-hooks': 'off',
76
-
77
- // Disallow identical titles
78
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-identical-title.md
79
- 'jest/no-identical-title': 'error',
80
-
81
- // Disallow string interpolation inside snapshots
82
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-interpolation-in-snapshots.md
83
- 'jest/no-interpolation-in-snapshots': 'error',
84
-
85
- // Disallow Jasmine globals
86
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-jasmine-globals.md
87
- 'jest/no-jasmine-globals': 'error',
88
-
89
- // disallow large snapshots
90
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-large-snapshots.md
91
- // decision: arbitrary but reasonable size limit; although we suggest not writing snapshot tests with the
92
- // `no-snapshot-testing` rule, in cases where we decide to allow them, this rule is beneficial
93
- 'jest/no-large-snapshots': ['error', { maxSize: 500 }],
94
-
95
- // Disallow manually importing from `__mocks__`
96
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-mocks-import.md
97
- 'jest/no-mocks-import': 'error',
98
-
99
- // Disallow specific matchers & modifiers
100
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-restricted-matchers.md
101
- 'jest/no-restricted-matchers': ['error', {}],
102
-
103
- // Disallow using `expect` outside of `it` or `test` blocks
104
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-standalone-expect.md
105
- 'jest/no-standalone-expect': 'error',
106
-
107
- // Use `.only` and `.skip` over `f` and `x`
108
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-test-prefixes.md
109
- 'jest/no-test-prefixes': 'error',
110
-
111
- // Disallow explicitly returning from tests
112
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-test-return-statement.md
113
- 'jest/no-test-return-statement': 'error',
114
-
115
- // Suggest using `toBeCalledWith()` or `toHaveBeenCalledWith()`
116
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-called-with.md
117
- 'jest/prefer-called-with': 'error',
118
-
119
- // Suggest using the built-in comparison matchers
120
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-comparison-matcher.md
121
- 'jest/prefer-comparison-matcher': 'error',
122
-
123
- // Suggest using the built-in equality matchers
124
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-equality-matcher.md
125
- 'jest/prefer-equality-matcher': 'error',
126
-
127
- // Suggest using `expect.assertions()` OR `expect.hasAssertions()`
128
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-expect-assertions.md
129
- 'jest/prefer-expect-assertions': 'off',
130
-
131
- // Prefer `await expect(...).resolves` over `expect(await ...)` syntax
132
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-expect-resolves.md
133
- 'jest/prefer-expect-resolves': 'error',
134
-
135
- // Prefer having hooks in a consistent order
136
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-hooks-in-order.md
137
- 'jest/prefer-hooks-in-order': 'error',
138
-
139
- // Suggest having hooks before any test cases
140
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-hooks-on-top.md
141
- 'jest/prefer-hooks-on-top': 'error',
142
-
143
- // Enforce lowercase test names
144
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-lowercase-title.md
145
- // decision: descriptions are often named after React components which are capitalized
146
- 'jest/prefer-lowercase-title': 'off',
147
-
148
- // Prefer including a hint with external snapshots
149
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-snapshot-hint.md
150
- 'jest/prefer-snapshot-hint': 'error',
151
-
152
- // Suggest using `jest.spyOn()`
153
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-spy-on.md
154
- 'jest/prefer-spy-on': 'error',
155
-
156
- // Suggest using `toStrictEqual()`
157
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-strict-equal.md
158
- 'jest/prefer-strict-equal': 'error',
159
-
160
- // Suggest using `toBe()` for primitive literals
161
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-to-be.md
162
- 'jest/prefer-to-be': 'error',
163
-
164
- // Suggest using `toContain()`
165
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-to-contain.md
166
- 'jest/prefer-to-contain': 'error',
167
-
168
- // Suggest using `toHaveLength()`
169
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-to-have-length.md
170
- 'jest/prefer-to-have-length': 'error',
171
-
172
- // Suggest using `test.todo`
173
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-todo.md
174
- 'jest/prefer-todo': 'error',
175
-
176
- // Require setup and teardown code to be within a hook
177
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/require-hook.md
178
- 'jest/require-hook': 'error',
179
-
180
- // Require a message for `toThrow()`
181
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/require-to-throw-message.md
182
- 'jest/require-to-throw-message': 'error',
183
-
184
- // Require test cases and hooks to be inside a `describe` block
185
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/require-top-level-describe.md
186
- 'jest/require-top-level-describe': 'error',
187
-
188
- // Enforce valid `describe()` callback
189
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/valid-describe-callback.md
190
- 'jest/valid-describe-callback': 'error',
191
-
192
- // Enforce valid `expect()` usage
193
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/valid-expect.md
194
- 'jest/valid-expect': 'error',
195
-
196
- // Ensure promises that have expectations in their chain are valid
197
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/valid-expect-in-promise.md
198
- 'jest/valid-expect-in-promise': 'error',
199
-
200
- // Enforce valid titles
201
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/valid-title.md
202
- 'jest/valid-title': 'error',
203
- };