From 6b2d93a890c96f5e89847039255a33bb557044f9 Mon Sep 17 00:00:00 2001 From: Marcin Strzyz <37447884+mastrzyz@users.noreply.github.com> Date: Thu, 17 Aug 2023 11:53:36 -0700 Subject: [PATCH] chore: error on unused eslint disables (#26510) --- package.json | 2 +- packages/playwright-core/src/cli/driver.ts | 2 +- .../src/server/registry/oopDownloadBrowserMain.ts | 1 - packages/playwright-test/src/plugins/webServerPlugin.ts | 1 - packages/playwright-test/src/reporters/list.ts | 1 - packages/trace-viewer/src/ui/stackTrace.tsx | 1 - 6 files changed, 2 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index e2c712fe2c..9ae11a5c04 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "ttest": "node ./tests/playwright-test/stable-test-runner/node_modules/@playwright/test/cli test --config=tests/playwright-test/playwright.config.ts", "ct": "playwright test tests/components/test-all.spec.js --reporter=list", "test": "playwright test --config=tests/library/playwright.config.ts", - "eslint": "eslint --cache --ext ts,tsx .", + "eslint": "eslint --cache --report-unused-disable-directives --ext ts,tsx .", "tsc": "tsc -p .", "build-installer": "babel -s --extensions \".ts\" --out-dir packages/playwright-core/lib/utils/ packages/playwright-core/src/utils", "doc": "node utils/doclint/cli.js", diff --git a/packages/playwright-core/src/cli/driver.ts b/packages/playwright-core/src/cli/driver.ts index 3bb22c3cbe..cc3c5dab25 100644 --- a/packages/playwright-core/src/cli/driver.ts +++ b/packages/playwright-core/src/cli/driver.ts @@ -70,7 +70,7 @@ export async function runServer(options: RunServerOptions) { const server = new PlaywrightServer({ mode: extension ? 'extension' : 'default', path, maxConnections }); const wsEndpoint = await server.listen(port); process.on('exit', () => server.close().catch(console.error)); - console.log('Listening on ' + wsEndpoint); // eslint-disable-line no-console + console.log('Listening on ' + wsEndpoint); process.stdin.on('close', () => gracefullyProcessExitDoNotHang(0)); } diff --git a/packages/playwright-core/src/server/registry/oopDownloadBrowserMain.ts b/packages/playwright-core/src/server/registry/oopDownloadBrowserMain.ts index b79e3717f5..9b379c668a 100644 --- a/packages/playwright-core/src/server/registry/oopDownloadBrowserMain.ts +++ b/packages/playwright-core/src/server/registry/oopDownloadBrowserMain.ts @@ -121,7 +121,6 @@ function getAnimatedDownloadProgress(): OnProgressCallback { } function getBasicDownloadProgress(): OnProgressCallback { - // eslint-disable-next-line no-console const totalRows = 10; const stepWidth = 8; let lastRow = -1; diff --git a/packages/playwright-test/src/plugins/webServerPlugin.ts b/packages/playwright-test/src/plugins/webServerPlugin.ts index c45273108d..8fb863ba05 100644 --- a/packages/playwright-test/src/plugins/webServerPlugin.ts +++ b/packages/playwright-test/src/plugins/webServerPlugin.ts @@ -207,7 +207,6 @@ function getIsAvailableFunction(url: string, checkPortOnly: boolean, ignoreHTTPS } export const webServer = (options: WebServerPluginOptions): TestRunnerPlugin => { - // eslint-disable-next-line no-console return new WebServerPlugin(options, false); }; diff --git a/packages/playwright-test/src/reporters/list.ts b/packages/playwright-test/src/reporters/list.ts index 40de8cb818..71998c49d9 100644 --- a/packages/playwright-test/src/reporters/list.ts +++ b/packages/playwright-test/src/reporters/list.ts @@ -14,7 +14,6 @@ * limitations under the License. */ -/* eslint-disable no-console */ import { colors, ms as milliseconds } from 'playwright-core/lib/utilsBundle'; import { BaseReporter, formatError, formatTestTitle, stepSuffix, stripAnsiEscapes } from './base'; import type { FullResult, Suite, TestCase, TestError, TestResult, TestStep } from '../../types/testReporter'; diff --git a/packages/trace-viewer/src/ui/stackTrace.tsx b/packages/trace-viewer/src/ui/stackTrace.tsx index 2792e75301..ef3f2601b9 100644 --- a/packages/trace-viewer/src/ui/stackTrace.tsx +++ b/packages/trace-viewer/src/ui/stackTrace.tsx @@ -18,7 +18,6 @@ import * as React from 'react'; import './stackTrace.css'; import type { ActionTraceEvent } from '@trace/trace'; import { ListView } from '@web/components/listView'; -// eslint-disable-next-line @typescript-eslint/consistent-type-imports import type { StackFrame } from '@protocol/channels'; const StackFrameListView = ListView;