mirror of https://github.com/espruino/BangleApps
fix lint warnings
parent
27f5579070
commit
bc8eecf998
|
@ -2,4 +2,5 @@ apps/animclk/V29.LBM.js
|
||||||
apps/banglerun/rollup.config.js
|
apps/banglerun/rollup.config.js
|
||||||
apps/schoolCalendar/fullcalendar/main.js
|
apps/schoolCalendar/fullcalendar/main.js
|
||||||
apps/authentiwatch/qr_packed.js
|
apps/authentiwatch/qr_packed.js
|
||||||
|
apps/qrcode/qr-scanner.umd.min.js
|
||||||
*.test.js
|
*.test.js
|
||||||
|
|
|
@ -353,13 +353,15 @@ const events = {
|
||||||
let c, p, i, l = from - o, h = to - o;
|
let c, p, i, l = from - o, h = to - o;
|
||||||
for (i = 0; (c = this.wall[i]).time < l; i++) ;
|
for (i = 0; (c = this.wall[i]).time < l; i++) ;
|
||||||
for (; (c = this.wall[i]).time < h; i++) {
|
for (; (c = this.wall[i]).time < h; i++) {
|
||||||
if ((p = c.time < t) ? c.past : c.future)
|
p = c.time < t;
|
||||||
|
if (p ? c.past : c.future)
|
||||||
result = Math.min(result, f(c, new Date(c.time + o), p));
|
result = Math.min(result, f(c, new Date(c.time + o), p));
|
||||||
}
|
}
|
||||||
l += o; h += o; t += o;
|
l += o; h += o; t += o;
|
||||||
for (i = 0; (c = this.fixed[i]).time < l; i++) ;
|
for (i = 0; (c = this.fixed[i]).time < l; i++) ;
|
||||||
for (; (c = this.fixed[i]).time < h; i++) {
|
for (; (c = this.fixed[i]).time < h; i++) {
|
||||||
if ((p = c.time < t) ? c.past : c.future)
|
p = c.time < t;
|
||||||
|
if (p ? c.past : c.future)
|
||||||
result = Math.min(f(c, new Date(c.time), p));
|
result = Math.min(f(c, new Date(c.time), p));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -60,7 +60,8 @@ const prepFont = (name, data) => {
|
||||||
let width = m[2] == '*' ? null : +m[2];
|
let width = m[2] == '*' ? null : +m[2];
|
||||||
let c = null, o = 0;
|
let c = null, o = 0;
|
||||||
lines.forEach((line, l) => {
|
lines.forEach((line, l) => {
|
||||||
if (m = /^(<*)(=)([*\d]*)(=*)(>*)$/.exec(line) || /^(<*)(-)(.)(-*)(>*)$/.exec(line)) {
|
m = /^(<*)(=)([*\d]*)(=*)(>*)$/.exec(line) || /^(<*)(-)(.)(-*)(>*)$/.exec(line);
|
||||||
|
if (m) {
|
||||||
const h = m[2] == '=';
|
const h = m[2] == '=';
|
||||||
if (m[1].length > desc || h && m[1].length != desc)
|
if (m[1].length > desc || h && m[1].length != desc)
|
||||||
throw new Error('Invalid descender height at ' + l);
|
throw new Error('Invalid descender height at ' + l);
|
||||||
|
|
|
@ -60,7 +60,8 @@ const prepFont = (name, data) => {
|
||||||
let width = m[2] == '*' ? null : +m[2];
|
let width = m[2] == '*' ? null : +m[2];
|
||||||
let c = null, o = 0;
|
let c = null, o = 0;
|
||||||
lines.forEach((line, l) => {
|
lines.forEach((line, l) => {
|
||||||
if (m = /^(<*)(=)([*\d]*)(=*)(>*)$/.exec(line) || /^(<*)(-)(.)(-*)(>*)$/.exec(line)) {
|
m = /^(<*)(=)([*\d]*)(=*)(>*)$/.exec(line) || /^(<*)(-)(.)(-*)(>*)$/.exec(line);
|
||||||
|
if (m) {
|
||||||
const h = m[2] == '=';
|
const h = m[2] == '=';
|
||||||
if (m[1].length > desc || h && m[1].length != desc)
|
if (m[1].length > desc || h && m[1].length != desc)
|
||||||
throw new Error('Invalid descender height at ' + l);
|
throw new Error('Invalid descender height at ' + l);
|
||||||
|
|
|
@ -179,7 +179,8 @@ var buf = Graphics.createArrayBuffer(240,160,2,{msb:true});
|
||||||
let LED = // LED as minimal and only definition (as instance / singleton)
|
let LED = // LED as minimal and only definition (as instance / singleton)
|
||||||
{ isOn: false // status on / off, not needed if you don't need to ask for it
|
{ isOn: false // status on / off, not needed if you don't need to ask for it
|
||||||
, set: function(v) { // turn on w/ no arg or truey, else off
|
, set: function(v) { // turn on w/ no arg or truey, else off
|
||||||
g.setColor((this.isOn=(v===undefined||!!v))?1:0,0,0).fillCircle(120,10,10); }
|
this.isOn = v===undefined||!!v;
|
||||||
|
g.setColor(this.isOn?1:0,0,0).fillCircle(120,10,10); }
|
||||||
, reset: function() { this.set(false); } // turn off
|
, reset: function() { this.set(false); } // turn off
|
||||||
, write: function(v) { this.set(v); } // turn on w/ no arg or truey, else off
|
, write: function(v) { this.set(v); } // turn on w/ no arg or truey, else off
|
||||||
, toggle: function() { this.set( ! this.isOn); } // toggle the LED
|
, toggle: function() { this.set( ! this.isOn); } // toggle the LED
|
||||||
|
|
|
@ -71,7 +71,6 @@ function chooseIconByCode(code) {
|
||||||
case 801: return partSunIcon;
|
case 801: return partSunIcon;
|
||||||
default: return cloudIcon;
|
default: return cloudIcon;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
default: return cloudIcon;
|
default: return cloudIcon;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue