/babel-plugin-auto-completion

Modularly import plugin for antd-mobile. import { componentName } from 'antd-mobile' is not required any more.

Primary LanguageJavaScriptMIT LicenseMIT

NPM version Build Status Build status Coverage Status Dependency Status Greenkeeper badge

babel-plugin-auto-completion

Babel Plugin for autopletion.

Transform

function a() {
  return <Button>A</Button>;
}

To

import { Button } from 'antd-mobile';

function a() {
  return <Button>A</Button>;
}

Install

npm install --save-dev babel-plugin-auto-completion

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["auto-completion"]
}

Via CLI

babel script.js --plugins auto-completion

Via Node API

require("babel-core").transform("code", {
  plugins: ["auto-completion"]
});

Options

libraryName

string, defaults to "".

xxx

libraryDirectory

string, defaults to "lib".

xxx

camel2DashComponentName

boolean, defaults to true.

xxx

style

string/boolean, defaults to false, "less" "css" true".

xxx

keys

string/ [string], defaults to []

xxx