This project fork from olalonde/eslint-import-resolver-babel-root-import.
A babel-plugin-root-import resolver for eslint-plugin-import.
This project has been transferred to unconfident/eslint-import-resolver-babel-plugin-root-import.
See issues#14 for details.
npm install --save-dev eslint-plugin-import eslint-import-resolver-babel-plugin-root-import
Inside your .eslintrc
file, pass this resolver to eslint-plugin-import
:
"settings": {
"import/resolver": "babel-plugin-root-import"
}
And your .babelrc
file look like this:
{
"presets": ["latest", "react", "stage-0"],
"plugins": [
"transform-runtime",
[
"babel-plugin-root-import", [{
"rootPathPrefix": "~",
"rootPathSuffix": "app/components"
}, {
"rootPathPrefix": "$",
"rootPathSuffix": "app"
}, {
"rootPathPrefix": "#",
"rootPathSuffix": "lib"
}]
]
]
}
MIT, see LICENSE.md for details.