Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit e7736aa

Browse files
Refactor with linter to appease StandardJS
1 parent 432b186 commit e7736aa

File tree

10 files changed

+18
-18
lines changed

10 files changed

+18
-18
lines changed

lib/context-menu-and-spellcheck.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function setupContextMenuAndSpellCheck (config, { navigate, get }) {
8888

8989
if (ref.isBlob(extractedRef) && menuInfo.hasImageContents) {
9090
const copyEmbed = new MenuItem({
91-
label: `Copy Embed Markdown`,
91+
label: 'Copy Embed Markdown',
9292
click: () => {
9393
// Omit the mailto: portion of the link; we just want the address
9494
clipboard.writeText(`![${menuInfo.titleText}](${extractedRef})`)

lib/depject/message/html/layout/default.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ exports.create = function (api) {
7676

7777
let cw = msg.value.content.contentWarning
7878
if (typeof cw !== 'string' || cw.length === 0) {
79-
cw = undefined;
79+
cw = undefined
8080
} else {
8181
// TODO: emoji shortcodes?
8282
// TODO: truncate very long content warning, maybe use max-height?
83-
classList.push('-hasContentWarning');
83+
classList.push('-hasContentWarning')
8484
}
8585

8686
return h('div', {
@@ -92,9 +92,9 @@ exports.create = function (api) {
9292
? h('a.contentWarning',
9393
{
9494
href: '#',
95-
'ev-click': toggleAndTrack(expanded),
95+
'ev-click': toggleAndTrack(expanded)
9696
},
97-
cw,
97+
cw
9898
)
9999
: undefined,
100100
h('section.content', {

lib/depject/message/html/markdown.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ exports.create = function (api) {
6060
if (link && ref.isBlob(link.link)) {
6161
const url = api.blob.sync.url(link.link)
6262
const query = {}
63-
if (link.query && link.query.unbox) query['unbox'] = link.query.unbox
64-
if (typeLookup[link.link]) query['contentType'] = typeLookup[link.link]
63+
if (link.query && link.query.unbox) query.unbox = link.query.unbox
64+
if (typeLookup[link.link]) query.contentType = typeLookup[link.link]
6565
return url + '?' + querystring.stringify(query)
6666
} else if (link || id.startsWith('#') || id.startsWith('?')) {
6767
return id

lib/depject/message/html/missing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ exports.create = function (api) {
4545
])
4646
]),
4747
h('section', [
48-
h('p', [i18n(`The author of this message could be outside of your follow range or they may be blocked.`)])
48+
h('p', [i18n('The author of this message could be outside of your follow range or they may be blocked.')])
4949
])
5050
])
5151

lib/depject/message/html/render/attending.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ exports.create = function (api) {
2222
render: function about (msg, opts) {
2323
if (!isRenderable(msg)) return
2424

25-
const action = msg.value.content.attendee.remove ? `can't attend` : 'is attending'
25+
const action = msg.value.content.attendee.remove ? 'can\'t attend' : 'is attending'
2626
const target = msg.value.content.about
2727
const title = api.about.obs.latestValue(target, 'title')
2828
const element = api.message.html.layout(msg, extend({

lib/depject/message/html/render/gathering.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ exports.create = function (api) {
9191
h('button -attend', {
9292
disabled: computed([attending, disableActions], (...args) => args.some(Boolean)),
9393
'ev-click': send(publishAttending, msg)
94-
}, `Attending`),
94+
}, 'Attending'),
9595
h('button -attend', {
9696
disabled: disableActions,
9797
'ev-click': send(publishNotAttending, msg)
98-
}, `Can't Attend`)
98+
}, 'Can\'t Attend')
9999
])
100100
]),
101101
h('div.location', markdown(about.location)),

lib/depject/page/html/render/profile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,11 @@ exports.create = function (api) {
179179

180180
when(contact.noIncoming,
181181
h('section -distanceWarning', [
182-
h('h1', i18n(`You don't follow anyone who follows this person`)),
182+
h('h1', i18n('You don\'t follow anyone who follows this person')),
183183
h('p', i18n('You might not be seeing their latest messages. You could try joining a pub that they are a member of.')),
184184
when(contact.hasOutgoing,
185185
h('p', i18n('However, since they follow someone that follows you, they should be able to see your posts.')),
186-
h('p', i18n(`They might not be able to see your posts either.`))
186+
h('p', i18n('They might not be able to see your posts either.'))
187187
)
188188
]),
189189
when(contact.noOutgoing,

lib/depject/profile/html/preview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ exports.create = function (api) {
6666
]),
6767
when(contact.noIncoming,
6868
h('section -distanceWarning', [
69-
'⚠️ ', i18n(`You don't follow anyone who follows this person`)
69+
'⚠️ ', i18n('You don\'t follow anyone who follows this person')
7070
]),
7171
when(contact.mutualFriendsCount,
7272
h('section -mutualFriends', [

lib/main-window.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ module.exports = function (config) {
157157
document.head.appendChild(
158158
h('style', {
159159
innerHTML: computed(api.settings.obs.get('patchwork.theme', 'light'), themeName => {
160-
return themes[themeName] || themes['light']
160+
return themes[themeName] || themes.light
161161
})
162162
})
163163
)
@@ -170,7 +170,7 @@ module.exports = function (config) {
170170
dark: 'monokai'
171171
}
172172

173-
const syntaxTheme = syntaxThemeOptions[themeName] || syntaxThemeOptions['light']
173+
const syntaxTheme = syntaxThemeOptions[themeName] || syntaxThemeOptions.light
174174
return requireStyle(`highlight.js/styles/${syntaxTheme}.css`)
175175
})
176176
})

lib/plugins/profile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ exports.init = function (ssb) {
2626
parallel([(done) => {
2727
ssb.about.socialValue({ dest: id, key: 'name' }, (err, value) => {
2828
if (err) return done(err)
29-
result['name'] = value
29+
result.name = value
3030
done()
3131
})
3232
}, (done) => {
3333
ssb.about.socialValue({ dest: id, key: 'image' }, (err, value) => {
3434
if (err) return done(err)
3535
if (value && value instanceof Object && value.link) value = value.link
36-
result['image'] = value
36+
result.image = value
3737
done()
3838
})
3939
}], (err) => {

0 commit comments

Comments
 (0)