Skip to content

Commit 0dfb431

Browse files
committed
eslint --fix
1 parent 9ab07c7 commit 0dfb431

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+157
-617
lines changed

app/api/$$.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { checkRedirects } from '../lib/marketing-redirects.mjs'
22

3-
async function catchAll() {
3+
async function catchAll () {
44
return {
55
statusCode: 302,
66
location: '/404',
77
}
88
}
99

10-
export const get = [checkRedirects, catchAll]
10+
export const get = [ checkRedirects, catchAll ]

app/api/cta/$event.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import QRCode from 'qrcode'
22
import data from '@begin/data'
33

4-
export async function get(req) {
4+
export async function get (req) {
55
const { event } = req.pathParameters
66
const dataUrl = await QRCode.toDataURL(`https://enhance.dev/cta/${event}`)
77
const gacode =

app/api/cta/views.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import data from '@begin/data'
22

3-
export async function get() {
3+
export async function get () {
44
let views = await data.get({
55
table: 'views',
66
key: 'cta',

app/api/discord.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export async function get() {
1+
export async function get () {
22
return {
33
statusCode: 302,
44
location: 'https://discord.gg/J8bUSfKs8W',

app/api/docs.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export async function get() {
1+
export async function get () {
22
return {
33
statusCode: 301,
44
location: '/docs/',

app/api/docs/$$.mjs

+7-6
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ const arcdown = new Arcdown({
1515
markdownItToc: {
1616
containerClass: 'toc mbe2 mis-2 leading2',
1717
listType: 'ul',
18-
level: [1, 2, 3],
18+
level: [ 1, 2, 3 ],
1919
},
2020
},
21-
plugins: [arcStaticImg],
21+
plugins: [ arcStaticImg ],
2222
hljs: {
23-
sublanguages: { javascript: ['xml', 'css'] },
24-
plugins: [new HljsLineWrapper({ className: 'code-line' })],
23+
sublanguages: { javascript: [ 'xml', 'css' ] },
24+
plugins: [ new HljsLineWrapper({ className: 'code-line' }) ],
2525
},
2626
})
2727

2828
/** @type {import('@enhance/types').EnhanceApiFn} */
29-
export async function get(request) {
29+
export async function get (request) {
3030
const { path: activePath } = request
3131
let docPath = activePath.replace(/^\/?docs\//, '') || 'index'
3232

@@ -61,7 +61,8 @@ export async function get(request) {
6161
let docMarkdown
6262
try {
6363
docMarkdown = readFileSync(docURL.pathname, 'utf-8')
64-
} catch (_err) {
64+
}
65+
catch (_err) {
6566
let searchTerm = null
6667
if (!docPath.endsWith('/index')) {
6768
const docPathParts = docPath.split('/')

app/api/email/interest/add.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import data from '@begin/data'
22

33
/** @type {import('@enhance/types').EnhanceApiFn} */
4-
export async function post(req) {
4+
export async function post (req) {
55
const email = req.body.email
66
const timestamp = new Date(Date.now()).toISOString()
77
await data.set({ table: 'email', email, timestamp })

app/api/index.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import navDataLoader from '../docs/nav-data.mjs'
22

33
/** @type {import('@enhance/types').EnhanceApiFn} */
4-
export async function get({ query }) {
4+
export async function get ({ query }) {
55
const { thanks } = query
66

77
const cacheControl =

app/api/wasm.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import navDataLoader from '../docs/nav-data.mjs'
22

33
/** @type {import('@enhance/types').EnhanceApiFn} */
4-
export async function get({ query }) {
4+
export async function get ({ query }) {
55
const { thanks } = query
66

77
const cacheControl =

app/api/why-enhance.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import navDataLoader from '../docs/nav-data.mjs'
22

3-
export async function get() {
3+
export async function get () {
44
const navData = navDataLoader('docs', '/why-enhance')
55

66
const cacheControl =

app/docs/hljs-line-wrapper.mjs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/* eslint-disable fp/no-class */
22

33
export default class {
4-
constructor(options) {
4+
constructor (options) {
55
this.className = options.className
66
}
77

8-
'after:highlight'(result) {
8+
'after:highlight' (result) {
99
const tokens = []
1010

1111
const safelyTagged = result.value.replace(
@@ -17,7 +17,8 @@ export default class {
1717

1818
if (match === '</span>') {
1919
tokens.pop()
20-
} else {
20+
}
21+
else {
2122
tokens.push(match)
2223
}
2324

app/docs/nav-data.mjs

+10-9
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export const data = [
5959
path: '/docs/routing/api-routes/',
6060
label: 'API Routes',
6161
hasChildren: true,
62-
items: ['middleware', 'tutorial'],
62+
items: [ 'middleware', 'tutorial' ],
6363
},
6464
],
6565
},
@@ -76,7 +76,7 @@ export const data = [
7676
path: '/docs/elements/html/',
7777
label: 'HTML',
7878
hasChildren: true,
79-
items: ['slots'],
79+
items: [ 'slots' ],
8080
},
8181
{
8282
slug: 'state',
@@ -114,15 +114,15 @@ export const data = [
114114
slug: 'alternatives',
115115
path: '/docs/enhance-styles/alternatives/',
116116
hasChildren: true,
117-
items: ['tailwind', 'sass'],
117+
items: [ 'tailwind', 'sass' ],
118118
},
119119
],
120120
},
121121
{
122122
type: TYPE.category,
123123
label: 'Enhance UI',
124124
slug: 'enhance-ui',
125-
items: [{ slug: 'image', label: 'Image (beta)' }],
125+
items: [ { slug: 'image', label: 'Image (beta)' } ],
126126
},
127127
{
128128
type: TYPE.category,
@@ -143,7 +143,7 @@ export const data = [
143143
slug: 'testing',
144144
path: '/docs/patterns/testing/',
145145
hasChildren: true,
146-
items: [{ slug: 'webdriverio', label: 'WebdriverIO' }],
146+
items: [ { slug: 'webdriverio', label: 'WebdriverIO' } ],
147147
},
148148
'architect-migration',
149149
],
@@ -215,13 +215,13 @@ export const other = {
215215
},
216216
}
217217

218-
export function unslug(string) {
218+
export function unslug (string) {
219219
return string
220220
.replace(/-/g, ' ')
221221
.replace(/(^\w{1})|(\s+\w{1})/g, (l) => l.toUpperCase())
222222
}
223223

224-
function parseItems(items, root, activePath) {
224+
function parseItems (items, root, activePath) {
225225
const parsedItems = items.map((item) => {
226226
if (typeof item === 'string') {
227227
// create full item from shorthand item
@@ -231,7 +231,8 @@ function parseItems(items, root, activePath) {
231231
path: `/${root}/${item}`,
232232
label: unslug(item),
233233
}
234-
} else {
234+
}
235+
else {
235236
if (!item.type) {
236237
item.type = 'doc'
237238
}
@@ -252,7 +253,7 @@ function parseItems(items, root, activePath) {
252253
return item
253254
})
254255

255-
function testForActive(i) {
256+
function testForActive (i) {
256257
return i.active || i.items?.some(testForActive)
257258
}
258259

app/elements/app-wrap.mjs

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default function AppWrap({ html, state = {} }) {
1+
export default function AppWrap ({ html, state = {} }) {
22
// const modals = Array(Math.parseInt(state.attrs?.quantity || 1)).fill(0)
33
// space or comma separated values for modal names "one,two three"
44
const modals = state?.attrs?.modals?.split(/[\s*,?\s*]/) || []
@@ -60,8 +60,8 @@ export default function AppWrap({ html, state = {} }) {
6060
6161
6262
${modals
63-
.map(
64-
(modalName) => /* css*/ `
63+
.map(
64+
(modalName) => /* css*/ `
6565
/* Hide main content when modal opens. Hidden from screen readers and traps focus */
6666
:host
6767
> input[name='group-click-${modalName}']:not(:checked)
@@ -81,12 +81,12 @@ export default function AppWrap({ html, state = {} }) {
8181
display: block;
8282
}
8383
`
84-
)
85-
.join('\n')}
84+
)
85+
.join('\n')}
8686
</style>
8787
${modals
88-
.map(
89-
(modalName) => /* html*/ `
88+
.map(
89+
(modalName) => /* html*/ `
9090
<input
9191
tabindex="-1"
9292
aria-hidden="true"
@@ -102,13 +102,13 @@ export default function AppWrap({ html, state = {} }) {
102102
name="group-key-${modalName}"
103103
type="radio" />
104104
`
105-
)
106-
.join('')}
105+
)
106+
.join('')}
107107
108108
<slot name="main"></slot>
109109
${modals
110-
.map(
111-
(modalName) => /* html*/ `
110+
.map(
111+
(modalName) => /* html*/ `
112112
<div class="modal-container" id="modal-container-${modalName}">
113113
<button
114114
class="overlay"
@@ -131,8 +131,8 @@ export default function AppWrap({ html, state = {} }) {
131131
</div>
132132
<form id="modal-form-${modalName}"></form>
133133
`
134-
)
135-
.join('')}
134+
)
135+
.join('')}
136136
<script>
137137
// TODO: set aria-hidden on main
138138
// TODO: change main to inert and not display none when dialog open

app/elements/axol-wink.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default function AxolWink({ html }) {
1+
export default function AxolWink ({ html }) {
22
return html`
33
<style>
44
:host {

app/elements/begin-logo.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default function BeginLogo({ html }) {
1+
export default function BeginLogo ({ html }) {
22
return html`
33
<svg
44
width="16"

app/elements/cherub-head.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default function CherubHead({ html }) {
1+
export default function CherubHead ({ html }) {
22
return html`
33
<style>
44
:host {

app/elements/cherub-mascot.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default function CherubMascot({ html }) {
1+
export default function CherubMascot ({ html }) {
22
return html`
33
<style>
44
:host {

app/elements/cta-qrcode.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default function CtaQrcode({ html, state }) {
1+
export default function CtaQrcode ({ html, state }) {
22
const { store } = state
33
const { dataUrl } = store
44
return html`<img src="${dataUrl}" />`

app/elements/doc/callout.mjs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
const LEVELS = ['note', 'tip', 'info', 'caution', 'danger']
2-
const MARKS = ['📝', '💡', 'ℹ️', '⚠️', '🔥']
1+
const LEVELS = [ 'note', 'tip', 'info', 'caution', 'danger' ]
2+
const MARKS = [ '📝', '💡', 'ℹ️', '⚠️', '🔥' ]
33
const generatedStyles = LEVELS.map(
44
(level) => `
55
callout-container.callout-${level} {
66
background-color: var(--callout-${level})
77
}`
88
).join('\n')
99

10-
export default function Callout({ html, state }) {
10+
export default function Callout ({ html, state }) {
1111
const { attrs } = state
1212
const thin = typeof attrs.thin !== 'undefined'
1313
const level = attrs.level || 'note'
@@ -56,8 +56,8 @@ export default function Callout({ html, state }) {
5656
align-items-center
5757
">
5858
${mark?.length > 0 && mark !== 'none'
59-
? `<callout-mark class="text2 align-self-start">${mark}</callout-mark>`
60-
: ''}
59+
? `<callout-mark class="text2 align-self-start">${mark}</callout-mark>`
60+
: ''}
6161
<div>
6262
<slot></slot>
6363
</div>

app/elements/doc/code-mirror.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import arc from '@architect/functions'
22

3-
export default function DocCodeMirror({ html /* state */ }) {
3+
export default function DocCodeMirror ({ html /* state */ }) {
44
// const { attrs = {} } = state
55
// let {
66
// lang = 'javascript',

app/elements/doc/code.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import arc from '@architect/functions'
22
const moduleUrl = arc.static('js/elements/doc-code.mjs')
33

4-
export default function DocCode({ html }) {
4+
export default function DocCode ({ html }) {
55
return html`
66
<style>
77
:host {

app/elements/doc/content.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default function DocContent({ html }) {
1+
export default function DocContent ({ html }) {
22
return html`
33
<style>
44
:host > * {

app/elements/doc/link-callout.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default function LinkCallout({ html, state }) {
1+
export default function LinkCallout ({ html, state }) {
22
const { attrs } = state
33
const link = attrs.link || '/'
44
const mark = attrs.mark || 'none'

app/elements/doc/video.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import arc from '@architect/functions'
22

3-
export default function DocVideo({ html, state }) {
3+
export default function DocVideo ({ html, state }) {
44
const { attrs } = state
55
const playbackId = attrs['playback-id']
66
const name = attrs.name || 'Enhance Video'

0 commit comments

Comments
 (0)