olalonde / eslint-import-resolver-babel-root-import

A babel-root-import resolver for eslint-plugin-import
MIT License
23 stars 33 forks source link

Doesn't work with atom linter-eslint plugin #3

Open jbinto opened 7 years ago

jbinto commented 7 years ago

When I run eslint at the command line, everything works as expected (I can do an import Foo from '~foo' and it warns correctly if i give a bad path.)

However, when using Atom's linter-eslint plugin (using the local .eslintrc config), it always gives an import/no-unresolved error, whether the path is good or not. Never had something fail only in atom, which is weird since it should be using the exact same config as eslint on the command line. Maybe something to do with relative paths?

Any idea why this might be, or how to begin debugging it?

olalonde commented 7 years ago

Sorry, I can't really say :/ wrote this really quickly and it's been a while. I'm also having weird issues occasionnally with this

ouabing commented 7 years ago

+1 here!

zuhair-naqvi commented 7 years ago

+1

KirillSuhodolov commented 7 years ago

+1

panzi commented 7 years ago

I have this or a similar problem. I use babel to compile the files under src to lib, so babel needs the rootPathSuffix to be lib in order to load the compiled files, but eslint would need it to be src, because during development the files under lib simply don't yet exist. So I would like to write this in my eslintrc to override the configuration in babelrc:

settings:
  import/resolver:
    babel-root-import:
      rootPathPrefix: "~"
      rootPathSuffix: "src"
    node: {}
miriyalee commented 6 years ago

Use this version. https://github.com/BlitzBanana/eslint-import-resolver-babel-root-import

npm install --save-dev eslint-plugin-import eslint-import-resolver-babel-root-import-fixed or yarn add eslint-plugin-import eslint-import-resolver-babel-root-import-fixed