我开始使用沃尔玛新的React框架Electrode。
我正在尝试配置eslint,已经尝试扩展沃尔玛的lint配置,如下:
https://github.com/walmartlabs/eslint-config-walmart
这是 .eslintrc 文件
{
"parser": "babel-eslint",
"ecmaFeatures": {
"jsx": true
},
"env": {
"es6": true
},
"extends": "walmart/configurations/es6-react-test",
"rules": {
"indent": ["error", 2]
}
}
和 package.json
"devDependencies": {
"babel-eslint": "^7.1.1",
"electrode-archetype-react-app-dev": "^1.0.0",
"eslint": "^2.10.2",
"eslint-plugin-filenames": "^1.0.0",
"eslint-plugin-react": "^5.1.1",
"gulp": "^3.9.1"
},
但是我遇到了一个“未找到规则 'filenames/match-regex' 的定义”的错误。我安装了eslint-plugin-filenames,还需要配置其他东西吗?
file: 'file:///foo/client/components/home.jsx'
severity: 'Error'
message: 'Definition for rule 'filenames/match-regex' was not found (filenames/match-regex)'
at: '1,1'
source: 'eslint'
.eslintrc
文件中:"plugins": ["filenames"]
。 - Aurora0001