From 6ba80cf30688b8b2a8e2205efbded00321adc537 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Fri, 15 Dec 2023 19:01:17 +0000 Subject: [PATCH] Enable and fix eslint for all packages --- .eslintrc.js | 3 +++ examples/appendix/static/custom.js | 1 + js/packages/binderhub-client/lib/index.js | 2 +- package.json | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 78b7288cb..6ebd4e25b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,9 +2,12 @@ module.exports = { env: { browser: true, jquery: true, + node: true, + es6: true, "jest/globals": true, }, extends: ["eslint:recommended"], + ignorePatterns: ["**/dist"], parser: "@babel/eslint-parser", plugins: ["jest"], rules: {}, diff --git a/examples/appendix/static/custom.js b/examples/appendix/static/custom.js index 8b62e0f7a..8536441a3 100644 --- a/examples/appendix/static/custom.js +++ b/examples/appendix/static/custom.js @@ -1,3 +1,4 @@ +// eslint-disable-next-line no-unused-vars function copy_link_into_clipboard(b) { var $temp = $(""); $(b).parent().append($temp); diff --git a/js/packages/binderhub-client/lib/index.js b/js/packages/binderhub-client/lib/index.js index 9f602494c..9401eea7f 100644 --- a/js/packages/binderhub-client/lib/index.js +++ b/js/packages/binderhub-client/lib/index.js @@ -70,7 +70,7 @@ export class BinderRepository { this.eventSource = new EventSource(this.buildUrl); return new EventIterator((queue) => { this.eventIteratorQueue = queue; - this.eventSource.onerror = (err) => { + this.eventSource.onerror = () => { queue.push({ phase: "failed", message: "Failed to connect to event stream\n", diff --git a/package.json b/package.json index 7a2fb479e..e08b94bbc 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "scripts": { "webpack": "webpack", "webpack:watch": "webpack --watch", - "lint": "eslint binderhub/static/js", + "lint": "eslint .", "test": "jest" }, "jest": {