-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Use babel for typescript compilation with minimal changes #1738
Use babel for typescript compilation with minimal changes #1738
Conversation
✔️ Deploy Preview for react-redux-docs ready! 🔨 Explore the source changes: a9e65c9 🔍 Inspect the deploy log: https://app.netlify.com/sites/react-redux-docs/deploys/60d49d14217dd000082f920e 😎 Browse the preview: https://deploy-preview-1738--react-redux-docs.netlify.app |
So just to confirm, the build failure is "intentional" for now, right? :) |
Yes, we should remove test.ts before we merge. I got it emitting types and typescript code in all 3 build modes, but eslint is still unhappy |
"extends": [ | ||
"eslint:recommended", | ||
"plugin:import/recommended", | ||
"plugin:react/recommended", | ||
"plugin:prettier/recommended" | ||
// "plugin:@typescript-eslint/recommended" |
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.
Their documentation recommends turning this on, and we normally do in projects I work with, but it generates a lot of noise in the js files and I don't think there's a way to do an "extends" for only one type of file. I say we leave it off for now and consider turning it on when we're most of the way through the conversion, unless people on this project don't mind seeing and ignoring lint errors while they work.
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.
Oh yeah, my experience has been that ruleset is way to over-opinionated.
We don't want to be focusing on lint rules right now. The immediate goal is just to get stuff compiling at all, and then get most of the existing types into place. Linting would be a last step.
Seems like a reasonable starting point. Let's get this in! |
Kicking off #1737 🚀
If the goal is to exactly match existing behavior, why fix what isn't broken? This change uses babel's typescript preset to compile typescript without any dramatic changes to the existing rollup-babel flow, and invokes
tsc
directly to check types only.I included a little test.ts with a type error in it to demonstrate that module resolution and type checking both work. I tried turning on checkJs in the tsconfig but typescript does not like that one bit. We've got our work cut out for us :)
I do not know why there are so many deletions in the package.lock file
Edit: I just turned off my computer for the night but I realized I forgot to make it actually emit the type definitions. Sorry about the premature PR.