This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
chore(package): use @babel/register instead of ts-node #1395
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
layershifter
requested review from
dvdzkwsk,
kuzhelov,
levithomason,
miroslavstastny and
mnajdova
as code owners
May 27, 2019 09:28
layershifter
force-pushed
the
chore/babel-register
branch
from
May 27, 2019 09:37
ec21452
to
efce030
Compare
Codecov Report
@@ Coverage Diff @@
## master #1395 +/- ##
=======================================
Coverage 73.47% 73.47%
=======================================
Files 778 778
Lines 5859 5859
Branches 1726 1726
=======================================
Hits 4305 4305
Misses 1548 1548
Partials 6 6 Continue to review full report at Codecov.
|
Generated by 🚫 dangerJS |
layershifter
commented
May 27, 2019
@@ -1,35 +0,0 @@ | |||
import * as Lint from 'tslint' |
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.
Don't need this more, is catched by react/no-unknown-property
16:28 error Unknown property 'stop-color' found, use 'stopColor' instead react/no-unknow
n-property
layershifter
changed the title
WIP: Chore/babel register
chore(package): use @babel/register instead of ts-node
May 27, 2019
Closed
2 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Motivation
We are using
ts-node
to compile our TS code on the fly during Gulp tasks and Screener run. As we we're switching to use Babel (#508), we can use@babel/register
as it is faster thants-node
(there are no type checks during run).This change is required for #1387, otherwise TS configs will become complicated and hard to maintain: we're calling Gulp with different configs that in package's root which results us to strange build commands:
"build": "cross-env TS_NODE_PROJECT=../../tsconfig.json gulp bundle:package:no-umd --package react-component-ref"
Remove custom TSLint rule
We don't need it more as these cases are covered by
react/no-unknown-property
🚀allowSyntheticDefaultImports
in/build
We can't enable this option in our main project (
react
) because we can produce broken typings (#46) for our consumers who don't enable this option. But it's safe to enable it for our tools, otherwise it becomes endless war with Babel because it handles CommonJS modules differently:More in Babel REPL.
We had the same issue before even in distributed code (
classnames
#570, https://github.com/stardust-ui/react/blob/v0.31.0/packages/react/src/lib/felaExpandCssShorthandsPlugin.ts#L7).create-react-app
enablesallowSyntheticDefaultImports: true
andskipLibCheck: true
by default: https://github.com/facebook/create-react-app/blob/v3.0.1/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js#L106