Skip to content

Commit 9502c4f

Browse files
committed
fix oxc linter
1 parent 4013fde commit 9502c4f

4 files changed

Lines changed: 28 additions & 23 deletions

File tree

.oxlintrc.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"$schema": "./node_modules/oxlint/configuration_schema.json",
3-
"plugins": ["react", "typescript", "import"],
3+
"plugins": ["react", "typescript", "import", "jsx-a11y"],
44
"categories": {
55
"correctness": "error",
6-
"suspicious": "warn"
6+
"suspicious": "warn",
7+
"perf": "warn"
78
},
89
"rules": {
910
"react/react-in-jsx-scope": "off"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"lint:fix": "oxlint --fix",
2121
"fmt": "oxfmt .",
2222
"fmt:check": "oxfmt --check .",
23-
"check": "oxlint && oxfmt --check .",
23+
"check": "oxlint --deny-warnings && oxfmt --check .",
2424
"cdk:build": "cd cdk && tsc",
2525
"cdk:watch": "cd cdk && tsc -w",
2626
"cdk:deploy:docs": "cdk deploy --require-approval never --app \"tsx cdk/docs-cdk.ts\"",

scripts/sync-tagotip.mjs

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -108,27 +108,29 @@ async function fetchFile(name) {
108108
async function main() {
109109
console.log("sync-tagotip: fetching specs from GitHub...");
110110

111-
for (const file of FILES) {
112-
const outPath = join(ROOT, file.out);
113-
try {
114-
const raw = await fetchFile(file.remote);
115-
const stripped = stripLicenseHeader(raw);
116-
const escaped = escapeBraces(stripped);
117-
const rewritten = rewriteLinks(escaped);
118-
const content = `${file.frontmatter}\n\n${rewritten}`;
111+
await Promise.all(
112+
FILES.map(async (file) => {
113+
const outPath = join(ROOT, file.out);
114+
try {
115+
const raw = await fetchFile(file.remote);
116+
const stripped = stripLicenseHeader(raw);
117+
const escaped = escapeBraces(stripped);
118+
const rewritten = rewriteLinks(escaped);
119+
const content = `${file.frontmatter}\n\n${rewritten}`;
119120

120-
mkdirSync(dirname(outPath), { recursive: true });
121-
writeFileSync(outPath, content);
122-
console.log(` Wrote ${file.out}`);
123-
} catch (err) {
124-
if (existsSync(outPath)) {
125-
console.warn(` Warning: failed to fetch ${file.remote} (${err.message}), using existing file`);
126-
} else {
127-
console.error(` Error: failed to fetch ${file.remote} and no cached file exists`);
128-
process.exit(1);
121+
mkdirSync(dirname(outPath), { recursive: true });
122+
writeFileSync(outPath, content);
123+
console.log(` Wrote ${file.out}`);
124+
} catch (err) {
125+
if (existsSync(outPath)) {
126+
console.warn(` Warning: failed to fetch ${file.remote} (${err.message}), using existing file`);
127+
} else {
128+
console.error(` Error: failed to fetch ${file.remote} and no cached file exists`);
129+
process.exit(1);
130+
}
129131
}
130-
}
131-
}
132+
})
133+
);
132134

133135
console.log("sync-tagotip: done.");
134136
}

src/pages/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import useBaseUrl from "@docusaurus/useBaseUrl";
44
import HomepageFeatures from "@site/src/components/HomepageFeatures";
55
import Heading from "@theme/Heading";
66
import Layout from "@theme/Layout";
7-
import clsx from "clsx";
7+
import { clsx } from "clsx";
88
import type { ReactNode } from "react";
99

1010
import styles from "./index.module.css";
@@ -37,6 +37,7 @@ function HomepageHeader() {
3737
title="System status"
3838
loading="lazy"
3939
referrerPolicy="no-referrer"
40+
sandbox="allow-scripts"
4041
/>
4142
<iframe
4243
className="status-badge--dark"
@@ -48,6 +49,7 @@ function HomepageHeader() {
4849
title="System status"
4950
loading="lazy"
5051
referrerPolicy="no-referrer"
52+
sandbox="allow-scripts"
5153
/>
5254
</div>
5355
<div className={styles.buttons}>

0 commit comments

Comments
 (0)