Skip to content

Commit

Permalink
Enable all biome rules
Browse files Browse the repository at this point in the history
  • Loading branch information
mellevanderlinde committed Jan 10, 2025
1 parent 01c1036 commit 2a9b037
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
2 changes: 2 additions & 0 deletions apps/infra/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ interface Event {
request: Request;
}

// biome-ignore lint/correctness/noUnusedVariables: used by CloudFront
// biome-ignore lint/suspicious/useAwait: required by CloudFront
async function handler(event: Event): Promise<Request> {
const request = event.request;
const uri = request.uri;
Expand Down
4 changes: 3 additions & 1 deletion apps/website/__tests__/components.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ test("Match robots", () => {
test("Match sitemap", () => {
const result = sitemap();
// Change to static date for snapshot
for (const item of result) item.lastModified = "2024-01-01T00:00:00.000Z";
for (const item of result) {
item.lastModified = "2024-01-01T00:00:00.000Z";
}
expect(result).toMatchSnapshot();
});
2 changes: 1 addition & 1 deletion apps/website/app/work/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function Page(): ReactNode {
<section>
<Header1 title="Work" />
<div className="space-y-6">
{jobs.map((job, index) => (
{jobs.map((job) => (
<div className="flex flex-col" key={job.title}>
<div className="w-full flex justify-between items-baseline">
<span className="text-black dark:text-white font-medium tracking-tight">
Expand Down
10 changes: 9 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"ignore": [
".next",
".turbo",
"cdk.out",
"apps/infra/**/*.js",
"apps/infra/**/*.d.ts",
"apps/website/out"
Expand All @@ -25,7 +26,14 @@
"linter": {
"enabled": true,
"rules": {
"recommended": true
"all": true,
"correctness": {
"noUndeclaredDependencies": "off",
"useImportExtensions": "off",
"noNodejsModules": "off"
},
"style": { "useNamingConvention": "off", "noDefaultExport": "off" },
"suspicious": { "noReactSpecificProps": "off" }
}
},
"javascript": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"scripts": {
"ci": "turbo lint build test",
"dev": "turbo dev",
"lint": "biome check",
"lint": "biome check --error-on-warnings",
"test:update": "turbo test:update"
},
"devDependencies": {
Expand Down
4 changes: 3 additions & 1 deletion packages/reading-time/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export function getReadingTime(content: string): number {
if (!content) throw new Error("Content is required");
if (!content) {
throw new Error("Content is required");
}
const wordsPerMinute = 250;
const content_ = content.replace(/\n/g, " ");
const words = content_.split(" ").filter((word) => word !== "");
Expand Down

0 comments on commit 2a9b037

Please sign in to comment.