eslint-plugin-cypress 6.4.4 → 7.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.
Files changed (2) hide show
  1. package/README.md +11 -9
  2. package/package.json +9 -9
package/README.md CHANGED
@@ -6,7 +6,7 @@ Note: If you installed ESLint globally then you must also install `eslint-plugin
6
6
 
7
7
  ## Installation
8
8
 
9
- Prerequisites: [ESLint](https://www.npmjs.com/package/eslint) `v9` or `v10`. Lower versions are no longer supported.
9
+ Prerequisites: [ESLint](https://www.npmjs.com/package/eslint) `v10`. Lower versions are no longer supported.
10
10
 
11
11
  ```sh
12
12
  npm install eslint eslint-plugin-cypress --save-dev
@@ -22,7 +22,6 @@ yarn add eslint eslint-plugin-cypress --dev
22
22
 
23
23
  ESLint as of `v10` and this plugin no longer support the use of the deprecated [eslintrc-type](https://eslint.org/docs/v9.x/use/configure/configuration-files-deprecated) config file format.
24
24
  You must use a [Flat config file](https://eslint.org/docs/latest/use/configure/configuration-files) format.
25
- This is the default in ESLint `v9`, and in ESLint `v10` it is the only config format available.
26
25
 
27
26
  To set up a configuration, add a file `eslint.config.mjs` to the root directory of your Cypress project and include the following instructions to import the available configurations using:
28
27
 
@@ -79,8 +78,6 @@ These rules enforce some of the [best practices recommended for using Cypress](h
79
78
 
80
79
  In the following sections, different examples of possible configuration file contents are given, together with some brief explanations. Adapt these examples according to your needs.
81
80
 
82
- The examples use the `defineConfig()` helper, introduced with ESLint [9.22.0](https://eslint.org/blog/2025/03/eslint-v9.22.0-released/). Refer to the blog article [Evolving flat config with extends](https://eslint.org/blog/2025/03/flat-config-extends-define-config-global-ignores/) for background information. If you are using ESLint `<9.22.0`, import `defineConfig` from [@eslint/config-helpers](https://www.npmjs.com/package/@eslint/config-helpers) instead of from `eslint/config`.
83
-
84
81
  ### Cypress
85
82
 
86
83
  All rules are available by importing from `eslint-plugin-cypress` and can be individually activated.
@@ -230,15 +227,19 @@ During test spec development, [Mocha exclusive tests](https://mochajs.org/#exclu
230
227
 
231
228
  ### Cypress and Mocha recommended
232
229
 
233
- [eslint-plugin-mocha@^11](https://www.npmjs.com/package/eslint-plugin-mocha) is added to the example [Cypress recommended](#cypress-recommended).
230
+ [eslint-plugin-mocha](https://www.npmjs.com/package/eslint-plugin-mocha) is added to the example [Cypress recommended](#cypress-recommended).
234
231
 
235
232
  The settings for individual `mocha` rules from the `configs.recommended` option are changed.
236
233
 
237
- - [mocha/no-exclusive-tests](https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/docs/rules/no-exclusive-tests.md) and [mocha/no-pending-tests](https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/docs/rules/no-pending-tests.md) are set to `error` instead of `warn`
238
- - [mocha/no-mocha-arrows](https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/docs/rules/no-mocha-arrows.md) is set to `off` instead of `error`
234
+ - [mocha/no-exclusive-tests](https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/docs/rules/no-exclusive-tests.md)
235
+ and [mocha/no-pending-tests](https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/docs/rules/no-pending-tests.md)
236
+ are set to `error` instead of `warn`
237
+ - [mocha/no-mocha-arrows](https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/docs/rules/no-mocha-arrows.md)
238
+ and [mocha/no-async-in-sync-tests](https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/documentation/rules/no-async-in-sync-tests.md)
239
+ are set to `off` instead of `error`
239
240
 
240
241
  ```shell
241
- npm install eslint-plugin-mocha@^11 --save-dev
242
+ npm install eslint-plugin-mocha --save-dev
242
243
  ```
243
244
 
244
245
  ```js
@@ -253,6 +254,7 @@ export default defineConfig([
253
254
  pluginCypress.configs.recommended,
254
255
  ],
255
256
  rules: {
257
+ 'mocha/no-async-in-sync-tests': 'off', // for Cypress compatibility
256
258
  'mocha/no-exclusive-tests': 'error',
257
259
  'mocha/no-pending-tests': 'error',
258
260
  'mocha/no-mocha-arrows': 'off',
@@ -271,7 +273,7 @@ Using an assertion such as `expect(value).to.be.true` can fail the ESLint rule `
271
273
  The recommended rules for both plugins are used: `pluginCypress.configs.recommended` and `pluginChaiFriendly.configs.recommendedFlat`:
272
274
 
273
275
  ```shell
274
- npm install eslint-plugin-chai-friendly@^1.0.1 --save-dev
276
+ npm install eslint-plugin-chai-friendly --save-dev
275
277
  ```
276
278
 
277
279
  ```js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-cypress",
3
- "version": "6.4.4",
3
+ "version": "7.0.0",
4
4
  "description": "An ESLint plugin for projects using Cypress",
5
5
  "main": "./lib/index.js",
6
6
  "exports": {
@@ -29,7 +29,7 @@
29
29
  "homepage": "https://github.com/cypress-io/eslint-plugin-cypress#readme",
30
30
  "peerDependencies": {
31
31
  "@typescript-eslint/parser": ">=8",
32
- "eslint": ">=9"
32
+ "eslint": ">=10"
33
33
  },
34
34
  "peerDependenciesMeta": {
35
35
  "@typescript-eslint/parser": {
@@ -37,21 +37,21 @@
37
37
  }
38
38
  },
39
39
  "dependencies": {
40
- "globals": "^17.8.0"
40
+ "globals": "^17.9.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@eslint/js": "^10.0.1",
44
44
  "@stylistic/eslint-plugin": "^5.10.0",
45
- "@typescript-eslint/rule-tester": "^8.65.0",
46
- "cypress": "^15.19.0",
47
- "eslint": "^10.7.0",
45
+ "@typescript-eslint/rule-tester": "^8.66.0",
46
+ "cypress": "^15.20.0",
47
+ "eslint": "^10.8.0",
48
48
  "eslint-doc-generator": "^3.7.0",
49
- "eslint-plugin-eslint-plugin": "^7.5.0",
50
- "eslint-plugin-mocha": "^11.3.0",
49
+ "eslint-plugin-eslint-plugin": "^7.6.1",
50
+ "eslint-plugin-mocha": "^12.0.2",
51
51
  "husky": "^9.1.7",
52
52
  "prettier": "^3.9.6",
53
53
  "typescript": "^6.0.3",
54
- "typescript-eslint": "^8.65.0",
54
+ "typescript-eslint": "^8.66.0",
55
55
  "vitest": "^4.1.10"
56
56
  },
57
57
  "scripts": {