Skip to content

feat: enhance TypeScript project setup with ESLint integration and up…#15305

Merged
davidfowl merged 3 commits intorelease/13.2from
dapine/eslint-error-on-missing-await
Mar 18, 2026
Merged

feat: enhance TypeScript project setup with ESLint integration and up…#15305
davidfowl merged 3 commits intorelease/13.2from
dapine/eslint-error-on-missing-await

Conversation

@IEvangelist
Copy link
Copy Markdown
Member

@IEvangelist IEvangelist commented Mar 17, 2026

Description

Both apphost.ts-based polyglot templates will now include ESLint and TypeScript Lint by default, and include a rule the enforces await with predev and prebuild hooks.

  • Added ESLint scripts for linting and pre-build checks in package.json
    • When a TS dev runs a dev script, they'll know how to fix it.
  • Updated TypeScript and ESLint dependencies to latest versions
  • Modified scaffolded package.json in TypeScriptLanguageSupport to include new scripts and dependencies
  • Introduced eslint.config.mjs for improved linting rules, including handling unawaited promises

Fixes #15303

eslint-debug.mp4

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?

…dated dependencies

- Added ESLint scripts for linting and pre-build checks in package.json
- Updated TypeScript and ESLint dependencies to latest versions
- Modified scaffolded package.json in TypeScriptLanguageSupport to include new scripts and dependencies
- Introduced eslint.config.mjs for improved linting rules, including handling unawaited promises
Copilot AI review requested due to automatic review settings March 17, 2026 04:16
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 17, 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/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15305

Or

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the TypeScript AppHost scaffolding and the aspire-ts-starter CLI template to add ESLint-based linting (with a focus on catching unawaited promises) and refreshes the Node/TypeScript toolchain versions used by generated projects.

Changes:

  • Add eslint.config.mjs and lint/predev/prebuild scripts so apphost.ts is linted before dev/build.
  • Update TypeScript starter/scaffold devDependencies (Node types, TypeScript, tsx, nodemon) and add ESLint + typescript-eslint.
  • Add a committed package-lock.json to the ts-starter template to lock the toolchain.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.

File Description
src/Aspire.Hosting.CodeGeneration.TypeScript/TypeScriptLanguageSupport.cs Updates scaffolded package.json scripts/deps and adds generated eslint.config.mjs.
src/Aspire.Cli/Templating/Templates/ts-starter/package.json Adds lint/dev/build scripts and ESLint + typescript-eslint devDependencies to the CLI template.
src/Aspire.Cli/Templating/Templates/ts-starter/package-lock.json New lockfile capturing exact dependency graph for the template.
src/Aspire.Cli/Templating/Templates/ts-starter/eslint.config.mjs New flat ESLint config enabling @typescript-eslint/no-floating-promises for apphost.ts.
Files not reviewed (1)
  • src/Aspire.Cli/Templating/Templates/ts-starter/package-lock.json: Language not supported

You can also share your feedback on Copilot code review. Take the survey.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 17, 2026

🎬 CLI E2E Test Recordings

The following terminal recordings are available for commit f8ef3e7:

Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View Recording
AddPackageWhileAppHostRunningDetached ▶️ View Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_DefaultSelection_InstallsSkillOnly ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
AspireAddPackageVersionToDirectoryPackagesProps ▶️ View Recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
CertificatesClean_RemovesCertificates ▶️ View Recording
CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate ▶️ View Recording
CertificatesTrust_WithUntrustedCert_TrustsCertificate ▶️ View Recording
ConfigSetGet_CreatesNestedJsonFormat ▶️ View Recording
CreateAndDeployToDockerCompose ▶️ View Recording
CreateAndDeployToDockerComposeInteractive ▶️ View Recording
CreateAndPublishToKubernetes ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateAndRunTypeScriptStarterProject ▶️ View Recording
CreateEmptyAppHostProject ▶️ View Recording
CreateStartAndStopAspireProject ▶️ View Recording
CreateTypeScriptAppHostWithViteApp ▶️ View Recording
DescribeCommandResolvesReplicaNames ▶️ View Recording
DescribeCommandShowsRunningResources ▶️ View Recording
DetachFormatJsonProducesValidJson ▶️ View Recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View Recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
GlobalMigration_HandlesCommentsAndTrailingCommas ▶️ View Recording
GlobalMigration_HandlesMalformedLegacyJson ▶️ View Recording
GlobalMigration_PreservesAllValueTypes ▶️ View Recording
GlobalMigration_SkipsWhenNewConfigExists ▶️ View Recording
GlobalSettings_MigratedFromLegacyFormat ▶️ View Recording
InvalidAppHostPathWithComments_IsHealedOnRun ▶️ View Recording
LogsCommandShowsResourceLogs ❌ Upload failed
PsCommandListsRunningAppHost ▶️ View Recording
PsFormatJsonOutputsOnlyJsonToStdout ❌ Upload failed
PublishWithDockerComposeServiceCallbackSucceeds ❌ Upload failed
RestoreGeneratesSdkFiles ▶️ View Recording
RunWithMissingAwaitShowsHelpfulError ▶️ View Recording
SecretCrudOnDotNetAppHost ▶️ View Recording
SecretCrudOnTypeScriptAppHost ▶️ View Recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View Recording
StopAllAppHostsFromAppHostDirectory ▶️ View Recording
StopAllAppHostsFromUnrelatedDirectory ▶️ View Recording
StopNonInteractiveMultipleAppHostsShowsError ▶️ View Recording
StopNonInteractiveSingleAppHost ▶️ View Recording
StopWithNoRunningAppHostExitsSuccessfully ▶️ View Recording
TypeScriptAppHostWithProjectReferenceIntegration ▶️ View Recording

📹 Recordings uploaded automatically from CI run #23202476811

Copy link
Copy Markdown
Member

@JamesNK JamesNK left a comment

Choose a reason for hiding this comment

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

A few issues to consider — see inline comments.

@JamesNK
Copy link
Copy Markdown
Member

JamesNK commented Mar 17, 2026

Review from Opus. I'm not sure whether these issues are valid or not. I trust you know more than me about the right thing to do.

@github-actions
Copy link
Copy Markdown
Contributor

The transient CI rerun workflow requested reruns for the following jobs after analyzing the failed attempt.
GitHub's job rerun API also reruns dependent jobs, so the retry is being tracked in the rerun attempt.
The job links below point to the failed attempt that matched the retry-safe transient failure rules.

@github-actions
Copy link
Copy Markdown
Contributor

The transient CI rerun workflow requested reruns for the following jobs after analyzing the failed attempt.
GitHub's job rerun API also reruns dependent jobs, so the retry is being tracked in the rerun attempt.
The job links below point to the failed attempt that matched the retry-safe transient failure rules.

@davidfowl davidfowl merged commit e93183f into release/13.2 Mar 18, 2026
500 of 503 checks passed
@davidfowl davidfowl deleted the dapine/eslint-error-on-missing-await branch March 18, 2026 00:06
@dotnet-policy-service dotnet-policy-service bot added this to the 13.2 milestone Mar 18, 2026
Copilot AI pushed a commit that referenced this pull request Mar 18, 2026
#15305)

* feat: enhance TypeScript project setup with ESLint integration and updated dependencies

- Added ESLint scripts for linting and pre-build checks in package.json
- Updated TypeScript and ESLint dependencies to latest versions
- Modified scaffolded package.json in TypeScriptLanguageSupport to include new scripts and dependencies
- Introduced eslint.config.mjs for improved linting rules, including handling unawaited promises

* fix: add engines field to package.json and package-lock.json for Node.js version compatibility

* fix: update Node.js engine constraints in package.json and package-lock.json for ESLint compatibility
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.

4 participants