How can I see lint messages in next dev (next.js)

Viewed 259

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?

1 Answers

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.

Related