Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
11 changes: 9 additions & 2 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
{
"$schema": "https://unpkg.com/oxlint/configuration_schema.json",
"plugins": ["unicorn", "typescript", "oxc", "vue", "vitest"],
"jsPlugins": ["@e18e/eslint-plugin"],
"categories": {
"correctness": "error",
"suspicious": "warn",
"perf": "warn"
},
"rules": {
"no-console": "warn",
"no-console": "off",
Copy link
Copy Markdown
Member

@serhalp serhalp Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never understood the purpose of warns, so I'm good with this 😁. Longer term should we be using a li'l logger module and turning this to "error"? (maybe keep off for scripts/)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we really need to review logging overall.

only truly error-level things should be logged at error level, for example. this isn't currently the case iirc

i'll start a discussion around this 👍

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it be possible to disable this just on a per-directory case? so we disable it for server/ and cli/ but keep it for app/ ?

"no-await-in-loop": "off",
"unicorn/no-array-sort": "off",
"no-restricted-globals": "error",
"typescript/consistent-type-imports": "error"
"typescript/consistent-type-imports": "error",
"e18e/prefer-array-from-map": "error",
"e18e/prefer-timer-args": "error",
"e18e/prefer-date-now": "error",
"e18e/prefer-regex-test": "error",
"e18e/prefer-array-some": "error"
},
"overrides": [],
"ignorePatterns": [
".output/**",
".data/**",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"vue-data-ui": "3.14.7"
},
"devDependencies": {
"@e18e/eslint-plugin": "0.1.4",
"@intlify/core-base": "11.2.8",
"@npm/types": "2.1.0",
"@playwright/test": "1.58.1",
Expand Down
22 changes: 22 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion scripts/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ function runCommand(command: string, args: string[]) {

const oxlintVersion = getDependencyVersion('oxlint')
const oxfmtVersion = getDependencyVersion('oxfmt')
const e18eVersion = getDependencyVersion('@e18e/eslint-plugin')

runCommand('pnpx', [`oxlint@${oxlintVersion}`])
runCommand('pnpx', [
`--package=@e18e/eslint-plugin@${e18eVersion}`,
`--package=oxlint@${oxlintVersion}`,
'oxlint',
])
runCommand('pnpx', [`oxfmt@${oxfmtVersion}`, '--check'])
2 changes: 1 addition & 1 deletion server/utils/dependency-analysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export const analyzeDependencyTree = defineCachedFunction(
const resolved = await resolveDependencyTree(name, version, { trackDepth: true })

// Convert to array with query info
const packages: PackageQueryInfo[] = [...resolved.values()].map(pkg => ({
const packages: PackageQueryInfo[] = Array.from(resolved.values(), pkg => ({
name: pkg.name,
version: pkg.version,
depth: pkg.depth!,
Expand Down
16 changes: 8 additions & 8 deletions server/utils/readme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,14 @@ function resolveImageUrl(url: string, packageName: string, repoInfo?: Repository
return resolved
}

// Helper to prefix id attributes with 'user-content-'
function prefixId(tagName: string, attribs: sanitizeHtml.Attributes) {
if (attribs.id && !attribs.id.startsWith('user-content-')) {
attribs.id = `user-content-${attribs.id}`
}
return { tagName, attribs }
}

export async function renderReadmeHtml(
content: string,
packageName: string,
Expand Down Expand Up @@ -398,14 +406,6 @@ ${html}

const rawHtml = marked.parse(content) as string

// Helper to prefix id attributes with 'user-content-'
const prefixId = (tagName: string, attribs: sanitizeHtml.Attributes) => {
if (attribs.id && !attribs.id.startsWith('user-content-')) {
attribs.id = `user-content-${attribs.id}`
}
return { tagName, attribs }
}

const sanitized = sanitizeHtml(rawHtml, {
allowedTags: ALLOWED_TAGS,
allowedAttributes: ALLOWED_ATTR,
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ async function handleJsdelivrCdn(route: Route): Promise<boolean> {
const pathname = decodeURIComponent(url.pathname)

// README file requests - return 404 (package pages work fine without README)
if (pathname.match(/readme/i)) {
if (/readme/i.test(pathname)) {
await route.fulfill({ status: 404, body: 'Not found' })
return true
}
Expand Down
Loading