Skip to content

Commit

Permalink
Ignore specific warnings/errors - even after new versions of JSHINT t…
Browse files Browse the repository at this point in the history
…hey still come up and can't be disabled: fix #298
  • Loading branch information
gfwilliams committed Jun 19, 2024
1 parent aae480b commit 69c8b42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion js/core/editorJavaScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
(function(){
var editors = [];
var id = 0; // auto-incrementing ID used for codeMirror elements
var defaultLintFlags = {
var defaultLintFlags = { // https://jshint.com/docs/options/
esversion : 6, // Enable ES6 for literals, arrow fns, binary
evil : true, // don't warn on use of strings in setInterval
laxbreak : true, // don't warn about newlines in expressions
Expand Down
3 changes: 3 additions & 0 deletions js/libs/codemirror/addon/lint/javascript-lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
for ( var i = 0; i < errors.length; i++) {
var error = errors[i];
if (error) {
if (error.a == 'nullish coalescing') continue; // ignore these warnings - we don't want to enable all ES11 just to disable this
if (error.code == "E054") continue; // Class properties must be methods (no way to ignore otherwise?) #298

if (error.line <= 0) {
if (window.console) {
window.console.warn("Cannot display JSHint error (invalid line " + error.line + ")", error);
Expand Down

0 comments on commit 69c8b42

Please sign in to comment.