From: Ben Beltran Date: Sat, 15 Feb 2020 22:03:37 +0000 (+0100) Subject: Fix linter and linteer warnings X-Git-Url: https://git.r.bdr.sh/rbdr/forum/commitdiff_plain/41247723b2940efe89648749b90e56d582bdfb89?ds=sidebyside;hp=24be7b5399ae4162702ad9a1f17b5711922a2da4 Fix linter and linteer warnings --- diff --git a/.eslintrc b/.eslintrc index 68bd8d3..bd7f885 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,6 +1,6 @@ { "extends": [ - "eslint-config-hapi" + "@hapi/eslint-config-hapi" ], "rules": { "indent": [ diff --git a/app/application.js b/app/application.js index 6f44869..f5012fd 100644 --- a/app/application.js +++ b/app/application.js @@ -1,5 +1,7 @@ import Forum from './forum.svelte'; +/* global document */ + const forum = new Forum({ target: document.body, props: { diff --git a/app/stores/forums.js b/app/stores/forums.js index adc8758..c473124 100644 --- a/app/stores/forums.js +++ b/app/stores/forums.js @@ -72,10 +72,11 @@ internals.forums = [ export const forums = writable(internals.forums); -export function addForum() { +export const addForum = function addForum() { + const id = Math.random(); - forums.update((forums) => ([...forums, + forums.update((originalForums) => ([...originalForums, { id, glyph: 'の', diff --git a/app/utils/glyph_hash.js b/app/utils/glyph_hash.js index c074376..2d9b3f3 100644 --- a/app/utils/glyph_hash.js +++ b/app/utils/glyph_hash.js @@ -1,22 +1,22 @@ const internals = { kSplitterRegex: /.{1,8}/g, kGlyphs: [ - "☽", - "☆", - "♢", - "♡", - "╱", - "╲", - "╳", - "〰", - "▷", - "⏊", - "〒", - "▢", - "◯", - "⏃", - "⏀", - "⏆" + '☽', + '☆', + '♢', + '♡', + '╱', + '╲', + '╳', + '〰', + '▷', + '⏊', + '〒', + '▢', + '◯', + '⏃', + '⏀', + '⏆' ] }; diff --git a/lib/forum.js b/lib/forum.js index d095e47..f09e8dd 100644 --- a/lib/forum.js +++ b/lib/forum.js @@ -85,4 +85,4 @@ export default class Forum { console.log(' ^+---------+'); console.log(' (.) '); } -}; +} diff --git a/package.json b/package.json index bd75030..704c540 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "scripts": { "build": "parcel build --no-source-maps ./app/index.html", "document": "jsdoc2md > doc/README.md", - "lint": "eslint lib app bin", + "lint": "eslint lib app bin/forum", "linthtml": "htmlhint", "setup-hooks": "ln -s ../../scripts/git-hooks/pre-commit .git/hooks/pre-commit", "test": "lab -r lab-markdown-reporter -o doc/COVERAGE.md -r console -o stdout -c --coverage-path lib -L -t 100 test",