Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

eslint-plugin-lean-imports

eslint-plugins17.5kMIT0.3.3

ESLint Plugin to make sure your imports only import the bits you need

eslint-plugin, eslintplugin, eslint, import, lodash, react-bootstrap

readme

ESLint-plugin-lean-imports

Travis Build Status devDependency Status

Make sure your imports only import the bits you need

Installation

Install ESLint either locally or globally.

npm install eslint

If you installed ESLint globally, you have to install lean-imports plugin globally too. Otherwise, install it locally.

npm install eslint-plugin-lean-imports

The rules are specifically written to target ES6 JavaScript, so you'll want to use the babel-eslint parser.

Configuration

Add plugins section and specify ESLint-plugin-lean-imports as a plugin.

{
  "parser": "babel-eslint",
  "plugins": [
    "lean-imports"
  ]
}

Finally, enable all of the rules that you would like to use.

{
  "rules": {
    "lean-imports/import": [1, [
        "lodash",
        "react-bootstrap",
    ]]
  }
}

List of supported rules

The rules prevent from importing the whole library at once.

Here are the supported libraries:

  • import Prevent an array of library from being completely imported

Contributing

PRs are welcome if you have ideas.

Just make sure your commit is prefixed by one of the following:

  • [added]
  • [changed]
  • [fixed]
  • [removed]

For changed or removed, just make sure to add an upgrade path in the commit message.

Ideas are welcome

License

ESLint-plugin-lean-imports is licensed under the MIT License.

changelog

v0.3.3 - Wed, 11 May 2016 15:57:23 GMT

v0.3.2 - Sun, 13 Mar 2016 16:32:09 GMT

  • 491e84f [fixed] pin eslint at 2.2.x, fixed exports

v0.3.1 - Tue, 01 Mar 2016 17:20:04 GMT

v0.3.0 - Tue, 01 Mar 2016 06:08:43 GMT

  • b2cc0ae [added] Updated dependencies (babel 6)

v0.2.1 - Tue, 01 Mar 2016 03:37:00 GMT

  • b2cc0ae [added] Updated dependencies (babel 6)

v0.2.0 - Tue, 04 Aug 2015 06:45:01 GMT

  • 701f06b [fixed] issue with test with the new context options
  • 9bcd19f [fixed] issue with context options

v0.1.3 - Tue, 04 Aug 2015 06:30:38 GMT

  • 6dfc61a [fixed] missing build in tests

v0.1.2 - Tue, 04 Aug 2015 06:28:14 GMT

  • 3662e8b [fixed] usage with eslint 1.0.0

v0.1.1 - Tue, 04 Aug 2015 06:12:22 GMT