Javascript: Extending 'airbnb-base' doesn't recognize custom import resolver 'babel-plugin-root-import' settings

Created on 25 Jul 2020  路  3Comments  路  Source: airbnb/javascript

Hi,
I'm using babel along with this plugin 'babel-plugin-root-import'. It also provides in the documentation about how to make it work with Eslint and VS Code (with jsconfig.json).

The things mentioned in the documentation were working fine until I tried to extend the eslint-config-airbnb-base in my eslint file. Eslint is throwing eslint(import/no-unresolved) error. However, babel and VS-Code redirection to custom paths are working fine.
image

Here are my config files:
.eslintrc

{
    "$schema": "http://json.schemastore.org/eslintrc",
    "env": {
        "node": true
    },
    "extends": "airbnb-base",
    "parserOptions": {
        "ecmaVersion": 7,
        "sourceType": "module"
    },
    "rules": {
    },
    "plugins": [
        "import"
    ],
    "settings": {
        "import/resolver": {
            "babel-plugin-root-import": {}
        }
    }
}

.babelrc
image

Also, if I use eslint-config-google instead of eslint-config-airbnb in my eslintrc file, it's working fine (no ESLint error is thrown).
image

Thanks

All 3 comments

The last part is likely because eslint-config-google doesn鈥檛 enable this particular rule.

I agree that should work; please file an issue on eslint-plugin-import instead, as it鈥檚 not an issue with this config.

Hmm.
Thanks, @ljharb.
Didn't realize that even on using a wrong path or filename 'eslint-config-google' didn't throw any errors.

Few shared configs are as thorough as this one :-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stephenkingsley picture stephenkingsley  路  3Comments

graingert picture graingert  路  3Comments

ar
mbifulco picture mbifulco  路  3Comments

ryankask picture ryankask  路  3Comments

mismith picture mismith  路  3Comments