Open jbinto opened 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
+1 here!
+1
+1
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: {}
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
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 animport/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?