eslint-import-resolver-babel-module

    5.3.1 • Public • Published

    eslint-import-resolver-babel-module

    npm Build Status Coverage Status

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

    Installation

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

    Usage

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

    "settings": {
      "import/resolver": {
        "babel-module": {}
      }
    }
    

    And see babel-plugin-module-resolver to know how to configure your aliases.

    Example

    {
      "extends": "airbnb",
      "rules": {
        "comma-dangle": 0
      },
      "settings": {
        "import/resolver": {
          "babel-module": {}
        }
      }
    }

    Directory Imports

    Some babel plugins like babel-plugin-import-directory or babel-plugin-wildcard allow to import directories (i.e. each file inside a directory) as an object. In order to support this, you can activate the allowExistingDirectories option as follows:

    "settings": {
      "import/resolver": {
        "babel-module": { allowExistingDirectories: true }
      }
    }
    

    Now when you import a directory like this, the ESLint plugin won't complain and recognize the existing directory:

    import * as Items from './dir';
    

    License

    MIT, see LICENSE.md for details.

    Install

    npm i eslint-import-resolver-babel-module

    DownloadsWeekly Downloads

    329,232

    Version

    5.3.1

    License

    MIT

    Unpacked Size

    21.3 kB

    Total Files

    5

    Last publish

    Collaborators

    • tleunen