chore: linting
This commit is contained in:
parent
9f39e9663d
commit
048fa9e4a8
@ -14,7 +14,7 @@ export const commitRef = process.env.CF_PAGES
|
|||||||
}">${process.env.CF_PAGES_COMMIT_SHA.slice(0, 8)}</a>`
|
}">${process.env.CF_PAGES_COMMIT_SHA.slice(0, 8)}</a>`
|
||||||
: 'dev'
|
: 'dev'
|
||||||
|
|
||||||
export const feedback = `<a href="/feedback" class="feedback-footer">Made with ❤️</a>`
|
export const feedback = `<a href="/feedback" class="feedback-footer">Made with ❤</a>`
|
||||||
|
|
||||||
export const search: DefaultTheme.Config['search'] = {
|
export const search: DefaultTheme.Config['search'] = {
|
||||||
options: {
|
options: {
|
||||||
@ -22,6 +22,7 @@ export const search: DefaultTheme.Config['search'] = {
|
|||||||
options: {
|
options: {
|
||||||
tokenize: (text) => text.split(/[\n\r #%*,=/:;?[\]{}()&]+/u), // simplified charset: removed [-_.@] and non-english chars (diacritics etc.)
|
tokenize: (text) => text.split(/[\n\r #%*,=/:;?[\]{}()&]+/u), // simplified charset: removed [-_.@] and non-english chars (diacritics etc.)
|
||||||
processTerm: (term, fieldName) => {
|
processTerm: (term, fieldName) => {
|
||||||
|
// biome-ignore lint/style/noParameterAssign: h
|
||||||
term = term
|
term = term
|
||||||
.trim()
|
.trim()
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
|
@ -13,12 +13,12 @@ export async function generateFeed(config: SiteConfig): Promise<void> {
|
|||||||
const feed: Feed = new Feed({
|
const feed: Feed = new Feed({
|
||||||
id: meta.hostname,
|
id: meta.hostname,
|
||||||
link: meta.hostname,
|
link: meta.hostname,
|
||||||
title: `FMHY blog`,
|
title: 'FMHY blog',
|
||||||
description: meta.description,
|
description: meta.description,
|
||||||
language: 'en-US',
|
language: 'en-US',
|
||||||
image: 'https://github.com/fmhy.png',
|
image: 'https://github.com/fmhy.png',
|
||||||
favicon: `${meta.hostname}/favicon.ico`,
|
favicon: `${meta.hostname}/favicon.ico`,
|
||||||
copyright: `Copyright (c) 2023-present FMHY`
|
copyright: 'Copyright (c) 2023-present FMHY'
|
||||||
})
|
})
|
||||||
|
|
||||||
const posts: ContentData[] = await createContentLoader('posts/*.md', {
|
const posts: ContentData[] = await createContentLoader('posts/*.md', {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { type MarkdownRenderer } from 'vitepress'
|
import type { MarkdownRenderer } from 'vitepress'
|
||||||
|
|
||||||
// FIXME: tasky: possibly write less horror jank?
|
// FIXME: tasky: possibly write less horror jank?
|
||||||
export function base64DecodePlugin(md: MarkdownRenderer) {
|
export function base64DecodePlugin(md: MarkdownRenderer) {
|
||||||
@ -7,7 +7,7 @@ export function base64DecodePlugin(md: MarkdownRenderer) {
|
|||||||
// Save the original rule for backticks
|
// Save the original rule for backticks
|
||||||
const defaultRender =
|
const defaultRender =
|
||||||
md.renderer.rules.code_inline ||
|
md.renderer.rules.code_inline ||
|
||||||
function (tokens, idx, options, env, self) {
|
function (tokens, idx, options, _env, self) {
|
||||||
return self.renderToken(tokens, idx, options)
|
return self.renderToken(tokens, idx, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,8 +11,7 @@ export function toggleStarredPlugin(md: MarkdownRenderer) {
|
|||||||
contentToken.content.startsWith(':star:')
|
contentToken.content.startsWith(':star:')
|
||||||
) {
|
) {
|
||||||
return `<li class="starred">`
|
return `<li class="starred">`
|
||||||
} else {
|
}
|
||||||
return self.renderToken(tokens, index, options)
|
return self.renderToken(tokens, index, options)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
import { corsEventHandler } from 'nitro-cors'
|
import { corsEventHandler } from 'nitro-cors'
|
||||||
|
|
||||||
export default corsEventHandler((_event) => {}, {
|
export default corsEventHandler(
|
||||||
|
(_event) => {
|
||||||
|
/** no-op */
|
||||||
|
},
|
||||||
|
{
|
||||||
origin: '*',
|
origin: '*',
|
||||||
methods: '*'
|
methods: '*'
|
||||||
})
|
}
|
||||||
|
)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { type Theme } from 'vitepress'
|
import type { Theme } from 'vitepress'
|
||||||
import DefaultTheme from 'vitepress/theme'
|
import DefaultTheme from 'vitepress/theme'
|
||||||
import Layout from './Layout.vue'
|
import Layout from './Layout.vue'
|
||||||
import Post from './PostLayout.vue'
|
import Post from './PostLayout.vue'
|
||||||
|
@ -4,6 +4,7 @@ export function groupBy<T, K extends keyof any>(
|
|||||||
): Record<K, T[]> {
|
): Record<K, T[]> {
|
||||||
return arr.reduce(
|
return arr.reduce(
|
||||||
(groups, item) => {
|
(groups, item) => {
|
||||||
|
// biome-ignore lint/suspicious/noAssignInExpressions: <explanation>
|
||||||
;(groups[key(item)] ||= []).push(item)
|
;(groups[key(item)] ||= []).push(item)
|
||||||
return groups
|
return groups
|
||||||
},
|
},
|
||||||
|
54
biome.json
54
biome.json
@ -1,51 +1,31 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
|
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
|
||||||
"extends": ["@taskylizard/biome-config"],
|
"extends": ["@taskylizard/biome-config"],
|
||||||
|
"files": {
|
||||||
|
"ignore": [".vitepress/**/*.vue", ".vitepress/vue-shim.d.ts"]
|
||||||
|
},
|
||||||
"formatter": {
|
"formatter": {
|
||||||
"enabled": false
|
"enabled": false
|
||||||
},
|
},
|
||||||
|
"javascript": {
|
||||||
|
"globals": [
|
||||||
|
"defineNitroConfig",
|
||||||
|
"eventHandler",
|
||||||
|
"useRuntimeConfig",
|
||||||
|
"readValidatedBody",
|
||||||
|
"defineEventHandler"
|
||||||
|
]
|
||||||
|
},
|
||||||
"linter": {
|
"linter": {
|
||||||
"rules": {
|
"rules": {
|
||||||
"style": {
|
"style": {
|
||||||
"noDefaultExport": "off",
|
"useFilenamingConvention": {
|
||||||
"useNamingConvention": {
|
"level": "info",
|
||||||
"level": "error",
|
|
||||||
"options": {
|
"options": {
|
||||||
"strictCase": false,
|
"filenameCases": ["camelCase", "PascalCase"]
|
||||||
"conventions": [
|
|
||||||
{
|
|
||||||
"selector": {
|
|
||||||
"kind": "typeParameter"
|
|
||||||
},
|
|
||||||
"formats": ["PascalCase"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"selector": {
|
|
||||||
"kind": "any"
|
|
||||||
},
|
|
||||||
"match": "[ab_]|(.{2,})"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"selector": {
|
|
||||||
"kind": "objectLiteralMember"
|
|
||||||
},
|
|
||||||
"match": ".*"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"selector": {
|
|
||||||
"kind": "typeMember"
|
|
||||||
},
|
|
||||||
"match": ".*"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"selector": {
|
|
||||||
"kind": "variable"
|
|
||||||
},
|
|
||||||
"match": ".*"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"noDefaultExport": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user