2017-08-24 679 views
0

所以我使用的别名在我的WebPack配置和我有no-extraneous-dependenciesESLint - 别名设置

因此,我安装eslint-plugin-importeslint-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选项。我错过了什么?

回答

0

的问题必须是与你的相对路径

"./shared/actions" 

尝试将其更改为

"../shared/actions" 

如果还是不行,请尝试绝对路径,并从那里。

基本上,根目录/当前工作目录,不是你认为的那个...