Skip to content

Commit 46a6f7f

Browse files
authored
refactor: corrected some aspects out of eslint feedback (pattern-lab#1399)
* refactor: fixed 'warning 'data' is assigned a value but never used no-unused-vars' its usage has been removed with pattern-lab@70fe9b6#diff-75bedd8b06cebb50236c7c659b539b0fa984746f8abb3d7a5dc6a92b3763fcc0 * refactor: fixed "warning 'event' is defined but never used no-unused-vars" * refactor: fixed "warning 'NodePart' is defined but never used no-unused-vars" This isn't in use anymore since commit pattern-lab@2ff8e1c#diff-b26f09ed0fc0febb6d869ff60e410d9d8efd300b4b6c2facbf668cd4555e27a2L39 * refactor: fixed "warning 'customElement' is defined but never used no-unused-vars" * refactor: fixed "warning 'previousValues' is assigned a value but never used no-unused-vars" as its usage hasn't been in use since commit pattern-lab@2ff8e1c#diff-b26f09ed0fc0febb6d869ff60e410d9d8efd300b4b6c2facbf668cd4555e27a2R45 * refactor: fixed "error Method 'slotify' expected a return value consistent-return" * refactor: fixed "warning 'unsafeCSS' is defined but never used no-unused-vars" and css and svg as well * refactor: fixed "warning 'event' is defined but never used no-unused-vars" * refactor: fixed "warning 'event' is defined but never used no-unused-vars" and filePath as well * refactor: fixed "warning 'pm' is assigned a value but never used no-unused-vars" as its usage has been removed with commit pattern-lab@deb4783#diff-25426a917b53575c0f0efc5674ee70c4d2c8671f9ade4f9d994db43c9552302bL217 * refactor: fixed "warning 'options' is defined but never used no-unused-vars" * chore: removing the previously out-commented parts
1 parent fad9a9f commit 46a6f7f

File tree

7 files changed

+7
-18
lines changed

7 files changed

+7
-18
lines changed

packages/uikit-workshop/build/webpack-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ async function serve(patternlab, configPath, buildDir = 'public') {
3939
const filesToWatch = [
4040
{
4141
match: [`${process.cwd()}/patternlab-config.json`],
42-
fn: async function (event, filePath) {
42+
fn: async function () {
4343
// when the main PL config changes, clear Node's cache (so the JSON config is re-read) and trigger another PL build
4444
// this allows config changes to show up without restarting the build!
4545
Object.keys(require.cache).forEach(function (key) {

packages/uikit-workshop/src/scripts/components/panels.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const Panels = {
4646
},
4747
};
4848

49-
function init(event) {
49+
function init() {
5050
// does the origin sending the message match the current host? if not dev/null the request
5151

5252
const fileSuffixPattern =

packages/uikit-workshop/src/scripts/lit-components/pl-icon/pl-icon.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
import {
2-
html,
3-
LitElement,
4-
unsafeCSS,
5-
css,
6-
svg,
7-
customElement,
8-
} from 'lit-element';
1+
import { html, LitElement, customElement } from 'lit-element';
92
import styles from './pl-icon.scss?external';
103
import { unsafeHTML } from 'lit-html/directives/unsafe-html';
114
const icons = {};

packages/uikit-workshop/src/scripts/lit-components/pl-icon/unsafe-svg.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import { reparentNodes } from 'lit-html/lib/dom.js';
1616
// import { isPrimitive } from 'lit-html/lib/parts.js';
17-
import { directive, NodePart } from 'lit-html/lit-html.js';
17+
import { directive } from 'lit-html/lit-html.js';
1818
import importNode from '@ungap/import-node';
1919
// document.importNode = importNode;
2020

@@ -28,7 +28,6 @@ import importNode from '@ungap/import-node';
2828
// The DocumentFragment is used as a unique key to check if the last value
2929
// rendered to the part was with unsafeSVG. If not, we'll always re-render the
3030
// value passed to unsafeSVG.
31-
const previousValues = new WeakMap();
3231

3332
/**
3433
* Renders the result as SVG, rather than text.

packages/uikit-workshop/src/scripts/lit-components/pl-tooltip/pl-tooltip.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { LitElement, html, customElement } from 'lit-element';
1+
import { LitElement, html } from 'lit-element';
22
import styles from './pl-tooltip.scss?external';
33
import { Slotify } from '../slotify';
44

packages/uikit-workshop/src/scripts/lit-components/slotify.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export const Slotify = (Base) =>
7171
} else if (defaultContent) {
7272
return defaultContent;
7373
} else {
74+
// eslint-disable-next-line consistent-return
7475
return;
7576
}
7677
}

packages/uikit-workshop/src/scripts/utils/url-handler.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,6 @@ export const urlHandler = {
155155
* @param {String} the path given by the loaded iframe
156156
*/
157157
pushPattern(pattern, givenPath) {
158-
const data = {
159-
pattern,
160-
};
161-
162158
const fileName = urlHandler.getFileName(pattern);
163159
let path = window.location.pathname;
164160
path =
@@ -216,6 +212,6 @@ export const urlHandler = {
216212
/**
217213
* handle the onpopstate event
218214
*/
219-
window.onpopstate = function (event) {
215+
window.onpopstate = function () {
220216
urlHandler.skipBack = true;
221217
};

0 commit comments

Comments
 (0)