@bitsnap/import-resolver

0.2.1 • Public • Published

@bitsnap/import-resolver

npmjs downloads CircleCI Coverage Status devDependencies Climate

Universal import resolver for eslint-plugin-import 🐈.

Supports resolving of node_modules, babel-plugin-resolver, babel-plugin-module-resolver.

How to use

> npm i --save-dev @bitsnap/import-resolver eslint lodash

.eslintrc

{
  "settings": {
    "import/resolver": {
      "@bitsnap/import-resolver": { /* optional settings */ }
    }
  }
  "plugins": ["eslint-plugin-import"],
  "extends": ["plugin:eslint-plugin-import/recommended"]
}

defaults are

{
  "root": `${process.cwd}`,
  "extensions": ['.js', '.mjs', '.json', '.jsx'],
}

Aliases are applied only for the start and the ending of the module path. With "alias": { "mod": "pam" } module/mod/index.js wouldn't be aliased, but module/mod -> module/pam will.

Aliasing is pretty uncommon, but can be handy from time to time.

Q&A

Feel free to ask some questions via Discord.

License

Licensed under MIT license, of course.

Package Sidebar

Install

npm i @bitsnap/import-resolver

Weekly Downloads

2

Version

0.2.1

License

MIT

Unpacked Size

51.8 kB

Total Files

7

Last publish

Collaborators

  • void.nugget