-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
fix: false positives for import vars with TS in svelte/valid-compile
#790
Conversation
🦋 Changeset detectedLatest commit: 1ea6d93 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Thank you🙏
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## [email protected] ### Patch Changes - [#790](#790) [`f7b7649`](f7b7649) Thanks [@ota-meshi](https://github.com/ota-meshi)! - fix: false positives for import vars with TS in `svelte/valid-compile` Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@@ -35,6 +35,7 @@ export function transform( | |||
ts.ScriptTarget.ESNext, | |||
module: ts.ModuleKind.ESNext, | |||
importsNotUsedAsValues: ts.ImportsNotUsedAsValues.Preserve, | |||
preserveValueImports: true, |
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.
That option is deprecated since TypeScript 5.0 and AFAIK will not do anything anymore starting 5.5. (not sure if this also applies to transpileModule
, but definitely when running tsc
). I think it's better to use verbatimModuleSyntax
instead, assuming a TS version that has it is the minimum required version.
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.
Thank you for your comment!
I knew it was deprecated, but I didn't know it would be removed in 5.5. It seems that we need to specify both so that it works with older versions of typescript 😅
…TS v5.5. (#797) See comment #790 (comment)
close #652
This PR fixes the issue mentioned in the comments below.
#652 (comment)
In the code posted at the top of the thread the rule seems to work correctly, and correctly shows the svelte compiler warnings.