Skip to content

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

Draft
baseballyama wants to merge 1 commit into
mainfrom
fix/533
Draft

feat: treat jsdoc with @typescript-eslint/parser#607
baseballyama wants to merge 1 commit into
mainfrom
fix/533

Conversation

@baseballyama

Copy link
Copy Markdown
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?

@changeset-bot

changeset-bot Bot commented Dec 1, 2024

Copy link
Copy Markdown

⚠️ 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

@pkg-pr-new

pkg-pr-new Bot commented Dec 1, 2024

Copy link
Copy Markdown

Open in Stackblitz

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

commit: cae678c

@coveralls

coveralls commented Dec 1, 2024

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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