feat: enhance TypeScript project setup with ESLint integration and up…#15305
feat: enhance TypeScript project setup with ESLint integration and up…#15305davidfowl merged 3 commits intorelease/13.2from
Conversation
…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
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15305Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15305" |
There was a problem hiding this comment.
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.mjsandlint/predev/prebuildscripts soapphost.tsis linted before dev/build. - Update TypeScript starter/scaffold devDependencies (Node types, TypeScript, tsx, nodemon) and add ESLint + typescript-eslint.
- Add a committed
package-lock.jsonto thets-startertemplate 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.
src/Aspire.Hosting.CodeGeneration.TypeScript/TypeScriptLanguageSupport.cs
Show resolved
Hide resolved
src/Aspire.Hosting.CodeGeneration.TypeScript/TypeScriptLanguageSupport.cs
Show resolved
Hide resolved
🎬 CLI E2E Test RecordingsThe following terminal recordings are available for commit
📹 Recordings uploaded automatically from CI run #23202476811 |
src/Aspire.Cli/Templating/Templates/ts-starter/eslint.config.mjs
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting.CodeGeneration.TypeScript/TypeScriptLanguageSupport.cs
Show resolved
Hide resolved
….js version compatibility
JamesNK
left a comment
There was a problem hiding this comment.
A few issues to consider — see inline comments.
src/Aspire.Hosting.CodeGeneration.TypeScript/TypeScriptLanguageSupport.cs
Show resolved
Hide resolved
src/Aspire.Hosting.CodeGeneration.TypeScript/TypeScriptLanguageSupport.cs
Show resolved
Hide resolved
|
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. |
|
The transient CI rerun workflow requested reruns for the following jobs after analyzing the failed attempt.
|
…ck.json for ESLint compatibility
|
The transient CI rerun workflow requested reruns for the following jobs after analyzing the failed attempt.
|
#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
Description
Both
apphost.ts-based polyglot templates will now include ESLint and TypeScript Lint by default, and include a rule the enforcesawaitwithpredevandprebuildhooks.devscript, they'll know how to fix it.package.jsoninTypeScriptLanguageSupportto include new scripts and dependencieseslint.config.mjsfor improved linting rules, including handling unawaited promisesFixes #15303
eslint-debug.mp4
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: