-
Notifications
You must be signed in to change notification settings - Fork 161
refactor: move typeAware/typeCheck from CLI flags to vite.config.ts #739
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6d509ca
refactor: replace custom OxlintConfig with oxlint package export
fengmk2 6237268
fix(migrate): skip typeAware/typeCheck when tsconfig.json has baseUrl
fengmk2 56dfed9
fix(migrate): log warning when baseUrl skips typeAware/typeCheck
fengmk2 a9e8be2
fix: lazy-import init-config to avoid missing devDependency in publis…
fengmk2 8c2003f
fix: move detect-indent/detect-newline to dependencies
fengmk2 44ca36f
fix: extract hasBaseUrlInTsconfig to utils/tsconfig.ts to avoid detec…
fengmk2 6880f2b
fix(migrate): strip $schema property from JSON configs when merging i…
fengmk2 69220fb
chore: update vue-mini e2e project hash to latest
fengmk2 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
1 change: 1 addition & 0 deletions
1
packages/cli/snap-tests-global/command-dlx-no-package-json/steps.json
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,3 +1,4 @@ | ||
| { | ||
| "ignoredPlatforms": ["win32"], | ||
| "commands": ["vp dlx -s cowsay hello # should work without package.json"] | ||
| } |
1 change: 1 addition & 0 deletions
1
packages/cli/snap-tests-global/create-from-nonworkspace-subdir/steps.json
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
5 changes: 5 additions & 0 deletions
5
packages/cli/snap-tests-global/migration-baseurl-tsconfig/.oxlintrc.json
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,5 @@ | ||
| { | ||
| "rules": { | ||
| "no-unused-vars": "error" | ||
| } | ||
| } |
5 changes: 5 additions & 0 deletions
5
packages/cli/snap-tests-global/migration-baseurl-tsconfig/package.json
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,5 @@ | ||
| { | ||
| "devDependencies": { | ||
| "oxlint": "1" | ||
| } | ||
| } |
57 changes: 57 additions & 0 deletions
57
packages/cli/snap-tests-global/migration-baseurl-tsconfig/snap.txt
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,57 @@ | ||
| > vp migrate --no-interactive # migration should skip typeAware/typeCheck when tsconfig has baseUrl | ||
| VITE+ - The Unified Toolchain for the Web | ||
|
|
||
|
|
||
| Using default package manager: pnpm | ||
|
|
||
| pnpm@latest installing... | ||
|
|
||
| pnpm@<semver> installed | ||
|
|
||
| ✔ Created vite.config.ts in vite.config.ts | ||
|
|
||
| Skipped typeAware/typeCheck: tsconfig.json contains baseUrl which is not yet supported by the oxlint type checker. | ||
fengmk2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Run `npx @andrewbranch/ts5to6 --fixBaseUrl .` to remove baseUrl from your tsconfig. | ||
|
|
||
| ✔ Merged .oxlintrc.json into vite.config.ts | ||
|
|
||
| ✔ Merged staged config into vite.config.ts | ||
|
|
||
| Wrote agent instructions to AGENTS.md | ||
| ✔ Migration completed! | ||
|
|
||
|
|
||
| > cat vite.config.ts # check vite.config.ts — should NOT have typeAware or typeCheck | ||
| import { defineConfig } from 'vite-plus'; | ||
|
|
||
| export default defineConfig({ | ||
| staged: { | ||
| "*": "vp check --fix" | ||
| }, | ||
| lint: { | ||
| "rules": { | ||
| "no-unused-vars": "error" | ||
| }, | ||
| "options": {} | ||
| }, | ||
| }); | ||
|
|
||
| > cat .oxlintrc.json && exit 1 || true # check .oxlintrc.json is removed | ||
| cat: .oxlintrc.json: No such file or directory | ||
|
|
||
| > cat package.json # check package.json | ||
| { | ||
| "devDependencies": { | ||
| "vite-plus": "latest" | ||
| }, | ||
| "pnpm": { | ||
| "overrides": { | ||
| "vite": "npm:@voidzero-dev/vite-plus-core@latest", | ||
| "vitest": "npm:@voidzero-dev/vite-plus-test@latest" | ||
| } | ||
| }, | ||
| "packageManager": "pnpm@<semver>", | ||
| "scripts": { | ||
| "prepare": "vp config" | ||
| } | ||
| } | ||
8 changes: 8 additions & 0 deletions
8
packages/cli/snap-tests-global/migration-baseurl-tsconfig/steps.json
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,8 @@ | ||
| { | ||
| "commands": [ | ||
| "vp migrate --no-interactive # migration should skip typeAware/typeCheck when tsconfig has baseUrl", | ||
| "cat vite.config.ts # check vite.config.ts — should NOT have typeAware or typeCheck", | ||
| "cat .oxlintrc.json && exit 1 || true # check .oxlintrc.json is removed", | ||
| "cat package.json # check package.json" | ||
| ] | ||
| } |
7 changes: 7 additions & 0 deletions
7
packages/cli/snap-tests-global/migration-baseurl-tsconfig/tsconfig.json
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 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "target": "ES2023", | ||
| "module": "NodeNext", | ||
| "baseUrl": "." | ||
| } | ||
| } |
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
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
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.
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.
Uh oh!
There was an error while loading. Please reload this page.