Javascript 巴别塔模块分解器不';I don’我没有按预期工作
我在我的节点项目中用eslint配置了babel插件模块解析器。这是我的英语Javascript 巴别塔模块分解器不';I don’我没有按预期工作,javascript,node.js,babeljs,eslintrc,Javascript,Node.js,Babeljs,Eslintrc,我在我的节点项目中用eslint配置了babel插件模块解析器。这是我的英语 { "env": { "es6": true, "node": true }, "extends": [ "airbnb-base" ], "globals": { "Atomics": "readonly", "SharedArrayBuffer": "readonly" }, "parserOptions": { "ecmaVersion"
{
"env": {
"es6": true,
"node": true
},
"extends": [
"airbnb-base"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"settings": {
"import/resolver": {
"babel-module": {}
}
},
"rules": {
"class-methods-use-this": "off",
"newline-per-chained-call": "off",
"indent": ["warn", 2],
"quotes": ["warn", "single"],
"no-unused-vars": ["error", {"warn": "none"}],
"max-len": ["warn", 150],
"no-console": 1,
"object-curly-newline": ["warn", {
"ObjectPattern": { "multiline": true },
"ExportDeclaration": { "multiline": true, "minProperties": 4 }
}]
}
}
这是我的babelrc文件
{
"presets": ["@babel/preset-env"],
"plugins": [
[
"module-resolver",
{
"alias": {
"constants": "./constants",
"database": "./database",
"library": "./library",
"mappers": "./mappers",
"middleware": "./middleware",
"models": "./models",
"repositories": "./repositories",
"routes": "./routes",
"services": "./services",
"utils": "./utils"
}
}
]
]
}
现在在我的项目中,路径可以像这样正常工作
import User from 'models/user.model';
import UserRepository from 'repositories/user.repository';
但我有以下问题。
单击导入时,它不会转到定义。
智能感知不起作用
我在这里用这些插件做什么?我想拥有intellisense并转到定义(导航)功能。我遇到了同样的问题,你解决了吗?是的。您使用的是node还是react?react Native需要nodeJsI。我遇到同样的问题,您解决了吗?是的。您正在使用node还是react?react Native需要NodeJ