Skip to content

bingqichen/eslint-import-resolver-babel-plugin-root-import

 
 

Repository files navigation

eslint-import-resolver-babel-plugin-root-import

This project fork from olalonde/eslint-import-resolver-babel-root-import.

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

⚠️ Warning

This project has been transferred to unconfident/eslint-import-resolver-babel-plugin-root-import.

See issues#14 for details.

Installation

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

Usage

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"
            }]
        ]
    ]
}

License

MIT, see LICENSE.md for details.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%