ESLint - 别名设置
问题描述:
所以我使用的别名在我的WebPack配置和我有no-extraneous-dependencies
等ESLint - 别名设置
因此,我安装eslint-plugin-import
与eslint-import-resolver-alias
一起和我的配置文件.eslintrc
这样那些eslint
警告:
{
"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"]
]
}
}
}
我的棉绒不适用于此settings
选项。我错过了什么?
答
的问题必须是与你的相对路径
"./shared/actions"
尝试将其更改为
"../shared/actions"
如果还是不行,请尝试绝对路径,并从那里。
基本上,根目录/当前工作目录,不是你认为的那个...