Skip to content

Commit

Permalink
Fix lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredpalmer committed Nov 15, 2024
1 parent 9324ec6 commit 07cf9ac
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/(chat)/api/history/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export async function GET() {
return Response.json('Unauthorized!', { status: 401 });
}

// biome-ignore lint: Forbidden non-null assertion.
const chats = await getChatsByUserId({ id: session.user.id! });
return Response.json(chats);
}
129 changes: 129 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"files": {
"ignoreUnknown": false,
"ignore": [
"**/pnpm-lock.yaml",
"lib/db/migrations",
"lib/editor/react-renderer.tsx",
"node_modules",
".next",
"public",
".vercel"
]
},
"vcs": {
"enabled": true,
"clientKind": "git",
"defaultBranch": "main",
"useIgnoreFile": true
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 80,
"attributePosition": "auto"
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"a11y": {
"useHtmlLang": "warn",
"noHeaderScope": "warn",
"useValidAriaRole": {
"level": "warn",
"options": {
"ignoreNonDom": false,
"allowInvalidRoles": ["none", "text"]
}
},
"useSemanticElements": "off",
"noSvgWithoutTitle": "off",
"useMediaCaption": "off",
"noAutofocus": "off",
"noBlankTarget": "off"
},
"complexity": {
"noUselessStringConcat": "warn",
"noForEach": "off",
"noUselessSwitchCase": "off",
"noUselessThisAlias": "off"
},
"correctness": {
"noUnusedImports": "warn",
"useArrayLiterals": "warn",
"noNewSymbol": "warn",
"useJsxKeyInIterable": "off",
"useExhaustiveDependencies": "off",
"noUnnecessaryContinue": "off"
},
"security": {
"noDangerouslySetInnerHtml": "off"
},
"style": {
"useFragmentSyntax": "warn",
"noYodaExpression": "warn",
"useDefaultParameterLast": "warn",
"useExponentiationOperator": "off",
"noUnusedTemplateLiteral": "off",
"noUselessElse": "off"
},
"suspicious": {
"noExplicitAny": "off"
},
"nursery": {
"noStaticElementInteractions": "warn",
"noHeadImportInDocument": "warn",
"noDocumentImportInPage": "warn",
"noDuplicateElseIf": "warn",
"noIrregularWhitespace": "warn",
"useValidAutocomplete": "warn"
}
}
},
"javascript": {
"jsxRuntime": "reactClassic",
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingCommas": "all",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSpacing": true,
"bracketSameLine": false,
"quoteStyle": "single",
"attributePosition": "auto"
}
},
"json": {
"formatter": {
"enabled": true,
"trailingCommas": "none"
},
"parser": {
"allowComments": true,
"allowTrailingCommas": false
}
},
"css": {
"formatter": { "enabled": false },
"linter": { "enabled": false }
},
"organizeImports": { "enabled": false },
"overrides": [
{
"include": ["playwright/**", "tooling/playwright/src/test/test.ts"],
"linter": {
"rules": {
"correctness": {
"noEmptyPattern": "off"
}
}
}
}
]
}
5 changes: 3 additions & 2 deletions components/document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ export function DocumentToolResult({
setBlock,
}: DocumentToolResultProps) {
return (
<div
<button
type="button"
className="bg-background cursor-pointer border py-2 px-3 rounded-xl w-fit flex flex-row gap-3 items-start"
onClick={(event) => {
const rect = event.currentTarget.getBoundingClientRect();
Expand Down Expand Up @@ -64,7 +65,7 @@ export function DocumentToolResult({
<div className="">
{getActionText(type)} {result.title}
</div>
</div>
</button>
);
}

Expand Down

0 comments on commit 07cf9ac

Please sign in to comment.