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(typescript): Add typechecking! #177

Merged
merged 4 commits into from
Jan 25, 2020
Merged

feat(typescript): Add typechecking! #177

merged 4 commits into from
Jan 25, 2020

Conversation

NotWoods
Copy link
Member

Rollup Plugin Name: typescript

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
    • Since the plugin now complains about type errors, its a breaking change.
  • no

List any relevant issue numbers: #71, #105, #153

Description

Adds full typechecking support to the official Typescript plugin!

  • Code frame is now included when errors are emitted
  • Builds a Typescript LanguageServiceHost to work with various APIs.
  • Uses Typescript's LanguageService API to compile and typecheck files.
  • Changes the base tsconfig so that browser APIs aren't included by default.
  • Fixes types for util/test so that functions return promises.

@shellscape
Copy link
Collaborator

@NotWoods if this looks good to you, merge it. Which semver are you thinking for this, minor or major?

@NotWoods
Copy link
Member Author

I'm thinking of major just to be safe. The new feature is fairly large so it makes sense as a major change.

@lukastaegert
Copy link
Member

Nice work!

One question (admittedly without checking your code): Will it still be possible to use the "old" style transformations via option? I definitely think that type-checking should be enabled by default, but the old way is still probably faster and may have other advantages for development (though it does not support const enums of course). Mainly that you can compile "dirty" code to try something out without littering everything with any casts 😉

But I do not see it as a "must have"

Which semver are you thinking for this, minor or major?

For that reason I agree that it should be major as it is breaking for people relying on this plugin compiling their broken types 😜

@NotWoods
Copy link
Member Author

NotWoods commented Jan 24, 2020

@NotWoods
Copy link
Member Author

Should that option be included here to make migration easier?

@lukastaegert
Copy link
Member

Not for me, you can always hold back on upgrading if it is on the roadmap

@shellscape shellscape merged commit 07d0fbf into master Jan 25, 2020
@NotWoods NotWoods deleted the ts-type-check branch January 25, 2020 04:14
LarsDenBakker pushed a commit to LarsDenBakker/plugins that referenced this pull request Sep 12, 2020
BREAKING CHANGE: This enables type checking, which will prevent builds with type errors from succeeding.

* feat(typescript): Add typechecking

* chore(release): pluginutils v3.0.5

Co-authored-by: Andrew Powell <shellscape@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants