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

feat: treat jsdoc with @typescript-eslint/parser #607

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

baseballyama
Copy link
Member

close: #533

@ota-meshi
In this PR, I made it so that scripts that appear to be JSDoc are parsed using @typescript-eslint/parser. I thought this would apply the types, but judging from the tests, it doesn’t seem to be working. Do you have any idea what might be wrong?

Copy link

changeset-bot bot commented Dec 1, 2024

⚠️ No Changeset found

Latest commit: cae678c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

pkg-pr-new bot commented Dec 1, 2024

Open in Stackblitz

npm i https://pkg.pr.new/svelte-eslint-parser@607

commit: cae678c

@coveralls
Copy link

coveralls commented Dec 1, 2024

Pull Request Test Coverage Report for Build 12326393889

Details

  • 89 of 91 (97.8%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 94.819%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/parser/parser-options.ts 43 45 95.56%
Totals Coverage Status
Change from base Build 12251662727: 0.0%
Covered Lines: 10256
Relevant Lines: 10693

💛 - Coveralls

@baseballyama baseballyama force-pushed the fix/533 branch 2 times, most recently from 16f1abb to 8bb7ba1 Compare December 1, 2024 13:01
@ota-meshi
Copy link
Member

There may be a problem with type inference in the typescript core.
I think how typescript infers types depends on ScriptKind. By default, ScriptKind is determined from the extension, so we may need to make ScriptKind recognize as JS. But I don't know how to do that well.

https://github.com/microsoft/TypeScript/blob/421f5c5458d09dad601604e6eff8765283aef14e/src/compiler/types.ts#L7584

@baseballyama
Copy link
Member Author

Thank you. For now, I will prioritize addressing other issues.

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.

JSDoc types are lost in svelte files (typescript-eslint)
3 participants