eslint-plugin-playwright 1.8.2 → 2.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.
package/README.md CHANGED
@@ -28,14 +28,11 @@ pnpm add -D eslint-plugin-playwright
28
28
 
29
29
  ## Usage
30
30
 
31
- This plugin bundles two configurations to work with both `@playwright/test` or
32
- `jest-playwright`. The recommended setup is to use the `files` field to target
33
- only Playwright test files. In the examples below, this is done by targeting
34
- files in the `tests` directory and only applying the Playwright rules to those
35
- files. In your project, you may need to change the `files` field to match your
36
- Playwright test file patterns.
37
-
38
- ### With [Playwright test runner](https://playwright.dev/docs/writing-tests)
31
+ The recommended setup is to use the `files` field to target only Playwright test
32
+ files. In the examples below, this is done by targeting files in the `tests`
33
+ directory and only applying the Playwright rules to those files. In your
34
+ project, you may need to change the `files` field to match your Playwright test
35
+ file patterns.
39
36
 
40
37
  [Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new)
41
38
  (**eslint.config.js**)
@@ -47,10 +44,8 @@ export default [
47
44
  {
48
45
  ...playwright.configs['flat/recommended'],
49
46
  files: ['tests/**'],
50
- },
51
- {
52
- files: ['tests/**'],
53
47
  rules: {
48
+ ...playwright.configs['flat/recommended'].rules,
54
49
  // Customize Playwright rules
55
50
  // ...
56
51
  },
@@ -72,45 +67,6 @@ export default [
72
67
  }
73
68
  ```
74
69
 
75
- ### With [Jest Playwright](https://github.com/playwright-community/jest-playwright)
76
-
77
- [Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new)
78
- (**eslint.config.js**)
79
-
80
- ```javascript
81
- import playwright from 'eslint-plugin-playwright'
82
- import jest from 'eslint-plugin-jest'
83
-
84
- export default [
85
- {
86
- ...playwright.configs['flat/jest-playwright'],
87
- files: ['tests/**'],
88
- },
89
- {
90
- files: ['tests/**'],
91
- plugins: { jest },
92
- rules: {
93
- // Customize Playwright rules
94
- // ...
95
- },
96
- },
97
- ]
98
- ```
99
-
100
- [Legacy config](https://eslint.org/docs/latest/use/configure/configuration-files)
101
- (**.eslintrc**)
102
-
103
- ```json
104
- {
105
- "overrides": [
106
- {
107
- "files": "tests/**",
108
- "extends": "plugin:playwright/jest-playwright"
109
- }
110
- ]
111
- }
112
- ```
113
-
114
70
  ## Settings
115
71
 
116
72
  ### Aliased Playwright Globals
package/dist/index.js CHANGED
@@ -3251,7 +3251,7 @@ var require_top_level_describe_default = createRule({
3251
3251
  url: "https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/require-top-level-describe.md"
3252
3252
  },
3253
3253
  messages: {
3254
- tooManyDescribes: "There should not be more than {{max}} describe{{s}} at the top level",
3254
+ tooManyDescribes: "There should not be more than {{amount}} describe{{s}} at the top level",
3255
3255
  unexpectedHook: "All hooks must be wrapped in a describe block.",
3256
3256
  unexpectedTest: "All test cases must be wrapped in a describe block."
3257
3257
  },
@@ -4046,65 +4046,10 @@ var flatConfig = {
4046
4046
  playwright: index
4047
4047
  }
4048
4048
  };
4049
- var sharedJestConfig = {
4050
- rules: {
4051
- "jest/no-standalone-expect": [
4052
- "error",
4053
- {
4054
- additionalTestBlockFunctions: [
4055
- "test.jestPlaywrightDebug",
4056
- "it.jestPlaywrightDebug",
4057
- "test.jestPlaywrightSkip",
4058
- "it.jestPlaywrightSkip",
4059
- "test.jestPlaywrightConfig",
4060
- "it.jestPlaywrightConfig"
4061
- ]
4062
- }
4063
- ],
4064
- "playwright/missing-playwright-await": "error",
4065
- "playwright/no-page-pause": "warn"
4066
- }
4067
- };
4068
- var legacyJestConfig = {
4069
- ...sharedJestConfig,
4070
- env: {
4071
- jest: true,
4072
- "shared-node-browser": true
4073
- },
4074
- globals: {
4075
- browser: true,
4076
- browserName: true,
4077
- context: true,
4078
- deviceName: true,
4079
- jestPlaywright: true,
4080
- page: true
4081
- },
4082
- plugins: ["jest", "playwright"]
4083
- };
4084
- var jestConfig = {
4085
- ...sharedJestConfig,
4086
- languageOptions: {
4087
- globals: {
4088
- ...import_globals.default["shared-node-browser"],
4089
- ...import_globals.default.jest,
4090
- browser: "writable",
4091
- browserName: "writable",
4092
- context: "writable",
4093
- deviceName: "writable",
4094
- jestPlaywright: "writable",
4095
- page: "writable"
4096
- }
4097
- },
4098
- plugins: {
4099
- playwright: index
4100
- }
4101
- };
4102
4049
  module.exports = {
4103
4050
  ...index,
4104
4051
  configs: {
4105
- "flat/jest-playwright": jestConfig,
4106
4052
  "flat/recommended": flatConfig,
4107
- "jest-playwright": legacyJestConfig,
4108
4053
  "playwright-test": legacyConfig,
4109
4054
  recommended: legacyConfig
4110
4055
  }
package/index.d.ts CHANGED
@@ -2,9 +2,7 @@ import { Linter, Rule } from 'eslint'
2
2
 
3
3
  declare const config: {
4
4
  configs: {
5
- 'flat/jest-playwright': Linter.Config
6
5
  'flat/recommended': Linter.Config
7
- 'jest-playwright': Linter.Config
8
6
  'playwright-test': Linter.Config
9
7
  recommended: Linter.Config
10
8
  }
package/index.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import plugin from './dist/index.js'
2
+
3
+ export default plugin
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eslint-plugin-playwright",
3
3
  "description": "ESLint plugin for Playwright testing.",
4
- "version": "1.8.2",
4
+ "version": "2.0.0",
5
5
  "repository": "https://github.com/playwright-community/eslint-plugin-playwright",
6
6
  "author": "Mark Skelton <mark@mskelton.dev>",
7
7
  "packageManager": "pnpm@8.12.0",
@@ -16,6 +16,7 @@
16
16
  "node": ">=16.6.0"
17
17
  },
18
18
  "type": "commonjs",
19
+ "types": "./index.d.ts",
19
20
  "exports": {
20
21
  ".": {
21
22
  "types": "./index.d.ts",
@@ -25,7 +26,7 @@
25
26
  },
26
27
  "files": [
27
28
  "dist",
28
- "index.js",
29
+ "index.mjs",
29
30
  "index.d.ts"
30
31
  ],
31
32
  "scripts": {
@@ -38,28 +39,19 @@
38
39
  "ts": "tsc --noEmit"
39
40
  },
40
41
  "peerDependencies": {
41
- "eslint": ">=8.40.0",
42
- "eslint-plugin-jest": ">=25"
43
- },
44
- "peerDependenciesMeta": {
45
- "eslint-plugin-jest": {
46
- "optional": true
47
- }
42
+ "eslint": ">=8.40.0"
48
43
  },
49
44
  "dependencies": {
50
45
  "globals": "^13.23.0"
51
46
  },
52
47
  "devDependencies": {
53
- "@mskelton/eslint-config": "^8.4.0",
48
+ "@mskelton/eslint-config": "^9.0.1",
54
49
  "@mskelton/semantic-release-config": "^1.0.1",
55
- "@types/eslint": "^8.44.3",
56
- "@types/estree": "^1.0.2",
50
+ "@types/estree": "^1.0.6",
57
51
  "@types/node": "^20.11.17",
58
- "@typescript-eslint/eslint-plugin": "^6.7.3",
59
- "@typescript-eslint/parser": "^6.7.3",
52
+ "@typescript-eslint/parser": "^8.11.0",
60
53
  "dedent": "^1.5.1",
61
- "eslint": "^8.50.0",
62
- "eslint-plugin-sort": "^2.10.0",
54
+ "eslint": "^9.13.0",
63
55
  "prettier": "^3.0.3",
64
56
  "prettier-plugin-jsdoc": "^1.3.0",
65
57
  "semantic-release": "^23.0.2",