From b84d2a9553a5f1f2c7c6b2b08f5e4c8f8d0b33ce Mon Sep 17 00:00:00 2001 From: Thomas Brouard Date: Mon, 23 May 2022 19:00:39 +0200 Subject: [PATCH] Move to ESLint --- .eslintrc.json | 31 +++++++++++++++++++++++++++++++ .jshintrc | 9 --------- src/index.js | 6 +++--- src/style.inline.css | 5 +---- 4 files changed, 35 insertions(+), 16 deletions(-) create mode 100644 .eslintrc.json delete mode 100644 .jshintrc diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..e5a20e9 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,31 @@ +{ + "env": { + "browser": true, + "es2021": true + }, + "extends": "eslint:recommended", + "parserOptions": { + "sourceType": "module", + "ecmaVersion": 12 + }, + "rules": { + "indent": [ + "error", + 2 + ], + "no-unused-vars": [ + "error", + { + "args": "none" + } + ], + "quotes": [ + "error", + "double" + ], + "semi": [ + "error", + "always" + ] + } +} diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 91f833d..0000000 --- a/.jshintrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "undef": true, - "unused": "vars", - "browser": true, - "node": true, - "eqnull": true, - "esnext": true, - "indent": 4 -} diff --git a/src/index.js b/src/index.js index 20f1815..bada450 100644 --- a/src/index.js +++ b/src/index.js @@ -223,9 +223,9 @@ class Tab extends EventTarget { if (badge) { span.innerHTML = badge; - span.classList.remove('hidden'); + span.classList.remove("hidden"); } else { - span.classList.add('hidden'); + span.classList.add("hidden"); } this.emit("badge-changed", badge, this); @@ -466,7 +466,7 @@ const TabPrivate = { /** * This makes the browser EventTarget API work similar to EventEmitter */ - const eventEmitterMixin = { +const eventEmitterMixin = { emit (type, ...args) { this.dispatchEvent(new CustomEvent(type, { detail: args })); }, diff --git a/src/style.inline.css b/src/style.inline.css index 666de47..ca1e0af 100644 --- a/src/style.inline.css +++ b/src/style.inline.css @@ -14,9 +14,6 @@ display: block; } -.etabs-tabs { -} - .etabs-tab { display: none; position: relative; @@ -44,7 +41,6 @@ .etabs-tab.visible { display: inline-block; - float: left; } .etabs-tab.active { @@ -144,6 +140,7 @@ webview { width: 100%; height: 100%; } + webview.visible { visibility: visible; }