Enforce and fix typescript lints

pull/3390/head
Anton 2024-04-29 18:20:17 +02:00
parent d2b1487315
commit 5630b85918
8 changed files with 14 additions and 35 deletions

View File

@ -4,15 +4,3 @@ apps/gipy/pkg/gps.js
# Needs to be ignored because it includes broken JS
apps/health/chart.min.js
# TypeScript
apps/btadv/
apps/clkinfostopw/
apps/ctrlpad/
apps/drained/
apps/folderlaunch/
apps/popconlaunch/
apps/rep/
apps/widChargingStatus/
apps/widbtstates/
apps/widhid/

View File

@ -126,8 +126,9 @@
{
text: "DnD",
cb: function (tap) {
var on;
if (on = !!origBuzz) {
var on = false;
if (origBuzz) {
on = true;
if (tap) {
Bangle.buzz = origBuzz;
origBuzz = undefined;

View File

@ -193,8 +193,9 @@
{
text: "DnD",
cb: tap => {
let on;
if(on = !!origBuzz){
let on = false;
if(origBuzz){
on = true;
if(tap){
Bangle.buzz = origBuzz;
origBuzz = undefined;

View File

@ -1,6 +1,7 @@
var app = "drained";
if (typeof drainedInterval !== "undefined")
drainedInterval = clearInterval(drainedInterval);
var globals = global;
if (typeof globals.drainedInterval !== "undefined")
globals.drainedInterval = clearInterval(globals.drainedInterval);
Bangle.setLCDBrightness(0);
var powerNoop = function () { return false; };
var forceOff = function (name) {

View File

@ -1,9 +1,9 @@
const app = "drained";
// from boot.js
declare var drainedInterval: IntervalId | undefined;
if(typeof drainedInterval !== "undefined")
drainedInterval = clearInterval(drainedInterval) as undefined;
const globals: { drainedInterval: IntervalId | undefined } = global as any;
if(typeof globals.drainedInterval !== "undefined")
globals.drainedInterval = clearInterval(globals.drainedInterval) as undefined;
// backlight
Bangle.setLCDBrightness(0);

View File

@ -1,6 +1,6 @@
(function () {
var _a = require("Storage").readJSON("drained.setting.json", true) || {}, _b = _a.battery, threshold = _b === void 0 ? 5 : _b, _c = _a.interval, interval = _c === void 0 ? 10 : _c, _d = _a.keepStartup, keepStartup = _d === void 0 ? true : _d;
drainedInterval = setInterval(function () {
global.drainedInterval = setInterval(function () {
if (Bangle.isCharging())
return;
if (E.getBattery() > threshold)

View File

@ -2,7 +2,7 @@
const { battery: threshold = 5, interval = 10, keepStartup = true }: DrainedSettings
= require("Storage").readJSON(`drained.setting.json`, true) || {};
drainedInterval = setInterval(() => {
(global as any).drainedInterval = setInterval(() => {
if(Bangle.isCharging())
return;
if(E.getBattery() > threshold)

View File

@ -1137,18 +1137,6 @@ module.exports = {
"no-undef"
]
},
"drained/boot.js": {
"hash": "914ea2c47aa6b9502b9dd354d490b2a8b838d4c6fafaa20e206f1f2396d4db40",
"rules": [
"no-undef"
]
},
"drained/app.js": {
"hash": "2b609ca5bf414b0e400e25512bf396a01f8cb0365b4edd02ea1697b51907d36c",
"rules": [
"no-undef"
]
},
"dinoClock/app.js": {
"hash": "e97566aa4f586ef654e3fc1ec286376352762ed8e0ea2e685a7b3ae687f51552",
"rules": [