Skip to content

Commit d366fa5

Browse files
committed
docs: update eslint-plugin-mocha usage for legacy config support drop
1 parent 2c911ac commit d366fa5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ESLINTRC-CONFIG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Cypress is built on top of [Mocha](https://on.cypress.io/guides/references/bundl
8686
During test spec development, [Mocha exclusive tests](https://mochajs.org/#exclusive-tests) `.only` or [Mocha inclusive tests](https://mochajs.org/#inclusive-tests) `.skip` may be used to control which tests are executed, as described in the Cypress documentation [Excluding and Including Tests](https://on.cypress.io/guides/core-concepts/writing-and-organizing-tests#Excluding-and-Including-Tests). To apply corresponding rules, you can install and use [eslint-plugin-mocha](https://www.npmjs.com/package/eslint-plugin-mocha). The rule [mocha/no-exclusive-tests](https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/docs/rules/no-exclusive-tests.md) detects the use of `.only` and the [mocha/no-skipped-tests](https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/docs/rules/no-skipped-tests.md) rule detects the use of `.skip`:
8787

8888
```sh
89-
npm install --save-dev eslint-plugin-mocha
89+
npm install --save-dev eslint-plugin-mocha@^10
9090
```
9191

9292
In your `.eslintrc.json`:

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,21 +165,21 @@ During test spec development, [Mocha exclusive tests](https://mochajs.org/#exclu
165165

166166
### Cypress and Mocha recommended
167167

168-
[eslint-plugin-mocha](https://www.npmjs.com/package/eslint-plugin-mocha) is added to the example [Cypress recommended](#cypress-recommended). This plugin offers a flat file recommended option `configs.flat.recommended`.
168+
[eslint-plugin-mocha@^11](https://www.npmjs.com/package/eslint-plugin-mocha) is added to the example [Cypress recommended](#cypress-recommended). This version of the plugin supports only flat file configurations with the option `configs.recommended`.
169169

170-
The settings for individual `mocha` rules from the `configs.flat.recommended` option are changed.
170+
The settings for individual `mocha` rules from the `configs.recommended` option are changed.
171171
- [mocha/no-exclusive-tests](https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/docs/rules/no-exclusive-tests.md) and [mocha/no-skipped-tests](https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/docs/rules/no-skipped-tests.md) are set to `error` instead of `warn`
172172
- [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`
173173

174174
```shell
175-
npm install eslint-plugin-mocha@^10.5.0 --save-dev
175+
npm install eslint-plugin-mocha@^11 --save-dev
176176
```
177177

178178
```js
179179
import pluginMocha from 'eslint-plugin-mocha'
180180
import pluginCypress from 'eslint-plugin-cypress/flat'
181181
export default [
182-
pluginMocha.configs.flat.recommended,
182+
pluginMocha.configs.recommended,
183183
pluginCypress.configs.recommended,
184184
{
185185
rules: {

0 commit comments

Comments
 (0)