Skip to content

Fix VS Code extension strict comparison lint warnings#15837

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/fix-comparison-operator-warnings
Draft

Fix VS Code extension strict comparison lint warnings#15837
Copilot wants to merge 3 commits intomainfrom
copilot/fix-comparison-operator-warnings

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 3, 2026

Description

Fixes the remaining VS Code extension lint warnings caused by non-strict != null comparisons in the App Host tree provider, code lens provider, and gutter decoration provider.

This keeps the existing exit-code behavior while aligning the checks with the extension lint rules.

Validation:

  • parallel_validation (Code Review + CodeQL) ✅
  • npm run lint could not be executed in this sandbox because npm ci failed on blocked network access while downloading packages

cc @adamint

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

Copilot AI and others added 3 commits April 3, 2026 06:07
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15837

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15837"

export function getResourceIcon(resource: ResourceJson): vscode.ThemeIcon {
const state = resource.state;
const health = resource.healthStatus;
const hasNonZeroExitCode = resource.exitCode !== null && resource.exitCode !== undefined && resource.exitCode !== 0;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all these changes are fine, i just wonder if it might be better to add a type guard and avoid all the duplication?

ie,

function isNotNullOrUndefined<T>(val: T | undefined | null): val is T {
    return val !== undefined && val !== null;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants