Skip to content

Commit afc8a8c

Browse files
Lightning00BladeDevtools-frontend LUCI CQ
authored andcommitted
[eslint] Include ExtensionAPI
This makes all current files under DevTools lintable with EsLint by default. Also remove the rule for default export for configs. Bug: 397260638 Change-Id: I3b380ad4351eb53c65207b242d7f8221e7788e48 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6357121 Commit-Queue: Nikolay Vitkov <[email protected]> Reviewed-by: Benedikt Meurer <[email protected]> Commit-Queue: Benedikt Meurer <[email protected]>
1 parent cdf828b commit afc8a8c

File tree

7 files changed

+20
-11
lines changed

7 files changed

+20
-11
lines changed

eslint.config.mjs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
/* eslint-disable import/no-default-export */
6-
75
import stylisticPlugin from '@stylistic/eslint-plugin';
86
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
97
import tsParser from '@typescript-eslint/parser';
@@ -842,4 +840,13 @@ export default [
842840
'import/no-default-export': 'off',
843841
},
844842
},
843+
{
844+
name: 'Config files',
845+
files: ['eslint.config.mjs', '**/*/rollup.config.mjs'],
846+
rules: {
847+
// The config operate on the default export
848+
// So allow it for them
849+
'import/no-default-export': 'off',
850+
},
851+
},
845852
];

extension-api/ExtensionAPI.d.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
export namespace Chrome {
66
export namespace DevTools {
7+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
78
export interface EventSink<ListenerT extends(...args: any) => void> {
89
addListener(listener: ListenerT): void;
910
removeListener(listener: ListenerT): void;
@@ -43,7 +44,7 @@ export namespace Chrome {
4344
details: unknown[],
4445
isError: boolean,
4546
isException: boolean,
46-
value: string
47+
value: string,
4748
}) => unknown): void;
4849
getResources(callback: (resources: Resource[]) => unknown): void;
4950
reload(reloadOptions?: {ignoreCache?: boolean, injectedScript?: string, userAgent?: string}): void;
@@ -169,10 +170,13 @@ export namespace Chrome {
169170
export type RecorderExtensionPlugin = RecorderExtensionExportPlugin|RecorderExtensionReplayPlugin;
170171

171172
export interface RecorderExtensionExportPlugin {
173+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
172174
stringify(recording: Record<string, any>): Promise<string>;
175+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
173176
stringifyStep(step: Record<string, any>): Promise<string>;
174177
}
175178
export interface RecorderExtensionReplayPlugin {
179+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
176180
replay(recording: Record<string, any>): void;
177181
}
178182

@@ -182,6 +186,7 @@ export namespace Chrome {
182186
export interface RemoteObject {
183187
type: RemoteObjectType;
184188
className?: string;
189+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
185190
value?: any;
186191
description?: string;
187192
objectId?: RemoteObjectId;
@@ -244,9 +249,8 @@ export namespace Chrome {
244249
* Retrieve function name(s) for the function(s) containing the rawLocation. This returns more than one entry if
245250
* the location is inside of an inlined function with the innermost function at index 0.
246251
*/
247-
getFunctionInfo(rawLocation: RawLocation):
248-
Promise<{frames: Array<FunctionInfo>, missingSymbolFiles: Array<string>}|{missingSymbolFiles: Array<string>}|
249-
{frames: Array<FunctionInfo>}>;
252+
getFunctionInfo(rawLocation: RawLocation): Promise<{frames: FunctionInfo[], missingSymbolFiles: string[]}|
253+
{missingSymbolFiles: string[]}|{frames: FunctionInfo[]}>;
250254

251255
/**
252256
* Find locations in raw modules corresponding to the inline function
@@ -284,9 +288,9 @@ export namespace Chrome {
284288
releaseObject(objectId: RemoteObjectId): Promise<void>;
285289
}
286290

287-
288291
export interface SupportedScriptTypes {
289292
language: string;
293+
// eslint-disable-next-line @typescript-eslint/naming-convention
290294
symbol_types: string[];
291295
}
292296

front_end/Images/rollup.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import {importMetaAssets} from '@web/rollup-plugin-import-meta-assets';
55
import {optimize} from 'svgo';
66

7-
// eslint-disable-next-line import/no-default-export
87
export default {
98
treeshake: false,
109
output: [{

front_end/models/live-metrics/web-vitals-injected/rollup.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ function isEnvVarTrue(envVar) {
1313
return envVar === 'true';
1414
}
1515

16-
// eslint-disable-next-line import/no-default-export
1716
export default {
1817
treeshake: true,
1918
output: [{format: 'iife'}],

front_end/panels/recorder/injected/rollup.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ function isEnvVarTrue(envVar) {
1313
return envVar === 'true';
1414
}
1515

16-
// eslint-disable-next-line import/no-default-export
1716
export default {
1817
treeshake: false,
1918
output: [{format: 'iife'}],

scripts/build/rollup.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import sourcemaps from 'rollup-plugin-sourcemaps2';
1010
import { devtoolsPlugin } from './devtools_plugin.js';
1111

1212
/** @type {function({configSourcemaps: boolean}): import("rollup").MergedRollupOptions} */
13-
// eslint-disable-next-line import/no-default-export
13+
1414
export default commandLineArgs => ({
1515
treeshake: false,
1616
context: 'self',

scripts/test/run_lint_check.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const flags = yargs(hideBin(process.argv))
4040
'scripts',
4141
'test',
4242
'extensions',
43+
'extension-api',
4344
],
4445
});
4546
})

0 commit comments

Comments
 (0)