eslint-plugin-playwright 2.4.1 → 2.5.1
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 +57 -54
- package/dist/index.cjs +621 -540
- package/index.d.ts +1 -1
- package/package.json +25 -26
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ESLint Plugin Playwright
|
|
2
2
|
|
|
3
|
-
[](https://github.com/mskelton/eslint-plugin-playwright/actions/workflows/test.yml)
|
|
4
4
|
[](https://www.npmjs.com/package/eslint-plugin-playwright)
|
|
5
5
|
[](https://github.com/semantic-release/semantic-release)
|
|
6
6
|
|
|
@@ -111,62 +111,65 @@ messages will use the default message defined by the plugin.
|
|
|
111
111
|
## Rules
|
|
112
112
|
|
|
113
113
|
✅ Set in the `recommended` configuration\
|
|
114
|
-
🔧 Automatically fixable by the
|
|
114
|
+
🔧 Automatically fixable by the
|
|
115
|
+
[`--fix`](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix)
|
|
115
116
|
CLI option\
|
|
116
117
|
💡 Manually fixable by
|
|
117
118
|
[editor suggestions](https://eslint.org/docs/latest/developer-guide/working-with-rules#providing-suggestions)
|
|
118
119
|
|
|
119
120
|
| Rule | Description | ✅ | 🔧 | 💡 |
|
|
120
121
|
| --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | :-: | :-: | :-: |
|
|
121
|
-
| [
|
|
122
|
-
| [
|
|
123
|
-
| [max-
|
|
124
|
-
| [
|
|
125
|
-
| [
|
|
126
|
-
| [no-
|
|
127
|
-
| [no-conditional-
|
|
128
|
-
| [no-
|
|
129
|
-
| [no-
|
|
130
|
-
| [no-
|
|
131
|
-
| [no-
|
|
132
|
-
| [no-
|
|
133
|
-
| [no-
|
|
134
|
-
| [no-
|
|
135
|
-
| [no-
|
|
136
|
-
| [no-
|
|
137
|
-
| [no-
|
|
138
|
-
| [no-
|
|
139
|
-
| [no-
|
|
140
|
-
| [no-
|
|
141
|
-
| [no-
|
|
142
|
-
| [no-
|
|
143
|
-
| [no-
|
|
144
|
-
| [no-
|
|
145
|
-
| [no-
|
|
146
|
-
| [no-
|
|
147
|
-
| [no-
|
|
148
|
-
| [no-
|
|
149
|
-
| [no-
|
|
150
|
-
| [no-wait-for-
|
|
151
|
-
| [
|
|
152
|
-
| [
|
|
153
|
-
| [prefer-
|
|
154
|
-
| [prefer-
|
|
155
|
-
| [prefer-
|
|
156
|
-
| [prefer-
|
|
157
|
-
| [prefer-
|
|
158
|
-
| [prefer-
|
|
159
|
-
| [prefer-
|
|
160
|
-
| [prefer-
|
|
161
|
-
| [prefer-to-
|
|
162
|
-
| [prefer-to-
|
|
163
|
-
| [prefer-
|
|
164
|
-
| [
|
|
165
|
-
| [
|
|
166
|
-
| [require-
|
|
167
|
-
| [require-
|
|
168
|
-
| [
|
|
169
|
-
| [
|
|
170
|
-
| [valid-
|
|
171
|
-
| [valid-
|
|
172
|
-
| [valid-
|
|
122
|
+
| [consistent-spacing-between-blocks](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/consistent-spacing-between-blocks.md) | Enforce consistent spacing between test blocks | ✅ | 🔧 | |
|
|
123
|
+
| [expect-expect](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/expect-expect.md) | Enforce assertion to be made in a test body | ✅ | | |
|
|
124
|
+
| [max-expects](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/max-expects.md) | Enforces a maximum number assertion calls in a test body | | | |
|
|
125
|
+
| [max-nested-describe](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/max-nested-describe.md) | Enforces a maximum depth to nested describe calls | ✅ | | |
|
|
126
|
+
| [missing-playwright-await](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/missing-playwright-await.md) | Enforce Playwright APIs to be awaited | ✅ | 🔧 | |
|
|
127
|
+
| [no-commented-out-tests](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-commented-out-tests.md) | Disallow commented out tests | | | |
|
|
128
|
+
| [no-conditional-expect](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-conditional-expect.md) | Disallow calling `expect` conditionally | ✅ | | |
|
|
129
|
+
| [no-conditional-in-test](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-conditional-in-test.md) | Disallow conditional logic in tests | ✅ | | |
|
|
130
|
+
| [no-duplicate-hooks](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-duplicate-hooks.md) | Disallow duplicate setup and teardown hooks | | | |
|
|
131
|
+
| [no-element-handle](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-element-handle.md) | Disallow usage of element handles | ✅ | | 💡 |
|
|
132
|
+
| [no-eval](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-eval.md) | Disallow usage of `page.$eval()` and `page.$$eval()` | ✅ | | |
|
|
133
|
+
| [no-focused-test](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-focused-test.md) | Disallow usage of `.only` annotation | ✅ | | 💡 |
|
|
134
|
+
| [no-force-option](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-force-option.md) | Disallow usage of the `{ force: true }` option | ✅ | | |
|
|
135
|
+
| [no-get-by-title](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-get-by-title.md) | Disallow using `getByTitle()` | | 🔧 | |
|
|
136
|
+
| [no-hooks](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-hooks.md) | Disallow setup and teardown hooks | | | |
|
|
137
|
+
| [no-nested-step](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-nested-step.md) | Disallow nested `test.step()` methods | ✅ | | |
|
|
138
|
+
| [no-networkidle](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-networkidle.md) | Disallow usage of the `networkidle` option | ✅ | | |
|
|
139
|
+
| [no-nth-methods](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-nth-methods.md) | Disallow usage of `first()`, `last()`, and `nth()` methods | | | |
|
|
140
|
+
| [no-page-pause](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-page-pause.md) | Disallow using `page.pause()` | ✅ | | |
|
|
141
|
+
| [no-raw-locators](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-raw-locators.md) | Disallow using raw locators | | | |
|
|
142
|
+
| [no-restricted-locators](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-restricted-locators.md) | Disallow specific locator methods | | | |
|
|
143
|
+
| [no-restricted-matchers](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-restricted-matchers.md) | Disallow specific matchers & modifiers | | | |
|
|
144
|
+
| [no-skipped-test](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-skipped-test.md) | Disallow usage of the `.skip` annotation | ✅ | | 💡 |
|
|
145
|
+
| [no-slowed-test](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-slowed-test.md) | Disallow usage of the `.slow` annotation | | | 💡 |
|
|
146
|
+
| [no-standalone-expect](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-standalone-expect.md) | Disallow using expect outside of `test` blocks | ✅ | | |
|
|
147
|
+
| [no-unsafe-references](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-unsafe-references.md) | Prevent unsafe variable references in `page.evaluate()` | ✅ | 🔧 | |
|
|
148
|
+
| [no-unused-locators](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-unused-locators.md) | Disallow usage of page locators that are not used | ✅ | | |
|
|
149
|
+
| [no-useless-await](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-useless-await.md) | Disallow unnecessary `await`s for Playwright methods | ✅ | 🔧 | |
|
|
150
|
+
| [no-useless-not](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-useless-not.md) | Disallow usage of `not` matchers when a specific matcher exists | ✅ | 🔧 | |
|
|
151
|
+
| [no-wait-for-navigation](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-wait-for-navigation.md) | Disallow usage of `page.waitForNavigation()` | ✅ | | 💡 |
|
|
152
|
+
| [no-wait-for-selector](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-wait-for-selector.md) | Disallow usage of `page.waitForSelector()` | ✅ | | 💡 |
|
|
153
|
+
| [no-wait-for-timeout](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-wait-for-timeout.md) | Disallow usage of `page.waitForTimeout()` | ✅ | | 💡 |
|
|
154
|
+
| [prefer-comparison-matcher](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/prefer-comparison-matcher.md) | Suggest using the built-in comparison matchers | | 🔧 | |
|
|
155
|
+
| [prefer-equality-matcher](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/prefer-equality-matcher.md) | Suggest using the built-in equality matchers | | | 💡 |
|
|
156
|
+
| [prefer-hooks-in-order](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/prefer-hooks-in-order.md) | Prefer having hooks in a consistent order | | | |
|
|
157
|
+
| [prefer-hooks-on-top](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/prefer-hooks-on-top.md) | Suggest having hooks before any test cases | | | |
|
|
158
|
+
| [prefer-lowercase-title](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/prefer-lowercase-title.md) | Enforce lowercase test names | | 🔧 | |
|
|
159
|
+
| [prefer-native-locators](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/prefer-native-locators.md) | Suggest built-in locators over `page.locator()` | | 🔧 | |
|
|
160
|
+
| [prefer-locator](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/prefer-locator.md) | Suggest locators over page methods | | | |
|
|
161
|
+
| [prefer-strict-equal](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/prefer-strict-equal.md) | Suggest using `toStrictEqual()` | | | 💡 |
|
|
162
|
+
| [prefer-to-be](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/prefer-to-be.md) | Suggest using `toBe()` | | 🔧 | |
|
|
163
|
+
| [prefer-to-contain](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/prefer-to-contain.md) | Suggest using `toContain()` | | 🔧 | |
|
|
164
|
+
| [prefer-to-have-count](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/prefer-to-have-count.md) | Suggest using `toHaveCount()` | | 🔧 | |
|
|
165
|
+
| [prefer-to-have-length](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/prefer-to-have-length.md) | Suggest using `toHaveLength()` | | 🔧 | |
|
|
166
|
+
| [prefer-web-first-assertions](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/prefer-web-first-assertions.md) | Suggest using web first assertions | ✅ | 🔧 | |
|
|
167
|
+
| [require-hook](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/require-hook.md) | Require setup and teardown code to be within a hook | | | |
|
|
168
|
+
| [require-soft-assertions](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/require-soft-assertions.md) | Require assertions to use `expect.soft()` | | 🔧 | |
|
|
169
|
+
| [require-to-throw-message](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/require-to-throw-message.md) | Require a message for `toThrow()` | | | |
|
|
170
|
+
| [require-top-level-describe](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/require-top-level-describe.md) | Require test cases and hooks to be inside a `test.describe` block | | | |
|
|
171
|
+
| [valid-describe-callback](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/valid-describe-callback.md) | Enforce valid `describe()` callback | ✅ | | |
|
|
172
|
+
| [valid-expect-in-promise](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/valid-expect-in-promise.md) | Require promises that have expectations in their chain to be valid | ✅ | | |
|
|
173
|
+
| [valid-expect](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/valid-expect.md) | Enforce valid `expect()` usage | ✅ | | |
|
|
174
|
+
| [valid-title](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/valid-title.md) | Enforce valid titles | ✅ | 🔧 | |
|
|
175
|
+
| [valid-test-tags](https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/valid-test-tags.md) | Enforce valid tag format in test blocks | ✅ | | |
|