Socket
Socket
Sign inDemoInstall

eslint-import-resolver-babel-module

Package Overview
Dependencies
80
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    eslint-import-resolver-babel-module

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


Version published
Weekly downloads
269K
decreased by-0.29%
Maintainers
1
Install size
256 kB
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 16 Jan 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc