react-native - 核素与流量中没有错误

标签 react-native atom-editor nuclide-editor

我尝试在 Nuclide 安装中使用 Flow,但在 React-Native 项目中看不到任何诊断信息。但是从 cli 运行流程会导致 1000 多个错误。

如果我保存文件,底部栏中的微调器会旋转,然后完全消失(无空闲)。

.flowconfig

[ignore]

[include]

[libs]

[lints]

[options]

package.json

 "devDependencies": {
    "babel-cli": "^6.26.0",
    "babel-core": "^6.25.0",
    "babel-jest": "19.0.0",
    "babel-preset-flow": "^6.23.0",
    "babel-preset-react-native": "^1.9.1",
    "flow-bin": "^0.56.0",
    "jest": "19.0.2",
    "react-test-renderer": "15.4.2"
  },

我的App.js

/* @flow */
Math.pow('X');
import boot from "./app/boot";
const app = boot();
export default app;

enter image description here

最佳答案

在让 Nuclide Diagnostics 报告 Flow 问题以显示在 Atom 中时,我也遇到了令人沮丧的问题。

正如您提到的,在 CLI 中运行 Flow 会出现错误,但 IDE 中不会显示任何内容。

我发现你的帖子有点晚了,但这就是我所做的(终于)成功了。

1)可能没有必要,尽管我还是这么做了...我在这篇文章之后尽我所能卸载了 Atom:https://discuss.atom.io/t/how-to-completely-uninstall-atom-for-mac/9084/42

2) 我下载了最新版本的 Atom 并安装了它:https://atom.io/

3) 在安装 Nuclide 之前我先安装了 linter。 这似乎是我在所有其他尝试中所缺少的。我运行了 apm install linter , apm install linter-eslint ,和apm install linter-flow 。我启动了 Atom,允许 IDE 安装 linter-ui-default ,然后验证是Atom自己的linter-flow正在检测流程错误。唉,原来如此!身材不错。

4) 然后我终于安装了nuclide 。当提示选择禁用 linter 时或atom-ide-diagnostics-ui为了避免重复的 linting 问题,我选择禁用 atom-ide-diagnostics-ui验证 IDE 是否仍能正确识别 Flow 问题,幸运的是,确实如此。

5) 然后我就关掉了 linter并重新启用atom-ide-diagnostics (原子 > 配置 > nuclide > use > "atom-ide-diagnostics-ui": true )。令我大吃一惊的是,一切仍然存在问题,而且 Flow 问题现在已使用 Nuclide 的诊断 UI 集成到 Atom 中!

以下是我按时间顺序安装的软件包的列表:

├── <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7a180f09035709131d141b163a4b544e5449" rel="noreferrer noopener nofollow">[email protected]</a> ├── <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ff96918b9a918b9690918cbfced1ced1ca" rel="noreferrer noopener nofollow">[email protected]</a> ├── <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="600c090e14051220524e524e50" rel="noreferrer noopener nofollow">[email protected]</a> (disabled) ├── <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1e7277706a7b6c337b6d7277706a5e26302a302e" rel="noreferrer noopener nofollow">[email protected]</a> ├── <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a8c4c1c6dccdda85cec4c7dfe89d869e8699" rel="noreferrer noopener nofollow">[email protected]</a> ├── <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="731f1a1d0716015e061a5e17161512061f0733425d455d4243" rel="noreferrer noopener nofollow">[email protected]</a> └── <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="eb859e8887828f8eabdbc5d9dcdac5db" rel="noreferrer noopener nofollow">[email protected]</a>


编辑:添加了我的 Nuclide 设置的屏幕截图

Nuclide settings

祝你好运,希望这能有所帮助!

关于react-native - 核素与流量中没有错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47287865/

相关文章:

installation - 错误: expected package `Juno [e5e0dc1b]` to be registered

ruby-on-rails - 无法在 Windows 10 中删除 Ubuntu 中的文件夹

facebook - React Native 项目的 .buck 配置

react-native - 如何使用 React Native 显示本地 JPG 图片?

ios - 图像未填充在 iOS 模拟器中的页眉上

atom-editor - 无法在 atom 上将核素包升级到 0.125.0

android - 原子 : Quick Documentation of React Native

javascript - Atom/Nuclide 中的代码中断语法突出显示

reactjs - Babel - .js 文件中具有 JSX 语法的节点模块会破坏编译

ios - 无法运行 ios 的 React Native 项目