Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
chore: remove unused eslint-disable directives (#35482)
Yury Semikhatsky43622f567f0f
diff --git a/eslint.config.mjs b/eslint.config.mjsindex 841ad483bb..f6eae0b86e 100644--- a/eslint.config.mjs+++ b/eslint.config.mjs@@ -217,32 +217,27 @@ const noBooleanCompareRules = {"@typescript-eslint/no-unnecessary-boolean-literal-compare": 2,};-const noWebGlobalsRules = {- // This should contain every bulitin from builtins.ts.- "no-restricted-globals": [- "error",- { "name": "window", "message": "Use InjectedScript.window instead" },- { "name": "document", "message": "Use InjectedScript.document instead" },- { "name": "globalThis", "message": "Use InjectedScript.window instead" },- { "name": "setTimeout", "message": "Use InjectedScript.builtins.setTimeout instead" },- { "name": "clearTimeout", "message": "Use InjectedScript.builtins.clearTimeout instead" },- { "name": "setInterval", "message": "Use InjectedScript.builtins.setInterval instead" },- { "name": "clearInterval", "message": "Use InjectedScript.builtins.clearInterval instead" },- { "name": "requestAnimationFrame", "message": "Use InjectedScript.builtins.requestAnimationFrame instead" },- { "name": "cancelAnimationFrame", "message": "Use InjectedScript.builtins.cancelAnimationFrame instead" },- { "name": "requestIdleCallback", "message": "Use InjectedScript.builtins.requestIdleCallback instead" },- { "name": "cancelIdleCallback", "message": "Use InjectedScript.builtins.cancelIdleCallback instead" },- { "name": "performance", "message": "Use InjectedScript.builtins.performance instead" },- { "name": "eval", "message": "Use InjectedScript.builtins.eval instead" },- { "name": "Date", "message": "Use InjectedScript.builtins.Date instead" },- { "name": "Map", "message": "Use InjectedScript.builtins.Map instead" },- { "name": "Set", "message": "Use InjectedScript.builtins.Set instead" },- ],-};+// This should contain every builtin from builtins.ts.+const noWebGlobalsRuleList = [+ { name: "window", message: "Use InjectedScript.window instead" },+ { name: "document", message: "Use InjectedScript.document instead" },+ { name: "globalThis", message: "Use InjectedScript.window instead" },+ { name: "setTimeout", message: "Use InjectedScript.builtins.setTimeout instead" },+ { name: "clearTimeout", message: "Use InjectedScript.builtins.clearTimeout instead" },+ { name: "setInterval", message: "Use InjectedScript.builtins.setInterval instead" },+ { name: "clearInterval", message: "Use InjectedScript.builtins.clearInterval instead" },+ { name: "requestAnimationFrame", message: "Use InjectedScript.builtins.requestAnimationFrame instead" },+ { name: "cancelAnimationFrame", message: "Use InjectedScript.builtins.cancelAnimationFrame instead" },+ { name: "requestIdleCallback", message: "Use InjectedScript.builtins.requestIdleCallback instead" },+ { name: "cancelIdleCallback", message: "Use InjectedScript.builtins.cancelIdleCallback instead" },+ { name: "performance", message: "Use InjectedScript.builtins.performance instead" },+ { name: "eval", message: "Use InjectedScript.builtins.eval instead" },+ { name: "Date", message: "Use InjectedScript.builtins.Date instead" },+ { name: "Map", message: "Use InjectedScript.builtins.Map instead" },+ { name: "Set", message: "Use InjectedScript.builtins.Set instead" },+];-const noNodeGlobalsRules = {- "no-restricted-globals": ["error", { name: "process" }],-};+const noNodeGlobalsRuleList = [{ name: "process" }];const importOrderRules = {"import/order": [@@ -367,16 +362,34 @@ export default ["no-console": "off",},},+ {+ files: [+ "packages/playwright-core/src/utils/**/*.ts",+ ],+ languageOptions: languageOptionsWithTsConfig,+ rules: {+ "no-restricted-globals": [+ "error",+ ...noNodeGlobalsRuleList,+ // TODO: reenable once the violations are fixed is utils/isomorphic/*.+ // ...noWebGlobalsRules,+ ],+ ...noFloatingPromisesRules,+ ...noBooleanCompareRules,+ },+ },{files: ["packages/playwright-core/src/server/injected/**/*.ts",- "packages/playwright-core/src/utils/isomorphic/**/*.ts","packages/playwright-core/src/server/pageBinding.ts","packages/playwright-core/src/server/storageScript.ts",],languageOptions: languageOptionsWithTsConfig,rules: {- ...noWebGlobalsRules,+ "no-restricted-globals": [+ "error",+ ...noWebGlobalsRuleList,+ ],...noFloatingPromisesRules,...noBooleanCompareRules,},@@ -385,11 +398,13 @@ export default [files: ["packages/playwright-core/src/client/**/*.ts","packages/playwright-core/src/protocol/**/*.ts",- "packages/playwright-core/src/utils/**/*.ts",],languageOptions: languageOptionsWithTsConfig,rules: {- ...noNodeGlobalsRules,+ "no-restricted-globals": [+ "error",+ ...noNodeGlobalsRuleList,+ ],...noFloatingPromisesRules,...noBooleanCompareRules,},diff --git a/packages/playwright-core/src/utils/DEPS.list b/packages/playwright-core/src/utils/DEPS.listdeleted file mode 100644index 8a14701d4d..0000000000--- a/packages/playwright-core/src/utils/DEPS.list+++ /dev/null@@ -1,6 +0,0 @@-[*]-./-./isomorphic-../utilsBundle.ts-../zipBundle.ts-../utils/isomorphic\ No newline at end of filediff --git a/packages/playwright-core/src/utils/isomorphic/DEPS.list b/packages/playwright-core/src/utils/isomorphic/DEPS.listnew file mode 100644index 0000000000..e69de29bb2diff --git a/packages/playwright-core/src/utils/isomorphic/builtins.ts b/packages/playwright-core/src/utils/isomorphic/builtins.tsindex 5bde0b4ac3..5126a988f8 100644--- a/packages/playwright-core/src/utils/isomorphic/builtins.ts+++ b/packages/playwright-core/src/utils/isomorphic/builtins.ts@@ -14,8 +14,6 @@* limitations under the License.*/-/* eslint-disable no-restricted-globals */-// Make sure to update eslint.config.mjs when changing the list of builitins.export type Builtins = {setTimeout: Window['setTimeout'],diff --git a/packages/playwright-core/src/utils/isomorphic/utilityScriptSerializers.ts b/packages/playwright-core/src/utils/isomorphic/utilityScriptSerializers.tsindex d419c65f24..8e8a714f05 100644--- a/packages/playwright-core/src/utils/isomorphic/utilityScriptSerializers.ts+++ b/packages/playwright-core/src/utils/isomorphic/utilityScriptSerializers.ts@@ -178,13 +178,10 @@ export function source(builtins: Builtins) {function serialize(value: any, handleSerializer: (value: any) => HandleOrValue, visitorInfo: VisitorInfo): SerializedValue {if (value && typeof value === 'object') {- // eslint-disable-next-line no-restricted-globalsif (typeof globalThis.Window === 'function' && value instanceof globalThis.Window)return 'ref: <Window>';- // eslint-disable-next-line no-restricted-globalsif (typeof globalThis.Document === 'function' && value instanceof globalThis.Document)return 'ref: <Document>';- // eslint-disable-next-line no-restricted-globalsif (typeof globalThis.Node === 'function' && value instanceof globalThis.Node)return 'ref: <Node>';}