Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
199 changes: 0 additions & 199 deletions .oxlintrc.json

This file was deleted.

6 changes: 1 addition & 5 deletions content-collections.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineCollection, defineConfig } from '@content-collections/core'
import { normalizeRedirectFrom } from '~/utils/documents.server'
import { extractFrontMatter } from '~/utils/documents.server'

const posts = defineCollection({
name: 'posts',
Expand All @@ -11,20 +11,16 @@ const posts = defineCollection({
draft: z.boolean().optional(),
excerpt: z.string(),
authors: z.string().array(),
redirect_from: z.string().array().optional(),
}),
transform: ({ content, ...post }) => {
// Extract header image (first image after frontmatter)
const headerImageMatch = content.match(/!\[([^\]]*)\]\(([^)]+)\)/)
const headerImage = headerImageMatch ? headerImageMatch[2] : undefined
const redirectFrom = normalizeRedirectFrom(post.redirect_from)

return {
...post,
slug: post._meta.path,
headerImage,
redirect_from: redirectFrom,
redirectFrom,
content,
}
},
Expand Down
68 changes: 68 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import js from '@eslint/js'
import * as tseslint from 'typescript-eslint'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import jsxA11y from 'eslint-plugin-jsx-a11y'
import path from 'node:path'
import { fileURLToPath } from 'node:url'

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)

const ignores = [
'node_modules',
'dist',
'build',
'.content-collections',
'.tanstack-start',
'.netlify',
'public',
'convex/.temp',
]

export default [
{ ignores },
{
files: ['**/*.{js,jsx}'],
...js.configs.recommended,
},
...tseslint.configs.recommended,
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname,
},
},
rules: {
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '(^_)|(^__+$)|(^e$)|(^error$)',
varsIgnorePattern: '(^_)|(^__+$)|(^e$)|(^error$)',
caughtErrorsIgnorePattern: '(^_)|(^__+$)|(^e$)|(^error$)',
},
],
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': 'error',
'no-shadow': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
},
{
files: ['**/*.{ts,tsx,js,jsx}'],
plugins: {
react,
'react-hooks': reactHooks,
'jsx-a11y': jsxA11y,
},
settings: {
react: { version: 'detect' },
},
rules: {
...reactHooks.configs.recommended.rules,
...jsxA11y.configs.recommended.rules,
'react-hooks/set-state-in-effect': 'warn',
},
},
]
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dev:frontend": "pnpm run with-env vite dev",
"build": "vite build && cp src/instrument.server.mjs dist/server",
"start": "vite start",
"lint": "oxlint src",
"lint": "eslint --cache --ext .ts,.tsx ./src",
"format": "prettier --experimental-cli --ignore-unknown '**/*' --write",
"db:generate": "drizzle-kit generate",
"db:migrate": "drizzle-kit migrate",
Expand Down Expand Up @@ -111,6 +111,7 @@
"devDependencies": {
"@content-collections/core": "^0.8.2",
"@content-collections/vite": "^0.2.9",
"@eslint/js": "^9.39.1",
"@playwright/test": "^1.58.2",
"@shikijs/transformers": "^4.0.2",
"@types/hast": "^3.0.4",
Expand All @@ -124,13 +125,17 @@
"dotenv-cli": "^8.0.0",
"drizzle-kit": "^0.31.10",
"esbuild": "^0.27.4",
"eslint": "^9.39.1",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.0.1",
"husky": "^9.1.7",
"npm-run-all": "^4.1.5",
"oxlint": "^1.57.0",
"prettier": "^3.8.1",
"source-map-explorer": "^2.5.3",
"tailwindcss": "^4.2.2",
"tsx": "^4.21.0",
"typescript-eslint": "^8.48.1",
"typescript": "^5.9.3",
"vite": "^8.0.3"
},
Expand Down
Loading
Loading