--strict for counting warnings as errors
See original GitHub issueSoliciting 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 runeslint --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:
- Created 8 years ago
- Comments:16 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
--max-warnings
can serve this purpose:--max-warnings=0
means that any warnings cause eslint to report an error.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.