diff --git a/app/api/$$.mjs b/app/api/$$.mjs
index 04daf933..1d4ca7b7 100644
--- a/app/api/$$.mjs
+++ b/app/api/$$.mjs
@@ -1,10 +1,10 @@
import { checkRedirects } from '../lib/marketing-redirects.mjs'
-async function catchAll() {
+async function catchAll () {
return {
statusCode: 302,
location: '/404',
}
}
-export const get = [checkRedirects, catchAll]
+export const get = [ checkRedirects, catchAll ]
diff --git a/app/api/cta/$event.mjs b/app/api/cta/$event.mjs
index 3c2c7412..03a62986 100644
--- a/app/api/cta/$event.mjs
+++ b/app/api/cta/$event.mjs
@@ -1,7 +1,7 @@
import QRCode from 'qrcode'
import data from '@begin/data'
-export async function get(req) {
+export async function get (req) {
const { event } = req.pathParameters
const dataUrl = await QRCode.toDataURL(`https://enhance.dev/cta/${event}`)
const gacode =
diff --git a/app/api/cta/views.mjs b/app/api/cta/views.mjs
index 1fe3f0ff..73a0931a 100644
--- a/app/api/cta/views.mjs
+++ b/app/api/cta/views.mjs
@@ -1,6 +1,6 @@
import data from '@begin/data'
-export async function get() {
+export async function get () {
let views = await data.get({
table: 'views',
key: 'cta',
diff --git a/app/api/discord.mjs b/app/api/discord.mjs
index 558f3581..d90db4ee 100644
--- a/app/api/discord.mjs
+++ b/app/api/discord.mjs
@@ -1,4 +1,4 @@
-export async function get() {
+export async function get () {
return {
statusCode: 302,
location: 'https://discord.gg/J8bUSfKs8W',
diff --git a/app/api/docs.mjs b/app/api/docs.mjs
index 492823c5..9444b4b6 100644
--- a/app/api/docs.mjs
+++ b/app/api/docs.mjs
@@ -1,4 +1,4 @@
-export async function get() {
+export async function get () {
return {
statusCode: 301,
location: '/docs/',
diff --git a/app/api/docs/$$.mjs b/app/api/docs/$$.mjs
index 9b3f7ecb..4bca1ad6 100644
--- a/app/api/docs/$$.mjs
+++ b/app/api/docs/$$.mjs
@@ -15,18 +15,18 @@ const arcdown = new Arcdown({
markdownItToc: {
containerClass: 'toc mbe2 mis-2 leading2',
listType: 'ul',
- level: [1, 2, 3],
+ level: [ 1, 2, 3 ],
},
},
- plugins: [arcStaticImg],
+ plugins: [ arcStaticImg ],
hljs: {
- sublanguages: { javascript: ['xml', 'css'] },
- plugins: [new HljsLineWrapper({ className: 'code-line' })],
+ sublanguages: { javascript: [ 'xml', 'css' ] },
+ plugins: [ new HljsLineWrapper({ className: 'code-line' }) ],
},
})
/** @type {import('@enhance/types').EnhanceApiFn} */
-export async function get(request) {
+export async function get (request) {
const { path: activePath } = request
let docPath = activePath.replace(/^\/?docs\//, '') || 'index'
@@ -61,7 +61,8 @@ export async function get(request) {
let docMarkdown
try {
docMarkdown = readFileSync(docURL.pathname, 'utf-8')
- } catch (_err) {
+ }
+ catch (_err) {
let searchTerm = null
if (!docPath.endsWith('/index')) {
const docPathParts = docPath.split('/')
diff --git a/app/api/email/interest/add.mjs b/app/api/email/interest/add.mjs
index 018c8acd..fa8606a6 100644
--- a/app/api/email/interest/add.mjs
+++ b/app/api/email/interest/add.mjs
@@ -1,7 +1,7 @@
import data from '@begin/data'
/** @type {import('@enhance/types').EnhanceApiFn} */
-export async function post(req) {
+export async function post (req) {
const email = req.body.email
const timestamp = new Date(Date.now()).toISOString()
await data.set({ table: 'email', email, timestamp })
diff --git a/app/api/index.mjs b/app/api/index.mjs
index c2fd1954..52c5f6e5 100644
--- a/app/api/index.mjs
+++ b/app/api/index.mjs
@@ -1,7 +1,7 @@
import navDataLoader from '../docs/nav-data.mjs'
/** @type {import('@enhance/types').EnhanceApiFn} */
-export async function get({ query }) {
+export async function get ({ query }) {
const { thanks } = query
const cacheControl =
diff --git a/app/api/wasm.mjs b/app/api/wasm.mjs
index 1668a3ea..a60ca175 100644
--- a/app/api/wasm.mjs
+++ b/app/api/wasm.mjs
@@ -1,7 +1,7 @@
import navDataLoader from '../docs/nav-data.mjs'
/** @type {import('@enhance/types').EnhanceApiFn} */
-export async function get({ query }) {
+export async function get ({ query }) {
const { thanks } = query
const cacheControl =
diff --git a/app/api/why-enhance.mjs b/app/api/why-enhance.mjs
index b117bb47..90157293 100644
--- a/app/api/why-enhance.mjs
+++ b/app/api/why-enhance.mjs
@@ -1,6 +1,6 @@
import navDataLoader from '../docs/nav-data.mjs'
-export async function get() {
+export async function get () {
const navData = navDataLoader('docs', '/why-enhance')
const cacheControl =
diff --git a/app/docs/hljs-line-wrapper.mjs b/app/docs/hljs-line-wrapper.mjs
index 6ac61d37..475517e1 100644
--- a/app/docs/hljs-line-wrapper.mjs
+++ b/app/docs/hljs-line-wrapper.mjs
@@ -1,11 +1,11 @@
/* eslint-disable fp/no-class */
export default class {
- constructor(options) {
+ constructor (options) {
this.className = options.className
}
- 'after:highlight'(result) {
+ 'after:highlight' (result) {
const tokens = []
const safelyTagged = result.value.replace(
@@ -17,7 +17,8 @@ export default class {
if (match === '') {
tokens.pop()
- } else {
+ }
+ else {
tokens.push(match)
}
diff --git a/app/docs/nav-data.mjs b/app/docs/nav-data.mjs
index 27af2bff..ed75afc4 100644
--- a/app/docs/nav-data.mjs
+++ b/app/docs/nav-data.mjs
@@ -59,7 +59,7 @@ export const data = [
path: '/docs/routing/api-routes/',
label: 'API Routes',
hasChildren: true,
- items: ['middleware', 'tutorial'],
+ items: [ 'middleware', 'tutorial' ],
},
],
},
@@ -76,7 +76,7 @@ export const data = [
path: '/docs/elements/html/',
label: 'HTML',
hasChildren: true,
- items: ['slots'],
+ items: [ 'slots' ],
},
{
slug: 'state',
@@ -114,7 +114,7 @@ export const data = [
slug: 'alternatives',
path: '/docs/enhance-styles/alternatives/',
hasChildren: true,
- items: ['tailwind', 'sass'],
+ items: [ 'tailwind', 'sass' ],
},
],
},
@@ -122,7 +122,7 @@ export const data = [
type: TYPE.category,
label: 'Enhance UI',
slug: 'enhance-ui',
- items: [{ slug: 'image', label: 'Image (beta)' }],
+ items: [ { slug: 'image', label: 'Image (beta)' } ],
},
{
type: TYPE.category,
@@ -143,7 +143,7 @@ export const data = [
slug: 'testing',
path: '/docs/patterns/testing/',
hasChildren: true,
- items: [{ slug: 'webdriverio', label: 'WebdriverIO' }],
+ items: [ { slug: 'webdriverio', label: 'WebdriverIO' } ],
},
'architect-migration',
],
@@ -215,13 +215,13 @@ export const other = {
},
}
-export function unslug(string) {
+export function unslug (string) {
return string
.replace(/-/g, ' ')
.replace(/(^\w{1})|(\s+\w{1})/g, (l) => l.toUpperCase())
}
-function parseItems(items, root, activePath) {
+function parseItems (items, root, activePath) {
const parsedItems = items.map((item) => {
if (typeof item === 'string') {
// create full item from shorthand item
@@ -231,7 +231,8 @@ function parseItems(items, root, activePath) {
path: `/${root}/${item}`,
label: unslug(item),
}
- } else {
+ }
+ else {
if (!item.type) {
item.type = 'doc'
}
@@ -252,7 +253,7 @@ function parseItems(items, root, activePath) {
return item
})
- function testForActive(i) {
+ function testForActive (i) {
return i.active || i.items?.some(testForActive)
}
diff --git a/app/elements/app-wrap.mjs b/app/elements/app-wrap.mjs
index c1cf118c..a2e308a1 100644
--- a/app/elements/app-wrap.mjs
+++ b/app/elements/app-wrap.mjs
@@ -1,4 +1,4 @@
-export default function AppWrap({ html, state = {} }) {
+export default function AppWrap ({ html, state = {} }) {
// const modals = Array(Math.parseInt(state.attrs?.quantity || 1)).fill(0)
// space or comma separated values for modal names "one,two three"
const modals = state?.attrs?.modals?.split(/[\s*,?\s*]/) || []
@@ -60,8 +60,8 @@ export default function AppWrap({ html, state = {} }) {
${modals
- .map(
- (modalName) => /* css*/ `
+ .map(
+ (modalName) => /* css*/ `
/* Hide main content when modal opens. Hidden from screen readers and traps focus */
:host
> input[name='group-click-${modalName}']:not(:checked)
@@ -81,12 +81,12 @@ export default function AppWrap({ html, state = {} }) {
display: block;
}
`
- )
- .join('\n')}
+ )
+ .join('\n')}
${modals
- .map(
- (modalName) => /* html*/ `
+ .map(
+ (modalName) => /* html*/ `
`
- )
- .join('')}
+ )
+ .join('')}