-
-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
Description
example: transform tsx to tsx
import putout from "putout"
const source = `
const hello: string = 'world';
const hi = 'there';
console.log(hello);
`;
const res = putout(source, {
isTS: true,
isJSX: true,
//isFlow: true,
//parser: 'babel',
//sourceFileName: 'input.tsx',
//sourceMapName: 'input.tsx.map',
processors: [
//'typescript', // @putout/processor-typescript type checking for typescript files
],
plugins: [
//'typescript', // @putout/plugin-typescript transform TypeScript code. Enabled by default for ts and tsx files.
'remove-unused-variables',
],
});
console.log(res.code);not perfect, because it should return typescript
had to disable the typescript plugin, which was removing the : string
example result
const hello: string = 'world';
console.log(hello);Reactions are currently unavailable