Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mrkou47/eslint-plugin-recommend-import

strict import esModule code style in your project
https://github.com/mrkou47/eslint-plugin-recommend-import

Last synced: about 2 months ago
JSON representation

strict import esModule code style in your project

Awesome Lists containing this project

README

        

# eslint-plugin-recommend-import

## Installation

You'll first need to install [ESLint](http://eslint.org):

```
$ npm i eslint --save-dev
```

Next, install `eslint-plugin-recommend-import`:

```
$ npm install eslint-plugin-recommend-import --save-dev
```

**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `eslint-plugin-recommend-import` globally.

## How to use

```js
{
"plugins": [
"recommend-import"
],
"rules": {
"recommend-import/no-import-lib": 2
}
}
```

## Rule Details

This rule aims to ensure that the current `import` module which provides `module` field in the `package.json`

Examples of **incorrect** code for this rule:

```js
import browserHistory from 'react-router/lib/browserHistory';
import combineReducer from 'redux/lib/combineReducer';
```

Examples of **correct** code for this rule:

```js
import { browserHistory } from 'react-router';
import { combineReducer } from 'redux/lib/combineReducer';
```