@@ -14,6 +14,7 @@ import pluginMath from 'eslint-plugin-math';
1414import pluginN from 'eslint-plugin-n' ;
1515import pluginNodeDependencies from 'eslint-plugin-node-dependencies' ;
1616import * as pluginPackageJSON from 'eslint-plugin-package-json' ;
17+ import pluginPlaywright from 'eslint-plugin-playwright' ;
1718import pluginPromise from 'eslint-plugin-promise' ;
1819import pluginQUnit from 'eslint-plugin-qunit' ;
1920import pluginReDoS from 'eslint-plugin-redos' ;
@@ -2035,6 +2036,19 @@ const qunit = {
20352036 'qunit/resolve-async' : ERROR ,
20362037} ;
20372038
2039+ const playwright = {
2040+ // enforce Playwright APIs to be awaited
2041+ 'playwright/missing-playwright-await' : ERROR ,
2042+ // disallow usage of `page.$eval()` and `page.$$eval()`
2043+ 'playwright/no-eval' : ERROR ,
2044+ // disallow using `page.pause()`
2045+ 'playwright/no-page-pause' : ERROR ,
2046+ // prevent unsafe variable references in `page.evaluate()`
2047+ 'playwright/no-unsafe-references' : ERROR ,
2048+ // disallow unnecessary awaits for Playwright methods
2049+ 'playwright/no-useless-await' : ERROR ,
2050+ } ;
2051+
20382052const yaml = {
20392053 // disallow empty mapping values
20402054 'yaml/no-empty-mapping-value' : ERROR ,
@@ -2345,6 +2359,7 @@ export default [
23452359 node : pluginN ,
23462360 'node-dependencies' : pluginNodeDependencies ,
23472361 'package-json' : pluginPackageJSON ,
2362+ playwright : pluginPlaywright ,
23482363 promise : pluginPromise ,
23492364 qunit : pluginQUnit ,
23502365 redos : pluginReDoS ,
@@ -2440,6 +2455,12 @@ export default [
24402455 } ,
24412456 rules : qunit ,
24422457 } ,
2458+ {
2459+ files : [
2460+ 'scripts/usage/**' ,
2461+ ] ,
2462+ rules : playwright ,
2463+ } ,
24432464 {
24442465 files : [
24452466 'packages/core-js-@(builder|compat)/**' ,
0 commit comments