Skip to content
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

Merged
merged 3 commits into from
Jun 17, 2024

Conversation

ota-meshi
Copy link
Member

@ota-meshi ota-meshi commented Jun 17, 2024

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.

Copy link

changeset-bot bot commented Jun 17, 2024

🦋 Changeset detected

Latest commit: 1ea6d93

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
eslint-plugin-svelte Patch

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

Copy link
Member

@baseballyama baseballyama left a comment

Choose a reason for hiding this comment

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

Thank you🙏

@ota-meshi ota-meshi merged commit f7b7649 into main Jun 17, 2024
13 checks passed
@ota-meshi ota-meshi deleted the fix-valid-compile branch June 17, 2024 09:46
ota-meshi pushed a commit that referenced this pull request Jun 17, 2024
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,
Copy link
Member

@dummdidumm dummdidumm Jun 17, 2024

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.

Copy link
Member Author

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 😅

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.

$page is an illegal variable name
3 participants