From 4232da5e33208b4d763406b08ea0d010f01f7682 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Mon, 19 Aug 2019 19:08:59 -0700 Subject: [PATCH] fix: fix lint --- bin/build-assets.js | 2 +- bin/build-now-json.js | 4 ++-- bin/run-mastodon.js | 2 +- src/routes/_actions/addInstance.js | 2 +- src/routes/_actions/share.js | 2 +- src/routes/_components/AccountsListPage.html | 2 +- src/routes/_components/AutoplayVideo.html | 2 +- src/routes/_components/Avatar.html | 4 ++-- src/routes/_components/DynamicPageBanner.html | 2 +- src/routes/_components/ExternalLink.html | 2 +- src/routes/_components/IconButton.html | 8 ++++---- src/routes/_components/Label.html | 4 ++-- src/routes/_components/LazyImage.html | 10 +++++----- src/routes/_components/NonAutoplayGifv.html | 2 +- .../_components/NotificationFilters.html | 4 ++-- src/routes/_components/PlayVideoIcon.html | 2 +- .../compose/ComposeAutosuggest.html | 6 ++++-- .../_components/compose/ComposeBox.html | 4 ++-- .../_components/compose/ComposeInput.html | 15 +++++++++----- .../dialog/components/ComposeDialog.html | 2 +- .../dialog/components/ConfirmationDialog.html | 8 ++++---- .../dialog/components/EmojiDialog.html | 2 +- .../components/GenericConfirmationDialog.html | 4 ++-- .../dialog/components/ModalDialog.html | 4 ++-- .../dialog/components/ReportDialog.html | 6 +++--- .../components/StatusOptionsDialog.html | 2 +- .../components/TextConfirmationDialog.html | 6 +++--- src/routes/_components/list/ListLazyItem.html | 4 ++-- .../profile/AccountProfileFollow.html | 2 +- .../search/AccountSearchResult.html | 4 ++-- .../_components/settings/SettingsList.html | 4 ++-- .../settings/SettingsListButton.html | 4 ++-- .../_components/settings/SettingsListRow.html | 4 ++-- .../shortcut/ScrollListShortcuts.html | 6 ++++-- src/routes/_components/shortcut/Shortcut.html | 6 ++++-- src/routes/_components/status/Media.html | 2 +- src/routes/_components/status/Status.html | 16 +++++++++------ .../_components/status/StatusDetails.html | 4 ++-- src/routes/_components/timeline/Timeline.html | 6 +++--- .../virtualList/VirtualListLazyItem.html | 4 ++-- src/routes/_pages/lists/[listId].html | 2 +- .../computations/timelineComputations.js | 4 ++-- .../createAutosuggestAccessibleLabel.js | 2 +- src/routes/_utils/scrollIntoView.js | 3 ++- src/routes/_utils/timelineItemToSummary.js | 6 +++--- src/server/sapperInlineScriptChecksums.js | 8 ++++---- src/service-worker.js | 6 ++++-- tests/spec/110-compose-content-warnings.js | 4 ++-- tests/spec/118-display-name-custom-emoji.js | 2 +- tests/unit/test-database.js | 2 +- tests/unit/test-emoji.js | 20 +++++++++---------- tests/unit/test-shortcuts.js | 3 ++- tests/utils.js | 4 ++-- 53 files changed, 132 insertions(+), 113 deletions(-) diff --git a/bin/build-assets.js b/bin/build-assets.js index 893a8b3d..c3cf8c87 100644 --- a/bin/build-assets.js +++ b/bin/build-assets.js @@ -9,7 +9,7 @@ const copyFile = promisify(fs.copyFile) async function compileThirdPartyCss () { let css = await readFile(path.resolve(__dirname, '../node_modules/emoji-mart/css/emoji-mart.css'), 'utf8') - css = `/* compiled from emoji-mart.css */` + new CleanCSS().minify(css).styles + css = '/* compiled from emoji-mart.css */' + new CleanCSS().minify(css).styles await writeFile(path.resolve(__dirname, '../static/emoji-mart.css'), css, 'utf8') } diff --git a/bin/build-now-json.js b/bin/build-now-json.js index 0a05b3c7..367ea822 100644 --- a/bin/build-now-json.js +++ b/bin/build-now-json.js @@ -57,9 +57,9 @@ const JSON_TEMPLATE = { const HTML_HEADERS = { 'cache-control': 'public,max-age=3600', - 'content-security-policy': `script-src 'self' ` + + 'content-security-policy': 'script-src \'self\' ' + `${[inlineScriptChecksum].concat(sapperInlineScriptChecksums).map(_ => `'sha256-${_}'`).join(' ')}; ` + - `worker-src 'self'; style-src 'self' 'unsafe-inline'; frame-src 'none'; object-src 'none'; manifest-src 'self'`, + 'worker-src \'self\'; style-src \'self\' \'unsafe-inline\'; frame-src \'none\'; object-src \'none\'; manifest-src \'self\'', 'referrer-policy': 'no-referrer', 'strict-transport-security': 'max-age=15552000; includeSubDomains', 'x-content-type-options': 'nosniff', diff --git a/bin/run-mastodon.js b/bin/run-mastodon.js index 1f1cb7fb..66a9b1d4 100644 --- a/bin/run-mastodon.js +++ b/bin/run-mastodon.js @@ -44,7 +44,7 @@ async function cloneMastodon () { } catch (e) { console.log('Cloning mastodon...') await exec(`git clone --single-branch --branch ${GIT_BRANCH} ${GIT_URL} "${mastodonDir}"`) - await exec(`git fetch origin --tags`, { cwd: mastodonDir }) // may already be cloned, e.g. in CI + await exec('git fetch origin --tags', { cwd: mastodonDir }) // may already be cloned, e.g. in CI await exec(`git checkout ${GIT_TAG_OR_COMMIT}`, { cwd: mastodonDir }) await writeFile(path.join(dir, '../mastodon/.env'), envFile, 'utf8') } diff --git a/src/routes/_actions/addInstance.js b/src/routes/_actions/addInstance.js index b6e43995..91ff58ae 100644 --- a/src/routes/_actions/addInstance.js +++ b/src/routes/_actions/addInstance.js @@ -57,7 +57,7 @@ export async function logInToInstance () { (err.knownError ? '' : (navigator.onLine ? `Is this a valid Mastodon instance? Is a browser extension blocking the request? Are you in private browsing mode?` - : `Are you offline?`)) + : 'Are you offline?')) const { instanceNameInSearch } = store.get() store.set({ logInToInstanceError: error, diff --git a/src/routes/_actions/share.js b/src/routes/_actions/share.js index dddf68d3..e60f8ba1 100644 --- a/src/routes/_actions/share.js +++ b/src/routes/_actions/share.js @@ -9,6 +9,6 @@ export async function shareStatus (status) { url: status.url }) } catch (e) { - toast.say(`Unable to share: ` + (e.message || '')) + toast.say('Unable to share: ' + (e.message || '')) } } diff --git a/src/routes/_components/AccountsListPage.html b/src/routes/_components/AccountsListPage.html index 56530660..e70d1dbb 100644 --- a/src/routes/_components/AccountsListPage.html +++ b/src/routes/_components/AccountsListPage.html @@ -52,7 +52,7 @@ data: () => ({ loading: true, accounts: [], - accountActions: void 0 + accountActions: undefined }), store: () => store, components: { diff --git a/src/routes/_components/AutoplayVideo.html b/src/routes/_components/AutoplayVideo.html index 14fb6a77..d119c684 100644 --- a/src/routes/_components/AutoplayVideo.html +++ b/src/routes/_components/AutoplayVideo.html @@ -44,7 +44,7 @@ export default { data: () => ({ - focus: void 0 + focus: undefined }), store: () => store, computed: { diff --git a/src/routes/_components/Avatar.html b/src/routes/_components/Avatar.html index 6e68562e..efd9421f 100644 --- a/src/routes/_components/Avatar.html +++ b/src/routes/_components/Avatar.html @@ -48,9 +48,9 @@ export default { data: () => ({ - className: void 0, + className: undefined, loaded: false, - error: void 0, + error: undefined, isLink: false, size: 'medium' }), diff --git a/src/routes/_components/DynamicPageBanner.html b/src/routes/_components/DynamicPageBanner.html index d9575674..df111f55 100644 --- a/src/routes/_components/DynamicPageBanner.html +++ b/src/routes/_components/DynamicPageBanner.html @@ -66,7 +66,7 @@ export default { data: () => ({ - icon: void 0, + icon: undefined, ariaTitle: '' }), components: { diff --git a/src/routes/_components/ExternalLink.html b/src/routes/_components/ExternalLink.html index 74216400..e126d9ad 100644 --- a/src/routes/_components/ExternalLink.html +++ b/src/routes/_components/ExternalLink.html @@ -27,7 +27,7 @@ export default { data: () => ({ - className: void 0, + className: undefined, normalIconColor: false, ariaLabel: '', showIcon: false diff --git a/src/routes/_components/IconButton.html b/src/routes/_components/IconButton.html index f4ce3c6b..2a37614d 100644 --- a/src/routes/_components/IconButton.html +++ b/src/routes/_components/IconButton.html @@ -1,7 +1,7 @@