Babel-plugin-module-resolver: What should I do to have code hints?

Created on 4 Jul 2018  路  7Comments  路  Source: tleunen/babel-plugin-module-resolver

before:
image
now:
image
I hope you can understand what I mean.
Before I use this plugin, I can see which files are in the path according to the code prompt when I enter the path, but now, I don't know what is there, and it is easy to get spelling errors.

Most helpful comment

I just want a hint , I am using webstorm

All 7 comments

I just want a hint , I am using webstorm

You can find a hint in the README: https://github.com/tleunen/babel-plugin-module-resolver#editors-autocompletion.

{
  "presets": [
    "babel-preset-react-native-stage-0/decorator-support"
  ],
  "plugins": [
    "transform-decorators-legacy",
    [
      "module-resolver",
      {
        "root": ["./"],
        "alias": {
          "MOBX": "./js/mobx",
          "IMG": "./image",
          "COMMON": "./js/common"
        }
      }
    ]
  ],
  "env": {
    "development": {
      "plugins": [
        "transform-react-jsx-source"
      ]
    }
  }
}

this is my .babelrc, but it doesn't work

image

This is my directory, I hope to be useful to you.

thanks for your help~

I don't use Webstorm, but if you want to pursue this and help us improve the docs, then that would be awesome!

I certainly want it, but now my settings don't work, do you know why?

No, I don't use Webstorm and I don't know why. I'd bet it's because Webstorm doesn't handle aliases, but I'm not 100% sure if that's impossible to set up.

thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kevinNejad picture kevinNejad  路  3Comments

ViktorAksionov picture ViktorAksionov  路  3Comments

kkomaz picture kkomaz  路  7Comments

stavalfi picture stavalfi  路  3Comments

tleunen picture tleunen  路  6Comments