【发布时间】:2018-07-09 01:33:21
【问题描述】:
当我尝试使用 $ReadOnlyArray 时,eslint 显示错误“$ReadOnlyArray is not defined (no-undef)”。我可能有错误的配置,但我不知道从哪里开始。
这里有一些环境信息:
- 反应原生:0.51.0
- 流量:0.57
- eslint:4.9.0,
- eslint-plugin-flow: 6.23.0
【问题讨论】:
标签: react-native eslint flowtype
当我尝试使用 $ReadOnlyArray 时,eslint 显示错误“$ReadOnlyArray is not defined (no-undef)”。我可能有错误的配置,但我不知道从哪里开始。
这里有一些环境信息:
【问题讨论】:
标签: react-native eslint flowtype
您需要按如下方式安装 Flow 类型的 linting 规则:
npm install eslint-plugin-flowtype --save-dev
您的 .eslintrc 文件应如下所示:
{
"parser": "babel-eslint",
"env": {
},
"plugins": [
"flowtype"
],
"extends": [
"eslint:recommended",
"plugin:flowtype/recommended"
],
"rules": {
}
}
【讨论】: