diff options
| -rw-r--r-- | .eslintignore | 1 | ||||
| -rw-r--r-- | .eslintrc | 20 | ||||
| -rw-r--r-- | app/application.js | 2 | ||||
| -rw-r--r-- | app/components/forum_list/forum_list.svelte | 2 | ||||
| -rw-r--r-- | app/forum.svelte | 7 | ||||
| -rw-r--r-- | app/utils/glyph_hash.js | 2 | ||||
| -rw-r--r-- | package-lock.json | 6 | ||||
| -rw-r--r-- | package.json | 3 |
8 files changed, 32 insertions, 11 deletions
diff --git a/.eslintignore b/.eslintignore index 7e2f179..78f02ad 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,2 @@ assets +dist @@ -1,7 +1,24 @@ { + "parserOptions": { + "ecmaVersion": 2019, + "sourceType": "module" + }, + "env": { + "es6": true, + "browser": true + }, "extends": [ "@hapi/eslint-config-hapi" ], + "plugins": [ + "svelte3" + ], + "overrides": [ + { + "files": ["**/*.svelte"], + "processor": "svelte3/svelte3" + } + ], "rules": { "indent": [ 2, @@ -9,8 +26,5 @@ ], "no-undef": 2, "require-yield": 0 - }, - "parserOptions": { - "sourceType": "module" } } diff --git a/app/application.js b/app/application.js index f5012fd..6f44869 100644 --- a/app/application.js +++ b/app/application.js @@ -1,7 +1,5 @@ import Forum from './forum.svelte'; -/* global document */ - const forum = new Forum({ target: document.body, props: { diff --git a/app/components/forum_list/forum_list.svelte b/app/components/forum_list/forum_list.svelte index e49c8d8..f77c79a 100644 --- a/app/components/forum_list/forum_list.svelte +++ b/app/components/forum_list/forum_list.svelte @@ -1,5 +1,5 @@ <script> - import {forums, addForum} from '../../stores/forums.js' + import { forums } from '../../stores/forums.js'; </script> <nav title="List of Forums"> diff --git a/app/forum.svelte b/app/forum.svelte index 038f176..bb2513d 100644 --- a/app/forum.svelte +++ b/app/forum.svelte @@ -20,14 +20,15 @@ const setRoute = function setRoute(targetPage) { return function (routerParams) { + params = routerParams; page = targetPage; - } - } + }; + }; const router = new LightRouter({ routes: { - '': () => page = Home, + '': () => (page = Home) && true, 'f/{id}': setRoute(TopicIndex), 'g/{id}': setRoute(TopicIndex), 'a/{id}': setRoute(Author), diff --git a/app/utils/glyph_hash.js b/app/utils/glyph_hash.js index 2d9b3f3..120c02a 100644 --- a/app/utils/glyph_hash.js +++ b/app/utils/glyph_hash.js @@ -27,7 +27,7 @@ const getGlyphHashFragment = function (uuidFragment) { return { glyph: internals.kGlyphs[glyphIndex], color: `#${uuidFragment.substring(2,8)}` - } + }; }; // Return an array of glyphs based on a UUIDv4 diff --git a/package-lock.json b/package-lock.json index a418fc8..9336232 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3680,6 +3680,12 @@ "v8-compile-cache": "^2.0.3" } }, + "eslint-plugin-svelte3": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-svelte3/-/eslint-plugin-svelte3-2.7.3.tgz", + "integrity": "sha512-p6HhxyICX9x/x+8WSy6AVk2bmv9ayoznoTSyCvK47th/k/07ksuJixMwbGX9qxJVAmPBaYMjEIMSEZtJHPIN7w==", + "dev": true + }, "eslint-scope": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", diff --git a/package.json b/package.json index 704c540..8c047eb 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/forum", + "lint": "eslint --ext .svelte --ext .js .", "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", @@ -39,6 +39,7 @@ "@hapi/eslint-plugin-hapi": "^4.3.4", "@hapi/lab": "^21.0.0", "eslint": "^6.7.2", + "eslint-plugin-svelte3": "^2.7.3", "htmlhint": "^0.11.0", "jsdoc-to-markdown": "^5.0.3", "lab-markdown-reporter": "^1.0.2", |