Skip to content

Commit fab74b8

Browse files
Disable "no-console" linting for specific console.warns
These all are exceptional cases of warnings where the warning is far more important than adhering to a style guide on lints, even if some of them might potentially show up in the browser. Each is a hand-picked exception, so these use in-file comment overrides. Rationales are included in preceding comments.
1 parent 44cb70c commit fab74b8

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

src/javascript/lib/core.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ function get_global() {
2727
return global;
2828
}
2929

30+
/* As long as the window check precedes this, it won't display in a browser,
31+
unless the ground cracks open and swallows JavaScript whole. */
32+
/* eslint-disable no-console */
3033
console.warn('No global state found');
34+
/* eslint-enable no-console */
35+
3136
return null;
3237
}
3338

src/javascript/lib/core/erlang_compat/elixir_errors.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
/* It is far too "meta" to warn about including a warning in a warning */
2+
/* eslint-disable no-console */
3+
14
function warn(message) {
25
const messageString = message.join('');
36
console.warn(`warning: ${messageString}`);
47

8+
59
return Symbol.for('ok');
610
}
711

src/javascript/lib/core/erlang_compat/io.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* The purpose of this module is, in fact, to do IO. */
2+
/* eslint-disable no-console */
13
import erlang from './erlang';
24

35
function put_chars(ioDevice, charData) {

src/javascript/lib/core/special_forms.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,10 @@ function _with(...args) {
138138
}
139139

140140
function receive(clauses, timeout = 0, timeoutFn = () => true) {
141+
/* It's more important to warn developers than follow style guides */
142+
/* eslint-disable no-console */
141143
console.warn('Receive not supported');
144+
/* eslint-enable no-console */
142145

143146
const messages = []; // this.mailbox.get();
144147
const NOMATCH = Symbol('NOMATCH');

0 commit comments

Comments
 (0)