-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add TypeScript support #83
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closes sveltejs#68 This does not introduce a generic preprocessor-option. Instead it provides a TypeScript-specific implementation. The advantage is that we don't need hacks like deasync because transpilation and mapping can happen synchronously. It also makes post-processing and interaction with ESLint easier. How it works: 1. transpile script contents from TS to JS 2. compile result to get Svelte compiler warnings 3. map those warnings back to its original positions 4. blank script contents 5. compile again to get the AST with original positions in the markdown part 6. use AST of step 5, vars of step 2 and blanked script content to produce the text which is handed to ESLint 7. Let the ESLint TypeScript plugin handle the TS code 8. adjust mappings
nosovk
approved these changes
Feb 11, 2021
Conduitry
reviewed
Feb 11, 2021
Sorry about these code style issues, I'm no longer able to format myself since using Prettier 😄 |
Conduitry
force-pushed
the
typescript
branch
from
February 15, 2021 23:18
d2b1b82
to
f285706
Compare
Yeah! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #68
This does not introduce a generic preprocessor-option. Instead it provides a TypeScript-specific implementation. The advantage is that we don't need hacks like deasync because transpilation and mapping can happen synchronously. It also makes post-processing and interaction with ESLint easier.
How it works:
TODO:
test/support for named blockscheck type-aware rules supportQuestion: Update
package-lock.json
? There are new (dev) dependencies and it would be good to have them in there. Why is it ignored in the first place?