Skip to content

Commit

Permalink
feat!: Remove jest-playwright configs (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
mskelton authored Oct 23, 2024
1 parent 9b7d8a5 commit d0f428b
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 246 deletions.
56 changes: 6 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,11 @@ pnpm add -D eslint-plugin-playwright

## Usage

This plugin bundles two configurations to work with both `@playwright/test` or
`jest-playwright`. The recommended setup is to use the `files` field to target
only Playwright test files. In the examples below, this is done by targeting
files in the `tests` directory and only applying the Playwright rules to those
files. In your project, you may need to change the `files` field to match your
Playwright test file patterns.

### With [Playwright test runner](https://playwright.dev/docs/writing-tests)
The recommended setup is to use the `files` field to target only Playwright test
files. In the examples below, this is done by targeting files in the `tests`
directory and only applying the Playwright rules to those files. In your
project, you may need to change the `files` field to match your Playwright test
file patterns.

[Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new)
(**eslint.config.js**)
Expand All @@ -47,10 +44,8 @@ export default [
{
...playwright.configs['flat/recommended'],
files: ['tests/**'],
},
{
files: ['tests/**'],
rules: {
...playwright.configs['flat/recommended'].rules,
// Customize Playwright rules
// ...
},
Expand All @@ -72,45 +67,6 @@ export default [
}
```

### With [Jest Playwright](https://github.com/playwright-community/jest-playwright)

[Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new)
(**eslint.config.js**)

```javascript
import playwright from 'eslint-plugin-playwright'
import jest from 'eslint-plugin-jest'

export default [
{
...playwright.configs['flat/jest-playwright'],
files: ['tests/**'],
},
{
files: ['tests/**'],
plugins: { jest },
rules: {
// Customize Playwright rules
// ...
},
},
]
```

[Legacy config](https://eslint.org/docs/latest/use/configure/configuration-files)
(**.eslintrc**)

```json
{
"overrides": [
{
"files": "tests/**",
"extends": "plugin:playwright/jest-playwright"
}
]
}
```

## Settings

### Aliased Playwright Globals
Expand Down
2 changes: 0 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import { Linter, Rule } from 'eslint'

declare const config: {
configs: {
'flat/jest-playwright': Linter.Config
'flat/recommended': Linter.Config
'jest-playwright': Linter.Config
'playwright-test': Linter.Config
recommended: Linter.Config
}
Expand Down
8 changes: 1 addition & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,7 @@
"ts": "tsc --noEmit"
},
"peerDependencies": {
"eslint": ">=8.40.0",
"eslint-plugin-jest": ">=25"
},
"peerDependenciesMeta": {
"eslint-plugin-jest": {
"optional": true
}
"eslint": ">=8.40.0"
},
"dependencies": {
"globals": "^13.23.0"
Expand Down
6 changes: 0 additions & 6 deletions packages/eslint-plugin-jest-playwright/README.md

This file was deleted.

7 changes: 0 additions & 7 deletions packages/eslint-plugin-jest-playwright/index.js

This file was deleted.

15 changes: 0 additions & 15 deletions packages/eslint-plugin-jest-playwright/package.json

This file was deleted.

Loading

0 comments on commit d0f428b

Please sign in to comment.