Skip to content

Commit aa0af54

Browse files
Lightning00BladeDevtools-frontend LUCI CQ
authored andcommitted
[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');

0 commit comments

Comments
 (0)