From bcb380c97006b5dbe28ae7f241bcb32d51190d62 Mon Sep 17 00:00:00 2001 From: Jason Dekarske Date: Fri, 6 May 2022 12:58:10 -0700 Subject: [PATCH 1/3] bump eslint version add airbnb config add suggested package.json attrs --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index 32c96e3ea..8aa50c9a3 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,8 @@ "description": "Bangle.js App Loader (and Apps)", "author": "Gordon Williams (http://espruino.com)", "version": "0.0.1", + "license": "MIT", + "repository": "https://github.com/espruino/BangleApps", "devDependencies": { "eslint": "7.1.0" }, From 4c4cf0ddf77a0ba90ace989e5637a681ec743ebd Mon Sep 17 00:00:00 2001 From: Jason Dekarske Date: Fri, 6 May 2022 12:58:28 -0700 Subject: [PATCH 2/3] fix some non-conformers --- apps/pie/app.js | 2 +- apps/scribble/app.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/pie/app.js b/apps/pie/app.js index 69b67d3bd..74f4b4575 100644 --- a/apps/pie/app.js +++ b/apps/pie/app.js @@ -11,7 +11,7 @@ function scrollX(){ gfx.clearRect(0,gfx.getHeight()*(1/4),gfx.getWidth(),0); gfx.scroll(0,gfx.getHeight()/4); score++; - if(typeof(m) != undefined && score>0){ + if(typeof m !== 'undefined' && score>0){ clearInterval(m); m = setInterval(scrollY,Math.abs(100/score+15-0.1*score));} gfx.setColor(1,1,1); diff --git a/apps/scribble/app.js b/apps/scribble/app.js index 99ee3f717..319a02d2c 100644 --- a/apps/scribble/app.js +++ b/apps/scribble/app.js @@ -368,8 +368,8 @@ class TextBox { // x and y are the center points this.x = x; this.y = y; - this.text = (typeof text !== undefined) ? text : "Default"; - this.col = (typeof col !== undefined) ? col : red; + this.text = text || "Default"; + this.col = col || red; // console.log(`Constr TextBox ${this.text} -> Center: (${this.x}, ${this.y}) | Col ${this.col}`); } From 9737014a5fb4581d57965088db83623f80700cf6 Mon Sep 17 00:00:00 2001 From: Jason Dekarske Date: Fri, 6 May 2022 12:58:56 -0700 Subject: [PATCH 3/3] actually add eslint --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 8aa50c9a3..e11e79ae5 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,10 @@ "license": "MIT", "repository": "https://github.com/espruino/BangleApps", "devDependencies": { - "eslint": "7.1.0" + "eslint": "^8.14.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-plugin-import": "^2.26.0", + "npm-watch": "^0.11.0" }, "scripts": { "lint-apps": "eslint ./apps --ext .js", @@ -20,8 +23,5 @@ }, "dependencies": { "acorn": "^7.2.0" - }, - "devDpendencies": { - "npm-watch": "^0.11.0" } }