0.1.3 • Published 7 years ago

eslint-import-resolver-configurable v0.1.3

Weekly downloads
2,242
License
MIT
Repository
github
Last release
7 years ago

eslint-import-resolver-configurable


Imagine you have the following configuration in webpack.conf.js:

// webpack.conf.js
module.exports = {
  // ...
  resolve: {
    alias: {
      common: './src/subdir/common-components'
    }
  },
  // ...
};

And also imagine that you can't use webpack resolver from eslint-plugin-import (or you alias things in some other bundler) when linting your imports.

This package allows you to resolve such aliases. Configuration in your .eslintrc.js to resolve such alias for proper linting would be same as your alias config:

// .eslintrc.js
module.exports = {
  // ...
  settings: {
    'import/resolver': {
      configurable: {
        common: './src/subdir/common-components',
        // Or absolute paths
        components: '/path/to/some/dir'
      }
    }
  },
  // ...
};

Paths are resolved relative to .eslintrc.js location.