question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

--strict for counting warnings as errors

See original GitHub issue

Soliciting feedback on the idea before doing the work. My apologies if this is already doable, but I didn’t find anything thus far…

Scenario

  • Linting is ran before nodemon restarts, the build runs, etc.
  • ESLint ensures that any syntax issues cause an error, preventing unnecessary server restarts, builds, etc.
  • Warnings are available in the console for the developer to optionally clean up.
  • Code works, builds run, servers restart, but there’s no way to actually enforce standards without making everything incorrectly an error.

Solution – --strict.

  • A pre-push git hook can run eslint --strict and even warnings count as errors, preventing pushing.
  • Continuous integration tools can run in strict mode so that the build breaks when quality tests don’t pass.
  • The user can still work on a feature with warnings, since the most important thing is the feature working.

The gist is, quality should still be enforced somewhere in the process, but not be an impediment to development.

Thoughts?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

35reactions
joshkelcommented, May 17, 2016

--max-warnings can serve this purpose: --max-warnings=0 means that any warnings cause eslint to report an error.

6reactions
michaelficarracommented, Apr 14, 2015

Again, just don’t run the linter during development. Your one counterexample (syntax errors) can be solved by running a parser against the code as you write it, something many editors (including vim) will do for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I compile without warnings being treated as errors?
You can make all warnings being treated as such using -Wno-error. You can make specific warnings being treated as such by using -Wno-error=< ......
Read more >
Warning Options (Using the GNU Compiler Collection (GCC))
Warnings are diagnostic messages that report constructions that are not inherently erroneous but that are risky or suggest there may have been an...
Read more >
13.7.7.42 SHOW WARNINGS Statement
The SHOW COUNT(*) WARNINGS diagnostic statement displays the total number of errors, warnings, and notes. You can also retrieve this number from the ......
Read more >
-Werror is Not Your Friend - Embedded Artistry
-Werror is a compiler flag that causes all compiler warnings to be treated as errors. Developers who enable -Werror are making a statement: ......
Read more >
Compiler Warnings by compiler version | Microsoft Learn
This option only suppresses warnings, not new error messages. Don't suppress all new warnings permanently! We recommend you always compile ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found