-
-
Notifications
You must be signed in to change notification settings - Fork 24
perf(typescript): strip projectService
from parser options when needed
#704
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
perf(typescript): strip projectService
from parser options when needed
#704
Conversation
🦋 Changeset detectedLatest commit: f6afc77 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 |
f00e609
to
7f4d62e
Compare
Try the Instant Preview in Online PlaygroundInstall the Instant Preview to Your Local
Published Instant Preview Packages:
|
Pull Request Test Coverage Report for Build 14543931958Details
💛 - Coveralls |
export function withoutProjectParserOptions( | ||
options: NormalizedParserOptions, | ||
): NormalizedParserOptions { | ||
const { | ||
project: _strippedProject, | ||
projectService: _strippedProjectService, | ||
EXPERIMENTAL_useProjectService: _strippedExperimentalUseProjectService, | ||
...result | ||
} = options; | ||
|
||
return result; | ||
} |
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.
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 relates to sveltejs/eslint-plugin-svelte#1084, but does not resolve it. During performance testing, I found a large discrepancy in lint times between
project: './tsconfig.json'
andprojectService: true
. Usingproject
was slow, but usingprojectService
was extremely slow.While comparing the Svelte parser with the similar Vue parser, I noticed that when the Svelte parser tries to use the TS parser without type information, it strips the
project
parser option. However, the Vue parser strips bothproject
andprojectService
.This PR ensures all typing-related parser options are stripped when needed rather than only
project
. This brings lint times usingprojectService
into alignment withproject
- still slow, but less slow