mirror of
https://github.com/Dvorinka/Dash.git
synced 2026-10-29 00:01:24 +00:00
feat: phase 0 foundation — monorepo scaffold, backend, frontend, CI, docker
Establishes the skeleton every later phase builds on: Go+Gin API with zap logging, /api/healthz, SQLite+goose runner; Vite+React18+TS strict+ Tailwind v4 frontend with bento-mono theme tokens; openapi.yaml driving a generated TS client; oxlint with vendored anti-slop rules; GitHub CI; multi-stage Dockerfile -> 33.6MB distroless image; docker compose up serves the blank board. Generated with [Devin](https://devin.ai) Authored By: TDvorak <[email protected]> Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
e7f32949e9
commit
b60821350a
46 files changed
+6415
-10
No files matched your search
@@ -0,0 +1,49 @@
|
||||
import type { ESTree, SourceCode } from "@oxlint/plugins";
|
||||
|
||||
export type FunctionParameter = ESTree.ParamPattern;
|
||||
|
||||
/** Return whether a type is or contains TypeScript's absorbing unknown top type. */
|
||||
export function containsUnknownType(type: ESTree.TSType): boolean {
|
||||
if (type.type === "TSUnknownKeyword") return true;
|
||||
if (type.type === "TSParenthesizedType") return containsUnknownType(type.typeAnnotation);
|
||||
return type.type === "TSUnionType" && type.types.some(containsUnknownType);
|
||||
}
|
||||
|
||||
/** Return the TypeScript annotation attached to a function parameter or its wrapped binding. */
|
||||
export function functionParameterTypeAnnotation(
|
||||
parameter: FunctionParameter,
|
||||
): ESTree.TSTypeAnnotation | null | undefined {
|
||||
if (parameter.type === "TSParameterProperty") {
|
||||
return functionParameterTypeAnnotation(parameter.parameter);
|
||||
}
|
||||
if (parameter.type === "RestElement") {
|
||||
return parameter.typeAnnotation ?? functionParameterTypeAnnotation(parameter.argument);
|
||||
}
|
||||
if (parameter.type === "AssignmentPattern") {
|
||||
return parameter.typeAnnotation ?? functionParameterTypeAnnotation(parameter.left);
|
||||
}
|
||||
return parameter.typeAnnotation;
|
||||
}
|
||||
|
||||
/** Return only a function parameter's local binding, excluding its annotation and default value. */
|
||||
export function functionParameterBindingName(
|
||||
parameter: FunctionParameter,
|
||||
sourceCode: SourceCode,
|
||||
): string {
|
||||
if (parameter.type === "TSParameterProperty") {
|
||||
return functionParameterBindingName(parameter.parameter, sourceCode);
|
||||
}
|
||||
if (parameter.type === "AssignmentPattern") {
|
||||
return functionParameterBindingName(parameter.left, sourceCode);
|
||||
}
|
||||
if (parameter.type === "RestElement") {
|
||||
return functionParameterBindingName(parameter.argument, sourceCode);
|
||||
}
|
||||
if (parameter.type === "Identifier") return parameter.name;
|
||||
|
||||
const sourceText = sourceCode.getText(parameter);
|
||||
const annotationStart = parameter.typeAnnotation?.start;
|
||||
return annotationStart === undefined
|
||||
? sourceText
|
||||
: sourceText.slice(0, annotationStart - parameter.start).trimEnd();
|
||||
}
|
||||
Reference in new issue
Block a user