This project shows how to change the TypeScript code using Visual Editors such as Visual Studio Code and the TypeScript compiler.
Run npm run build
, cd to an TypeScript project,
and add to the tsconfig.json
file:
{
"compilerOptions": {
"plugins": [{
"name": "<path to this project>"
}],
// other config
Then, on any TypeScript file, add a const that is later changed, like so:
const n = 1;
n = 2;
The compiler will complain. You will then see a refactoring to fix the code when
you position your cursor on top of the n
variable, changing the const
to a let
.
npm test
will run the unit tests, using Jest as a runner and test framework.
To publish, simply do:
npm run build
npm publish
Licensed under the Apache License, Version 2.0.