【问题标题】:No errors in Nuclide with FlowNuclide with Flow 没有错误
【发布时间】:2017-11-14 14:09:01
【问题描述】:

我尝试在我的 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;

【问题讨论】:

    标签: react-native atom-editor nuclide-editor


    【解决方案1】:

    在让 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 正在接收 Flow 错误。唉,原来如此!身材不错。

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

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

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

    ├── busy-signal@1.4.3 ├── intentions@1.1.5 ├── linter@2.2.0 (disabled) ├── linter-eslint@8.4.0 ├── linter-flow@5.6.1 ├── linter-ui-default@1.6.10 └── nuclide@0.271.0


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

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

    【讨论】:

    • 感谢您的详细回答!它只是帮助我修复了在我的 Atom 中显示流错误。
    猜你喜欢
    • 2017-03-03
    • 2021-10-08
    • 1970-01-01
    • 2019-08-02
    • 1970-01-01
    • 1970-01-01
    • 2019-11-19
    • 2010-12-26
    • 1970-01-01
    相关资源
    最近更新 更多