-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update [email protected] documentation
- Loading branch information
1 parent
16362ab
commit 4d9b581
Showing
1 changed file
with
7 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,39 +123,24 @@ export default [ | |
|
||
### Cypress and Chai recommended | ||
|
||
[eslint-plugin-chai-friendly](https://www.npmjs.com/package/eslint-plugin-chai-friendly) is combined with the Cypress plugin `eslint-plugin-cypress`. | ||
[eslint-plugin-chai-friendly](https://www.npmjs.com/package/eslint-plugin-chai-friendly) (minimum version [[email protected]](https://github.com/ihordiachenko/eslint-plugin-chai-friendly/releases/tag/v0.8.0) required for ESLint v9 support and flat config support) is combined with the Cypress plugin `eslint-plugin-cypress`. | ||
|
||
The [[email protected]](https://github.com/ihordiachenko/eslint-plugin-chai-friendly/releases/tag/v0.7.4) plugin is not directly compatible with ESLint `9.x` or with flat config. Utilities offered by ESLint enable this plugin to be used nevertheless: | ||
|
||
- [@eslint/compat](https://www.npmjs.com/package/@eslint/compat) | ||
- [@eslint/eslintrc](https://www.npmjs.com/package/@eslint/eslintrc) using the `FlatCompat` class | ||
|
||
The recommended rules for both plugins are used: `cypress/recommended` and `plugin:chai-friendly/recommended`. | ||
The recommended rules for both plugins are used: `pluginCypress.configs.recommended` and `pluginChaiFriendly.configs.recommended`: | ||
|
||
```shell | ||
npm install @eslint/compat @eslint/eslintrc eslint-plugin-chai-friendly --save-dev | ||
npm install eslint-plugin-chai-friendly@^0.8.0 --save-dev | ||
``` | ||
|
||
```js | ||
import { fixupConfigRules } from '@eslint/compat' | ||
import { FlatCompat } from '@eslint/eslintrc' | ||
import pluginCypress from 'eslint-plugin-cypress/flat' | ||
const compat = new FlatCompat() | ||
import pluginChaiFriendly from 'eslint-plugin-chai-friendly' | ||
export default [ | ||
pluginCypress.configs.recommended, | ||
pluginChaiFriendly.configs.recommended, | ||
{ | ||
rules: { | ||
'cypress/no-unnecessary-waiting': 'off', | ||
}, | ||
...fixupConfigRules( | ||
compat.config( | ||
{ | ||
extends: [ | ||
'plugin:chai-friendly/recommended' | ||
], | ||
|
||
} | ||
) | ||
) | ||
}] | ||
} | ||
] | ||
``` |