Skip to content

Commit aa0af54

Browse files
Lightning00BladeDevtools-frontend LUCI CQ
authored and
Devtools-frontend LUCI CQ
committed
[cleanup] Enable noUnusedParameters in tsconfig
This should help when refactoring to not include code that is not used Bug: 409278895 Change-Id: I5d11ab271f0d3c1c71deacd4eff1c2fbd64a8e40 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6450579 Commit-Queue: Jack Franklin <jacktfranklin@chromium.org> Auto-Submit: Nikolay Vitkov <nvitkov@chromium.org> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
1 parent b5a044f commit aa0af54

File tree

19 files changed

+30
-34
lines changed

19 files changed

+30
-34
lines changed

config/typescript/tsconfig.base.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
"strict": true,
1313
"useUnknownInCatchVariables": false,
14+
"noUnusedParameters": true,
1415
"noUnusedLocals": false,
1516
"noImplicitReturns": true,
1617
"noImplicitOverride": true,

front_end/models/trace/Processor.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ describeWithEnvironment('TraceProcessor', function() {
266266
UIStrings: {} as any,
267267
// eslint-disable-next-line @typescript-eslint/no-explicit-any
268268
i18nString: (() => {}) as any,
269-
isRenderBlocking: (x: unknown): x is Trace.Insights.Models.RenderBlocking.RenderBlockingInsightModel =>
269+
isRenderBlocking: (_x: unknown): _x is Trace.Insights.Models.RenderBlocking.RenderBlockingInsightModel =>
270270
false,
271271
generateInsight: () => {
272272
throw new Error('forced error');

front_end/models/workspace/UISourceCode.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ describe('UISourceCode', () => {
119119
const sutObject = setupMockedUISourceCode();
120120
sutObject.projectStub.workspace.returns(sinon.createStubInstance(Workspace.Workspace.WorkspaceImpl));
121121
const rawPathstringExample = 'newName.html' as Platform.DevToolsPath.RawPathString;
122-
sutObject.projectStub.rename.callsFake((uiSourceCode, rawPathstringExample, innerCallback) => {
122+
sutObject.projectStub.rename.callsFake((_uiSourceCode, rawPathstringExample, innerCallback) => {
123123
innerCallback(true, rawPathstringExample);
124124
});
125125

front_end/panels/ai_assistance/SelectWorkspaceDialog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class SelectWorkspaceDialog extends UI.Widget.VBox {
9595
}
9696

9797
// clang-format off
98-
this.#view = view ?? ((input, output, target) => {
98+
this.#view = view ?? ((input, _output, target) => {
9999
const hasFolders = input.folders.length > 0;
100100
render(
101101
html`

front_end/panels/application/AppManifestView.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,8 +1107,7 @@ export class AppManifestView extends Common.ObjectWrapper.eventMixin<EventTypes,
11071107
}
11081108

11091109
checkSizeProblem(
1110-
size: ParsedSize, type: string|undefined, image: HTMLImageElement,
1111-
resourceName: Platform.UIString.LocalizedString,
1110+
size: ParsedSize, image: HTMLImageElement, resourceName: Platform.UIString.LocalizedString,
11121111
imageUrl: string): {error?: Platform.UIString.LocalizedString, hasSquareSize: boolean} {
11131112
if ('any' in size) {
11141113
return {hasSquareSize: image.naturalWidth === image.naturalHeight};
@@ -1186,8 +1185,7 @@ export class AppManifestView extends Common.ObjectWrapper.eventMixin<EventTypes,
11861185
imageResourceErrors.push(i18nString(UIStrings.screenshotPixelSize, {url: imageUrl}));
11871186
}
11881187
for (const size of sizes) {
1189-
const {error, hasSquareSize} =
1190-
this.checkSizeProblem(size, imageResource['type'], image, resourceName, imageUrl);
1188+
const {error, hasSquareSize} = this.checkSizeProblem(size, image, resourceName, imageUrl);
11911189
squareSizedIconAvailable = squareSizedIconAvailable || hasSquareSize;
11921190
if (error) {
11931191
imageResourceErrors.push(error);

front_end/panels/application/ServiceWorkerCacheViews.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,7 @@ export class ServiceWorkerCacheView extends UI.View.SimpleView {
315315
}
316316
}
317317

318-
private updateDataCallback(
319-
this: ServiceWorkerCacheView, skipCount: number, entries: Protocol.CacheStorage.DataEntry[],
320-
returnCount: number): void {
318+
private updateDataCallback(entries: Protocol.CacheStorage.DataEntry[], returnCount: number): void {
321319
if (!this.dataGrid) {
322320
return;
323321
}
@@ -377,7 +375,7 @@ export class ServiceWorkerCacheView extends UI.View.SimpleView {
377375
});
378376

379377
const {entries, returnCount} = await this.loadingPromise;
380-
this.updateDataCallback(0, entries, returnCount);
378+
this.updateDataCallback(entries, returnCount);
381379
this.loadingPromise = null;
382380
return;
383381
}

front_end/panels/application/SharedStorageItemsView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export class SharedStorageItemsView extends KeyValueStorageItemsView {
138138
UI.ARIAUtils.alert(i18nString(UIStrings.sharedStorageFilteredItemsCleared));
139139
}
140140

141-
protected override isEditAllowed(columnIdentifier: string, oldText: string, newText: string): boolean {
141+
protected override isEditAllowed(columnIdentifier: string, _oldText: string, newText: string): boolean {
142142
if (columnIdentifier === 'key' && newText === '') {
143143
// The Shared Storage backend does not currently allow '' as a key, so we only set a new entry with a new key if its new key is nonempty.
144144
void this.refreshItems().then(() => {

front_end/panels/console/ConsoleViewMessage.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,14 +279,14 @@ describeWithMockConnection('ConsoleViewMessage', () => {
279279
stackTraceMessage, messageDetails);
280280
const {message, linkifier} = createConsoleViewMessageWithStubDeps(rawMessage);
281281

282-
linkifier.linkifyScriptLocation.callsFake((target, scriptId, sourceURL, lineNumber, options) => {
282+
linkifier.linkifyScriptLocation.callsFake((_target, _scriptId, sourceURL, lineNumber, options) => {
283283
const link = Components.Linkifier.Linkifier.linkifyURL(sourceURL, {lineNumber, ...options});
284284
if (ignoreListFn(sourceURL)) {
285285
link.classList.add(IGNORE_LIST_LINK);
286286
}
287287
return link;
288288
});
289-
linkifier.maybeLinkifyConsoleCallFrame.callsFake((target, callFrame, options) => {
289+
linkifier.maybeLinkifyConsoleCallFrame.callsFake((_target, callFrame, options) => {
290290
const link = Components.Linkifier.Linkifier.linkifyURL(
291291
urlString`${callFrame.url}`, {lineNumber: callFrame.lineNumber, ...options});
292292
if (ignoreListFn(callFrame.url)) {

front_end/panels/elements/StylePropertyTreeElement.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describeWithMockConnection('StylePropertyTreeElement', () => {
5050
matchedStyles = await getMatchedStylesWithBlankRule(
5151
new SDK.CSSModel.CSSModel(createTarget()), undefined, {startLine: 0, startColumn: 0, endLine: 0, endColumn: 1});
5252
sinon.stub(matchedStyles, 'availableCSSVariables').returns(Object.keys(mockVariableMap));
53-
fakeComputeCSSVariable = sinon.stub(matchedStyles, 'computeCSSVariable').callsFake((style, name) => {
53+
fakeComputeCSSVariable = sinon.stub(matchedStyles, 'computeCSSVariable').callsFake((_style, name) => {
5454
return {
5555
value: mockVariableMap[name],
5656
declaration: new SDK.CSSMatchedStyles.CSSValueSource(sinon.createStubInstance(SDK.CSSProperty.CSSProperty)),
@@ -1575,7 +1575,7 @@ describeWithMockConnection('StylePropertyTreeElement', () => {
15751575
});
15761576

15771577
describe('CSSWideKeywordRenderer', () => {
1578-
function mockResolvedKeyword(propertyName: string, keyword: SDK.CSSMetadata.CSSWideKeyword, propertyValue = ''):
1578+
function mockResolvedKeyword(propertyName: string, _keyword: SDK.CSSMetadata.CSSWideKeyword, propertyValue = ''):
15791579
sinon.SinonStubbedInstance<SDK.CSSProperty.CSSProperty> {
15801580
const originalDeclaration = sinon.createStubInstance(SDK.CSSProperty.CSSProperty);
15811581
sinon.stub(matchedStyles, 'resolveGlobalKeyword')

front_end/panels/protocol_monitor/ProtocolMonitor.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ describeWithEnvironment('view', () => {
481481
targets: [],
482482
selectedTargetId: 'main',
483483
};
484-
const viewOutput = {set editorWidget(value: ProtocolMonitor.JSONEditor.JSONEditor) {}};
484+
const viewOutput = {set editorWidget(_value: ProtocolMonitor.JSONEditor.JSONEditor) {}};
485485

486486
view(viewInput, viewOutput, target);
487487
await assertScreenshot('protocol_monitor/basic.png');
@@ -538,7 +538,7 @@ describeWithEnvironment('view', () => {
538538
] as SDK.Target.Target[],
539539
selectedTargetId: 'prerender',
540540
};
541-
const viewOutput = {set editorWidget(value: ProtocolMonitor.JSONEditor.JSONEditor) {}};
541+
const viewOutput = {set editorWidget(_value: ProtocolMonitor.JSONEditor.JSONEditor) {}};
542542

543543
view(viewInput, viewOutput, target);
544544
await assertScreenshot('protocol_monitor/advanced.png');

front_end/panels/sources/SourcesView.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describeWithEnvironment('SourcesView', () => {
5656
});
5757
project.canSetFileContent = () => true;
5858
project.rename =
59-
(uiSourceCode: Workspace.UISourceCode.UISourceCode, newName: string,
59+
(_uiSourceCode: Workspace.UISourceCode.UISourceCode, newName: string,
6060
callback: (
6161
arg0: boolean, arg1?: string, arg2?: Platform.DevToolsPath.UrlString,
6262
arg3?: Common.ResourceType.ResourceType) => void) => {

front_end/panels/sources/components/BreakpointsView.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,8 +1205,7 @@ describeWithMockConnection('BreakpointsView', () => {
12051205
});
12061206

12071207
describe('group checkboxes', () => {
1208-
async function waitForCheckboxToggledEventsWithCheckedUpdate(
1209-
component: SourcesComponents.BreakpointsView.BreakpointsView, numBreakpointItems: number, checked: boolean) {
1208+
async function waitForCheckboxToggledEventsWithCheckedUpdate(numBreakpointItems: number, checked: boolean) {
12101209
return await new Promise<void>(resolve => {
12111210
let numCheckboxToggledEvents = 0;
12121211
const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance();
@@ -1284,7 +1283,7 @@ describeWithMockConnection('BreakpointsView', () => {
12841283
assert.instanceOf(groupCheckbox, HTMLInputElement);
12851284

12861285
// Wait until we receive all events fired that notify us of disabled breakpoints.
1287-
const waitForEventPromise = waitForCheckboxToggledEventsWithCheckedUpdate(component, numBreakpointItems, false);
1286+
const waitForEventPromise = waitForCheckboxToggledEventsWithCheckedUpdate(numBreakpointItems, false);
12881287

12891288
groupCheckbox.click();
12901289
await waitForEventPromise;
@@ -1313,7 +1312,7 @@ describeWithMockConnection('BreakpointsView', () => {
13131312
assert.instanceOf(groupCheckbox, HTMLInputElement);
13141313

13151314
// Wait until we receive all events fired that notify us of enabled breakpoints.
1316-
const waitForEventPromise = waitForCheckboxToggledEventsWithCheckedUpdate(component, numBreakpointItems, true);
1315+
const waitForEventPromise = waitForCheckboxToggledEventsWithCheckedUpdate(numBreakpointItems, true);
13171316

13181317
groupCheckbox.click();
13191318
await waitForEventPromise;

front_end/panels/timeline/TimelineFlameChartView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1869,7 +1869,7 @@ export class TimelineFlameChartMarker implements PerfUI.FlameChart.FlameChartMar
18691869
return i18nString(UIStrings.sAtS, {PH1: this.style.title, PH2: startTime});
18701870
}
18711871

1872-
draw(context: CanvasRenderingContext2D, x: number, height: number, pixelsPerMillisecond: number): void {
1872+
draw(context: CanvasRenderingContext2D, x: number, _height: number, pixelsPerMillisecond: number): void {
18731873
const lowPriorityVisibilityThresholdInPixelsPerMs = 4;
18741874

18751875
if (this.style.lowPriority && pixelsPerMillisecond < lowPriorityVisibilityThresholdInPixelsPerMs) {

front_end/testing/ExpectStubCall.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function expectCalled<TArgs extends any[] = any[], TReturnValue = any>(
2929
}
3030

3131
type Args<T> = T extends(...args: infer TArgs) => unknown ? TArgs : never;
32-
type Ret<T> = T extends(...args: infer TArgs) => infer TRet ? TRet : never;
32+
type Ret<T> = T extends(...args: any[]) => infer TRet ? TRet : never;
3333

3434
export function spyCall<T, Fn extends keyof T>(obj: T, method: Fn): Promise<{args: Args<T[Fn]>, result: Ret<T[Fn]>}> {
3535
const {promise, resolve} = Promise.withResolvers<{args: Args<T[Fn]>, result: Ret<T[Fn]>}>();

front_end/testing/MockExecutionContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class MockExecutionContext extends SDK.RuntimeModel.ExecutionContext {
1616
super(runtimeModel, 1 as Protocol.Runtime.ExecutionContextId, 'test id', 'test name', urlString`test origin`, true);
1717
}
1818

19-
override async evaluate(options: SDK.RuntimeModel.EvaluationOptions, userGesture: boolean, _awaitPromise: boolean):
19+
override async evaluate(_options: SDK.RuntimeModel.EvaluationOptions, userGesture: boolean, _awaitPromise: boolean):
2020
Promise<SDK.RuntimeModel.EvaluationResult> {
2121
assert.isTrue(userGesture);
2222
return {error: 'test'};

front_end/ui/components/docs/survey_link/basic.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ document.getElementById('container')?.appendChild(link);
1919
link.data = {
2020
trigger: 'test trigger',
2121
promptText: Common.UIString.LocalizedEmptyString,
22-
canShowSurvey: (trigger, callback) => {
22+
canShowSurvey: (_trigger, callback) => {
2323
setTimeout(callback.bind(undefined, {canShowSurvey: true}), 500);
2424
},
25-
showSurvey: (trigger, callback) => {
25+
showSurvey: (_trigger, callback) => {
2626
setTimeout(callback.bind(undefined, {surveyShown: true}), 1500);
2727
},
2828
};

front_end/ui/components/survey_link/SurveyLink.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ import {describeWithLocale} from '../../../testing/EnvironmentHelpers.js';
88

99
import * as SurveyLink from './survey_link.js';
1010

11-
function canShowSuccessfulCallback(trigger: string, callback: SurveyLink.SurveyLink.CanShowSurveyCallback) {
11+
function canShowSuccessfulCallback(_trigger: string, callback: SurveyLink.SurveyLink.CanShowSurveyCallback) {
1212
callback({canShowSurvey: true});
1313
}
14-
function showSuccessfulCallback(trigger: string, callback: SurveyLink.SurveyLink.ShowSurveyCallback) {
14+
function showSuccessfulCallback(_trigger: string, callback: SurveyLink.SurveyLink.ShowSurveyCallback) {
1515
callback({surveyShown: true});
1616
}
17-
function canShowFailureCallback(trigger: string, callback: SurveyLink.SurveyLink.CanShowSurveyCallback) {
17+
function canShowFailureCallback(_trigger: string, callback: SurveyLink.SurveyLink.CanShowSurveyCallback) {
1818
callback({canShowSurvey: false});
1919
}
20-
function showFailureCallback(trigger: string, callback: SurveyLink.SurveyLink.ShowSurveyCallback) {
20+
function showFailureCallback(_trigger: string, callback: SurveyLink.SurveyLink.ShowSurveyCallback) {
2121
callback({surveyShown: false});
2222
}
2323

front_end/ui/legacy/Toolbar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ class ToolbarInputElement extends HTMLElement {
905905
return [...options].map((({value}) => value)).filter(value => value.startsWith(prefix)).map(text => ({text}));
906906
}
907907

908-
attributeChangedCallback(name: string, oldValue: string, newValue: string): void {
908+
attributeChangedCallback(name: string, _oldValue: string, newValue: string): void {
909909
if (name === 'value') {
910910
if (this.item && this.item.value() !== newValue) {
911911
this.item.setValue(newValue, true);

scripts/eslint_rules/lib/no-imperative-dom-api/toolbar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const toolbar = {
2626
return null;
2727
}
2828
},
29-
methodCall(property: Node, firstArg: Node, secondArg: Node, domFragment: DomFragment, _call: Node): boolean {
29+
methodCall(property: Node, firstArg: Node, _secondArg: Node, domFragment: DomFragment, _call: Node): boolean {
3030
if (isIdentifier(property, 'appendToolbarItem')) {
3131
domFragment.appendChild(firstArg, sourceCode);
3232
return true;

0 commit comments

Comments
 (0)