-
Notifications
You must be signed in to change notification settings - Fork 336
Migrate init templates to createTester API and update ESLint to latest standard #9596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
7
commits into
main
Choose a base branch
from
copilot/update-init-templates-testing-framework
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
041827d
Initial plan
Copilot cb97df5
Migrate init templates to new testing framework
Copilot bc903f9
Revert vitest imports to node:test and fix tester path resolution
Copilot be7154b
Update eslint config to latest standard with typescript-eslint package
Copilot 6f97eac
Replace tsEslint.config with defineConfig from eslint/config
Copilot 46659d8
Add changelog for init templates migration
Copilot 7ccf337
Fix library-ts template tests to work with createTester
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
...us/changes/copilot-update-init-templates-testing-framework-2026-1-5-20-11-37.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| changeKind: internal | ||
| packages: | ||
| - "@typespec/compiler" | ||
| --- | ||
|
|
||
| Update init templates to use createTester API and modern ESLint configuration |
11 changes: 10 additions & 1 deletion
11
packages/compiler/templates/__snapshots__/emitter-ts/eslint.config.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,20 @@ | ||
| // @ts-check | ||
| import eslint from "@eslint/js"; | ||
| import { defineConfig } from "eslint/config"; | ||
| import tsEslint from "typescript-eslint"; | ||
|
|
||
| export default tsEslint.config( | ||
| export default defineConfig( | ||
| { | ||
| ignores: ["**/dist/**/*", "**/.temp/**/*"], | ||
| }, | ||
| eslint.configs.recommended, | ||
| ...tsEslint.configs.recommended, | ||
| { | ||
| rules: { | ||
| "@typescript-eslint/no-unused-vars": [ | ||
| "warn", | ||
| { varsIgnorePattern: "^_", argsIgnorePattern: "^_" }, | ||
| ], | ||
| }, | ||
| }, | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 7 additions & 34 deletions
41
packages/compiler/templates/__snapshots__/emitter-ts/test/test-host.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 10 additions & 1 deletion
11
packages/compiler/templates/__snapshots__/library-ts/eslint.config.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,20 @@ | ||
| // @ts-check | ||
| import eslint from "@eslint/js"; | ||
| import { defineConfig } from "eslint/config"; | ||
| import tsEslint from "typescript-eslint"; | ||
|
|
||
| export default tsEslint.config( | ||
| export default defineConfig( | ||
| { | ||
| ignores: ["**/dist/**/*", "**/.temp/**/*"], | ||
| }, | ||
| eslint.configs.recommended, | ||
| ...tsEslint.configs.recommended, | ||
| { | ||
| rules: { | ||
| "@typescript-eslint/no-unused-vars": [ | ||
| "warn", | ||
| { varsIgnorePattern: "^_", argsIgnorePattern: "^_" }, | ||
| ], | ||
| }, | ||
| }, | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 5 additions & 15 deletions
20
packages/compiler/templates/__snapshots__/library-ts/test/test-host.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,7 @@ | ||
| import { createTestHost, createTestWrapper } from "@typespec/compiler/testing"; | ||
| import { LibraryTsTestLibrary } from "../src/testing/index.js"; | ||
| import { resolvePath } from "@typespec/compiler"; | ||
| import { createTester } from "@typespec/compiler/testing"; | ||
|
|
||
| export async function createLibraryTsTestHost() { | ||
| return createTestHost({ | ||
| libraries: [LibraryTsTestLibrary], | ||
| }); | ||
| } | ||
|
|
||
| export async function createLibraryTsTestRunner() { | ||
| const host = await createLibraryTsTestHost(); | ||
|
|
||
| return createTestWrapper(host, { | ||
| autoUsings: ["LibraryTs"] | ||
| }); | ||
| } | ||
| export const Tester = createTester(resolvePath(import.meta.dirname, "../.."), { | ||
| libraries: ["library-ts"], | ||
| }).import("library-ts"); | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,20 @@ | ||
| // @ts-check | ||
| import eslint from "@eslint/js"; | ||
| import { defineConfig } from "eslint/config"; | ||
| import tsEslint from "typescript-eslint"; | ||
|
|
||
| export default tsEslint.config( | ||
| export default defineConfig( | ||
| { | ||
| ignores: ["**/dist/**/*", "**/.temp/**/*"], | ||
| }, | ||
| eslint.configs.recommended, | ||
| ...tsEslint.configs.recommended, | ||
| { | ||
| rules: { | ||
| "@typescript-eslint/no-unused-vars": [ | ||
| "warn", | ||
| { varsIgnorePattern: "^_", argsIgnorePattern: "^_" }, | ||
| ], | ||
| }, | ||
| }, | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 7 additions & 34 deletions
41
packages/compiler/templates/emitter-ts/test/test-host.ts.mu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,20 @@ | ||
| // @ts-check | ||
| import eslint from "@eslint/js"; | ||
| import { defineConfig } from "eslint/config"; | ||
| import tsEslint from "typescript-eslint"; | ||
|
|
||
| export default tsEslint.config( | ||
| export default defineConfig( | ||
| { | ||
| ignores: ["**/dist/**/*", "**/.temp/**/*"], | ||
| }, | ||
| eslint.configs.recommended, | ||
| ...tsEslint.configs.recommended, | ||
| { | ||
timotheeguerin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| rules: { | ||
| "@typescript-eslint/no-unused-vars": [ | ||
| "warn", | ||
| { varsIgnorePattern: "^_", argsIgnorePattern: "^_" }, | ||
| ], | ||
| }, | ||
| }, | ||
| ); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot add changelog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added changeset using
pnpm change add:Changeset file:
.chronus/changes/copilot-update-init-templates-testing-framework-2026-1-5-20-11-37.md(commit: 6f97eac → current)