babel-plugin-codemod-named-export-declarations

1.3.0 • Public • Published

babel-plugin-codemod-named-export-declarations

This plugin replaces export object literal declaration with corresponding named export declarations with Typescript support.

Example

In

type IFoo = string;
 
const foo: IFoo = 'foo';
 
export { foo, IFoo };

Out

export type IFoo = string;
 
export const foo: IFoo = 'foo';

Installation

yarn add -D babel-plugin-codemod-named-export-declarations

Usage

Via CLI (recommended)

Run transforms on your files with excellent babel-codemod! Considered it's installed locally:

./node_modules/.bin/codemod -p babel-plugin-codemod-named-export-declarations script.js

babel-codemod enables other plugins for parsing files out of the box (eg. jsx, typescript).

Via Node API

require('babel-core').transform('code', {
  plugins: ['codemod-named-export-declarations']
});

/babel-plugin-codemod-named-export-declarations/

    Package Sidebar

    Install

    npm i babel-plugin-codemod-named-export-declarations

    Weekly Downloads

    5

    Version

    1.3.0

    License

    MIT

    Unpacked Size

    10.6 kB

    Total Files

    23

    Last publish

    Collaborators

    • infctr