豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 55c992e

Browse files
Lightning00BladeDevtools-frontend LUCI CQ
authored andcommitted
[EsLint] Prefixes for version bump
The auto-fixes coming from the next version bump as a separate CL, so that the other CL does not get too big. Also needed to fix our EsLint plugin as the exported name was removed Bug: none Change-Id: Id18bafa663ccbc30b9a51c90225d2c3072235b25 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/7184379 Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Auto-Submit: Nikolay Vitkov <nvitkov@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
1 parent ec507d4 commit 55c992e

File tree

58 files changed

+92
-100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+92
-100
lines changed

front_end/core/sdk/AnimationModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ export class AnimationModel extends SDKModel<EventTypes> {
375375
const animation = await AnimationImpl.parsePayload(this, payload);
376376
// Ignore Web Animations custom effects & groups.
377377
const keyframesRule = animation.source().keyframesRule();
378-
if (animation.type() === 'WebAnimation' && keyframesRule && keyframesRule.keyframes().length === 0) {
378+
if (animation.type() === 'WebAnimation' && keyframesRule?.keyframes().length === 0) {
379379
this.#pendingAnimations.delete(animation.id());
380380
} else {
381381
this.#animationsById.set(animation.id(), animation);

front_end/core/sdk/CSSModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export class CSSModel extends SDKModel<EventTypes> {
190190

191191
const {styles} =
192192
await this.agent.invoke_setStyleTexts({edits: [{styleSheetId, range: range.serializeToObject(), text}]});
193-
if (!styles || styles.length !== 1) {
193+
if (styles?.length !== 1) {
194194
return false;
195195
}
196196

front_end/core/sdk/CSSProperty.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ export class CSSProperty extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
292292
}
293293
if (cssMetadata().isGridAreaDefiningProperty(propertyName)) {
294294
const rowResult = GridAreaRowRegex.exec(token);
295-
if (rowResult && rowResult.index === 0 && !propertyText.trimEnd().endsWith(']')) {
295+
if (rowResult?.index === 0 && !propertyText.trimEnd().endsWith(']')) {
296296
propertyText = propertyText.trimEnd() + '\n' + doubleIndent;
297297
}
298298
}

front_end/core/sdk/CSSPropertyParserMatchers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,7 @@ export class AnchorFunctionMatcher extends matcherBase(AnchorFunctionMatch) {
12371237
if (node.name === 'VariableName') {
12381238
// Double-dashed anchor reference to be rendered with a link to its matching anchor.
12391239
let parent = node.parent;
1240-
if (!parent || parent.name !== 'ArgList') {
1240+
if (parent?.name !== 'ArgList') {
12411241
return null;
12421242
}
12431243
parent = parent.parent;

front_end/core/sdk/ConsoleModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ export class ConsoleModel extends SDKModel<EventTypes> {
432432
const callFunctionResult =
433433
await globalObject.callFunction(saveVariable, [RemoteObject.toCallArgument(remoteObject)]);
434434
globalObject.release();
435-
if (callFunctionResult.wasThrown || !callFunctionResult.object || callFunctionResult.object.type !== 'string') {
435+
if (callFunctionResult.wasThrown || callFunctionResult.object?.type !== 'string') {
436436
failedToSave(callFunctionResult.object || null);
437437
} else {
438438
const text = (callFunctionResult.object.value as string);

front_end/core/sdk/Cookie.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ export class Cookie {
278278
// extension cookie tests currently use the funtionality, and if we
279279
// ever decide to implement that it should be done by preventing
280280
// such cookies from being set.
281-
if (!domain || domain[0] !== '.') {
281+
if (domain?.[0] !== '.') {
282282
return false;
283283
}
284284

front_end/core/sdk/DOMModel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ export class DOMNode {
746746
}
747747

748748
const oldAttribute = oldAttributesMap.get(name);
749-
if (!oldAttribute || oldAttribute.value !== value) {
749+
if (oldAttribute?.value !== value) {
750750
attributesChanged = true;
751751
}
752752
}
@@ -1671,7 +1671,7 @@ export class DOMModel extends SDKModel<EventTypes> {
16711671
}
16721672
const {nodeIds} =
16731673
await this.agent.invoke_getSearchResults({searchId: this.#searchId, fromIndex: index, toIndex: index + 1});
1674-
return nodeIds && nodeIds.length === 1 ? this.nodeForId(nodeIds[0]) : null;
1674+
return nodeIds?.length === 1 ? this.nodeForId(nodeIds[0]) : null;
16751675
}
16761676

16771677
private cancelSearch(): void {

front_end/core/sdk/DebuggerModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ export class DebuggerModel extends SDKModel<EventTypes> {
858858
let functionName: RemoteObject|null = null;
859859
if (response.properties) {
860860
for (const prop of response.properties) {
861-
if (prop.name === 'name' && prop.value && prop.value.type === 'string') {
861+
if (prop.name === 'name' && prop.value?.type === 'string') {
862862
functionName = prop.value;
863863
}
864864
}

front_end/core/sdk/PreloadingModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class PreloadingModel extends SDKModel<EventTypes> {
4747
void this.agent.invoke_enable();
4848

4949
const targetInfo = target.targetInfo();
50-
if (targetInfo !== undefined && targetInfo.subtype === 'prerender') {
50+
if (targetInfo?.subtype === 'prerender') {
5151
this.lastPrimaryPageModel = TargetManager.instance().primaryPageTarget()?.model(PreloadingModel) || null;
5252
}
5353

front_end/core/sdk/RemoteObject.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ export class RemoteArray {
970970
}
971971

972972
static objectAsArray(object: RemoteObject|null): RemoteArray {
973-
if (!object || object.type !== 'object' || (object.subtype !== 'array' && object.subtype !== 'typedarray')) {
973+
if (object?.type !== 'object' || (object.subtype !== 'array' && object.subtype !== 'typedarray')) {
974974
throw new Error('Object is empty or not an array');
975975
}
976976
return new RemoteArray(object);

0 commit comments

Comments
 (0)