1.0.6 • Published 6 years ago

babel-plugin-strip-typehint-imports v1.0.6

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

babel-plugin-strip-typehint-imports

Say you want to import something, but only use it for typehinting. This is the plugin for you!

import { MyType } from 'file.d.ts'; // typehints-only

/** @type {MyType} */
const something = {
    // ...
};

Turns into

/** @type {MyType} */
const something = {
    // ...
};

install

With npm

npm install --save-dev babel-plugin-strip-typehint-imports

With yarn

npm install --save-dev babel-plugin-strip-typehint-imports

And add the plugin to your .babelrc file

{
    "plugins": [
        "strip-typehint-imports"
    ]
}

You can also change which text is used to strip the imports.

{
    "plugins": [
        ["strip-typehint-imports", {
            "text": "remove me"
        }]
    ]
}

will remove the following import statement:

import {a} from 'b'; // remove me
1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago