我如何在下一个开发(Next.js)中查看棉布消息

发布于 2025-01-18 11:41:12 字数 116 浏览 4 评论 0原文

当我使用 next dev (来自 next.js 库的命令)时,很高兴看到我在 watch/ 中运行 next lint 时收到的警告编译/服务“循环”。这可能吗?

When I use next dev (a command from the next.js library) it would be nice to see the warnings I get when I run next lint as part of the watch/compile/serve "loop". Is this possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

呆橘 2025-01-25 11:41:12

有点骇客,但是我的解决方案是在下一个dev之前始终运行下一个lint。我在我的package.json中添加了一个新命令:

  "scripts": {
    ...
    "dev-lint": "next lint && next dev"
  },

现在,如果下一个lint通过(无错误,仅警告),它运行news dev ;否则,该过程停止到达那里,直到固定错误为止。

It's a bit hacky, but my solution is to always run next lint before next dev. I added a new command in my package.json like so:

  "scripts": {
    ...
    "dev-lint": "next lint && next dev"
  },

Now, if next lint passes (no errors, only warnings), it runs next dev; otherwise, the process stops there until the errors are fixed.

浮华 2025-01-25 11:41:12

将这些设置添加到包装。这将确保检查文件&在拥有运行应用程序的同时,有覆盖。

  "scripts": {
    ...
    "dev": "next dev",
    "dev:ts": "yarn dev & yarn ts:watch",
    "ts": "tsc --noEmit --incremental",
    "ts:watch": "yarn ts --watch",
  },

Add these settings to the package.json and run npm run dev:ts. This will ensure files are checked & linted while having a running app.

  "scripts": {
    ...
    "dev": "next dev",
    "dev:ts": "yarn dev & yarn ts:watch",
    "ts": "tsc --noEmit --incremental",
    "ts:watch": "yarn ts --watch",
  },
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文