Skip to content

Commit 510c7ab

Browse files
committed
fix: update linting comments from oxlint to eslint
1 parent 05123d8 commit 510c7ab

Some content is hidden

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

58 files changed

+1005
-852
lines changed

.oxlintrc.json

Lines changed: 0 additions & 199 deletions
This file was deleted.

content-collections.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineCollection, defineConfig } from '@content-collections/core'
2-
import { normalizeRedirectFrom } from '~/utils/documents.server'
2+
import { extractFrontMatter } from '~/utils/documents.server'
33

44
const posts = defineCollection({
55
name: 'posts',
@@ -11,20 +11,16 @@ const posts = defineCollection({
1111
draft: z.boolean().optional(),
1212
excerpt: z.string(),
1313
authors: z.string().array(),
14-
redirect_from: z.string().array().optional(),
1514
}),
1615
transform: ({ content, ...post }) => {
1716
// Extract header image (first image after frontmatter)
1817
const headerImageMatch = content.match(/!\[([^\]]*)\]\(([^)]+)\)/)
1918
const headerImage = headerImageMatch ? headerImageMatch[2] : undefined
20-
const redirectFrom = normalizeRedirectFrom(post.redirect_from)
2119

2220
return {
2321
...post,
2422
slug: post._meta.path,
2523
headerImage,
26-
redirect_from: redirectFrom,
27-
redirectFrom,
2824
content,
2925
}
3026
},

eslint.config.mjs

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import js from '@eslint/js'
2+
import * as tseslint from 'typescript-eslint'
3+
import react from 'eslint-plugin-react'
4+
import reactHooks from 'eslint-plugin-react-hooks'
5+
import jsxA11y from 'eslint-plugin-jsx-a11y'
6+
import path from 'node:path'
7+
import { fileURLToPath } from 'node:url'
8+
9+
const __filename = fileURLToPath(import.meta.url)
10+
const __dirname = path.dirname(__filename)
11+
12+
const ignores = [
13+
'node_modules',
14+
'dist',
15+
'build',
16+
'.content-collections',
17+
'.tanstack-start',
18+
'.netlify',
19+
'public',
20+
'convex/.temp',
21+
]
22+
23+
export default [
24+
{ ignores },
25+
{
26+
files: ['**/*.{js,jsx}'],
27+
...js.configs.recommended,
28+
},
29+
...tseslint.configs.recommended,
30+
{
31+
files: ['**/*.{ts,tsx}'],
32+
languageOptions: {
33+
parserOptions: {
34+
tsconfigRootDir: __dirname,
35+
},
36+
},
37+
rules: {
38+
'@typescript-eslint/no-unused-vars': [
39+
'warn',
40+
{
41+
argsIgnorePattern: '(^_)|(^__+$)|(^e$)|(^error$)',
42+
varsIgnorePattern: '(^_)|(^__+$)|(^e$)|(^error$)',
43+
caughtErrorsIgnorePattern: '(^_)|(^__+$)|(^e$)|(^error$)',
44+
},
45+
],
46+
'no-redeclare': 'off',
47+
'@typescript-eslint/no-redeclare': 'error',
48+
'no-shadow': 'off',
49+
'@typescript-eslint/no-explicit-any': 'off',
50+
},
51+
},
52+
{
53+
files: ['**/*.{ts,tsx,js,jsx}'],
54+
plugins: {
55+
react,
56+
'react-hooks': reactHooks,
57+
'jsx-a11y': jsxA11y,
58+
},
59+
settings: {
60+
react: { version: 'detect' },
61+
},
62+
rules: {
63+
...reactHooks.configs.recommended.rules,
64+
...jsxA11y.configs.recommended.rules,
65+
'react-hooks/set-state-in-effect': 'warn',
66+
},
67+
},
68+
]

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"dev:frontend": "pnpm run with-env vite dev",
1212
"build": "vite build && cp src/instrument.server.mjs dist/server",
1313
"start": "vite start",
14-
"lint": "oxlint src",
14+
"lint": "eslint --cache --ext .ts,.tsx ./src",
1515
"format": "prettier --experimental-cli --ignore-unknown '**/*' --write",
1616
"db:generate": "drizzle-kit generate",
1717
"db:migrate": "drizzle-kit migrate",
@@ -111,6 +111,7 @@
111111
"devDependencies": {
112112
"@content-collections/core": "^0.8.2",
113113
"@content-collections/vite": "^0.2.9",
114+
"@eslint/js": "^9.39.1",
114115
"@playwright/test": "^1.58.2",
115116
"@shikijs/transformers": "^4.0.2",
116117
"@types/hast": "^3.0.4",
@@ -124,13 +125,17 @@
124125
"dotenv-cli": "^8.0.0",
125126
"drizzle-kit": "^0.31.10",
126127
"esbuild": "^0.27.4",
128+
"eslint": "^9.39.1",
129+
"eslint-plugin-jsx-a11y": "^6.10.2",
130+
"eslint-plugin-react": "^7.37.5",
131+
"eslint-plugin-react-hooks": "^7.0.1",
127132
"husky": "^9.1.7",
128133
"npm-run-all": "^4.1.5",
129-
"oxlint": "^1.57.0",
130134
"prettier": "^3.8.1",
131135
"source-map-explorer": "^2.5.3",
132136
"tailwindcss": "^4.2.2",
133137
"tsx": "^4.21.0",
138+
"typescript-eslint": "^8.48.1",
134139
"typescript": "^5.9.3",
135140
"vite": "^8.0.3"
136141
},

0 commit comments

Comments
 (0)