So I am using aliases in my webpack configuration and I have those eslint warnings about no-extraneous-dependencies etc.
So I installed eslint-plugin-import along with eslint-import-resolver-alias and configured my .eslintrc files like this:
{
  "parser": "babel-eslint",
  "extends": "airbnb",
  "env": {
    "browser": true,
    "es6": true,
    "node": true,
    "jest": true
  },
  "parserOptions": {
    "ecmaVersion": 6,
    "sourceType": "module",
    "ecmaFeatures": {
      "defaultParams": true
    }
  },
  "rules": {
    "react/jsx-filename-extension": 0,
    "react/sort-comp": 0,
    "linebreak-style": 0,
    "prefer-arrow-callback": 0,
    "consistent-return": 0,
    "func-names": 0,
  },
  "settings": {
    "import/resolver": {
      "alias": [
        // I have my actions folder in ./shared/actions
        ["Actions", "./shared/actions"]
      ]
    }
  }
}
My linter is not working with this settings options. What am I missing?
The problem has to be with your relative path
"./shared/actions"
Try changing it to
"../shared/actions"
If that does not work, try an absolute path and take it from there.
Basically, the root directory / current working directory, is not the one you think it is...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With