eslint-plugin-absolute-import

Use absolute imports.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
eslint-plugin-absolute-import
2121.4.45 years ago6 years agoMinified + gzip package size for eslint-plugin-absolute-import in KB

Readme

eslint-plugin-absolute-import
build status Coverage Status win32 build status npm npm downloads
This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names. All the goodness that the ES2015+ static module syntax intends to provide, marked up in your editor.

Rules

Static analysis

Installation

npm install eslint-plugin-absolute-import -g

or if you manage ESLint as a dev dependency:
# inside your project's working tree
npm install eslint-plugin-absolute-import --save-dev

All rules are off by default.
Currently Node and webpack resolution have been implemented, but the resolvers are just npm packages, so third party packages are supported (and encouraged!).
Settings
You may set the following settings in your .eslintrc:

import/extensions

A list of file extensions that will be parsed as modules and inspected for exports.
This defaults to ['.js'], unless you are using the react shared config, in which case it is specified as ['.js', '.jsx'].
"settings": {
  "import/resolver": {
    "node": {
      "extensions": [
        ".js",
        ".jsx"
      ]
    }
  }
}