Natural Potato Magnet

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

    1.1.1 • Public • Published

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

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

    This is a fork of eslint-import-resolver-babel-root-import that works with latest version of babel plugin.

    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 see babel-plugin-root-import to know how to configure your prefix/suffix. Configuration will be parsed down from .babelrc file

    Example

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

    Or if you don't use .babelrc and keep your babel configuration in, say, webpack config you can pass those options to resolver directly through .eslintrc file:

    {
      "extends": "airbnb",
      "rules": {},
      "settings": {
        "import/resolver": {
          "babel-plugin-root-import": {
            "rootPathPrefix": "@",
            "rootPathSuffix": "src/js"
          }
        }
      }
    }

    License

    MIT, see LICENSE.md for details.

    Install

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

    DownloadsWeekly Downloads

    10,706

    Version

    1.1.1

    License

    MIT

    Unpacked Size

    75.2 kB

    Total Files

    8

    Last publish

    Collaborators

    • chenbingqi
    • unconfident