eslint-import-resolver-babel-root-slash-import

1.0.6 • Public • Published

eslint-import-resolver-babel-root-slash-import NPM version

A babel-root-slash-import resolver for eslint-plugin-import.

Installation

npm install --save-dev eslint-plugin-import eslint-import-resolver-babel-root-slash-import

Usage

Inside your .eslintrc file, pass this resolver to eslint-plugin-import:

"settings": {
  "import/resolver": {
    "babel-root-slash-import": {}
  }
}

And see babel-root-slash-import to know how to configure.

Example

{
  "extends": "airbnb",
  "rules": {},
  "settings": {
    "import/resolver": {
      "babel-root-slash-import": {}
    }
  }
}

Debugging

You can debug the result of the plugin by adding debug option to true in your .eslintrc file:

{
  "extends": "airbnb",
  "rules": {},
  "settings": {
    "import/resolver": {
      "babel-root-slash-import": { "debug": true}
    }
  }
}

Then run your linter and find the result in /tmp/eslint-import-resolver-babel-root-slash-import.log :

Example:

/js/store/myFile.js - /path/to/projects/myJSProject/index.js- absolute - true - /path/to/projects/myJSProject/js/store/myFile.js

./js/store/myFile.js - /path/to/projects/myJSProject/index.js- other - true - /path/to/projects/myJSProject/js/store/myFile.js

/js/store/myFile.js - /path/to/projects/index.js- absolute - false - undefined

The format is {import value} - {file containing the import}- {absolute|other} - {true is resolving succeeds} - {resolved path}

License

MIT, see LICENSE.md for details.

Package Sidebar

Install

npm i eslint-import-resolver-babel-root-slash-import

Weekly Downloads

54

Version

1.0.6

License

MIT

Last publish

Collaborators

  • fredericruaudel