This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for native TypeScript (#979)
* Add TS compilation to build * Add linting to TypeScript files * Configure jest for TypeScript * Suppress TS warning about require * Fix ESLint TypeScript errors * Format files with prettier
- Loading branch information
1 parent
e77826c
commit 4552c37
Showing
19 changed files
with
841 additions
and
480 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,8 @@ | |
"node": "current" | ||
} | ||
} | ||
] | ||
], | ||
"@babel/preset-typescript" | ||
] | ||
} | ||
} | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const packageJson = require('./package.json') | ||
|
||
function readPackage(pkg, context) { | ||
if (pkg.dependencies.typescript) { | ||
pkg.dependencies = { | ||
...pkg.dependencies, | ||
typescript: packageJson.devDependencies.typescript, | ||
} | ||
context.log( | ||
`typescript@${pkg.dependencies.typescript} => typescript@${packageJson.devDependencies.typescript} in dependencies of ${pkg.name}` | ||
) | ||
} | ||
|
||
return pkg | ||
} | ||
|
||
module.exports = { | ||
hooks: { | ||
readPackage, | ||
}, | ||
} |
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
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
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
Oops, something went wrong.