0.2.1 • Published 5 years ago

@bitsnap/import-resolver v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

@bitsnap/import-resolver

npmjs downloads CircleCI Coverage Status devDependencies Climate

Universal import resolver for eslint-plugin-import :cat2:.

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.