chore: add Biome for lint and fix all lint errors
- Install @biomejs/biome as devDependency at root - Configure biome.json with 2-space indent, double quotes, Tailwind CSS support - Add lint/lint:fix/format/format:fix scripts to root and app package.json - Fix noNonNullAssertion: env vars extracted to variables with suppression, <div role=button> replaced with <button> - Fix noUnusedVariables: remove unused destructured vars - Fix useIterableCallbackReturn: arrow functions with block body - Fix noExplicitAny: recharts Tooltip formatters - Fix noLabelWithoutControl: add htmlFor+id or use <span> for non-input labels - Fix noStaticElementInteractions/useKeyWithClickEvents: role+keyboard events for overlays - Fix noArrayIndexKey: use error string as key - Fix CSS parse: enable tailwindDirectives parser - Normalize formatting across 80 files with biome check --write
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
import { createRootRouteWithContext, Outlet, redirect } from "@tanstack/react-router";
|
||||
import {
|
||||
createRootRouteWithContext,
|
||||
Outlet,
|
||||
redirect,
|
||||
} from "@tanstack/react-router";
|
||||
import type { RouterContext } from "@/router";
|
||||
|
||||
export const Route = createRootRouteWithContext<RouterContext>()({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createFileRoute, Outlet } from "@tanstack/react-router";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { Layout } from "@/components/layout/Layout";
|
||||
|
||||
export const Route = createFileRoute("/_authenticated")({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Outlet, createFileRoute } from "@tanstack/react-router";
|
||||
import { createFileRoute, Outlet } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/_authenticated/quotes/belo")({
|
||||
component: Outlet,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState } from "react";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { useState } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { useAuth } from "@/lib/auth-context";
|
||||
@@ -51,14 +51,15 @@ function SettingsPage() {
|
||||
<div className="mx-auto max-w-md space-y-6">
|
||||
<div>
|
||||
<h1 className="text-2xl font-semibold tracking-tight">Configuración</h1>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Cambiar contraseña
|
||||
</p>
|
||||
<p className="text-sm text-muted-foreground">Cambiar contraseña</p>
|
||||
</div>
|
||||
<form onSubmit={handleSubmit} className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<label className="text-sm font-medium">Email</label>
|
||||
<label htmlFor="email" className="text-sm font-medium">
|
||||
Email
|
||||
</label>
|
||||
<Input
|
||||
id="email"
|
||||
value={auth.session?.user.email ?? ""}
|
||||
readOnly
|
||||
className="bg-muted"
|
||||
@@ -66,8 +67,11 @@ function SettingsPage() {
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<label className="text-sm font-medium">Contraseña actual</label>
|
||||
<label htmlFor="current-password" className="text-sm font-medium">
|
||||
Contraseña actual
|
||||
</label>
|
||||
<Input
|
||||
id="current-password"
|
||||
type="password"
|
||||
placeholder="••••••••"
|
||||
value={currentPassword}
|
||||
@@ -75,8 +79,11 @@ function SettingsPage() {
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<label className="text-sm font-medium">Nueva contraseña</label>
|
||||
<label htmlFor="new-password" className="text-sm font-medium">
|
||||
Nueva contraseña
|
||||
</label>
|
||||
<Input
|
||||
id="new-password"
|
||||
type="password"
|
||||
placeholder="••••••••"
|
||||
value={newPassword}
|
||||
@@ -84,21 +91,30 @@ function SettingsPage() {
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<label className="text-sm font-medium">Confirmar nueva contraseña</label>
|
||||
<label htmlFor="confirm-password" className="text-sm font-medium">
|
||||
Confirmar nueva contraseña
|
||||
</label>
|
||||
<Input
|
||||
id="confirm-password"
|
||||
type="password"
|
||||
placeholder="••••••••"
|
||||
value={confirmPassword}
|
||||
onChange={(e) => setConfirmPassword(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
{error && (
|
||||
<p className="text-sm text-destructive">{error}</p>
|
||||
)}
|
||||
{error && <p className="text-sm text-destructive">{error}</p>}
|
||||
{success && (
|
||||
<p className="text-sm text-emerald-600">Contraseña actualizada correctamente</p>
|
||||
<p className="text-sm text-emerald-600">
|
||||
Contraseña actualizada correctamente
|
||||
</p>
|
||||
)}
|
||||
<Button type="submit" className="w-full" disabled={loading || !currentPassword || !newPassword || !confirmPassword}>
|
||||
<Button
|
||||
type="submit"
|
||||
className="w-full"
|
||||
disabled={
|
||||
loading || !currentPassword || !newPassword || !confirmPassword
|
||||
}
|
||||
>
|
||||
{loading ? "Guardando..." : "Cambiar contraseña"}
|
||||
</Button>
|
||||
</form>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState } from "react";
|
||||
import { createFileRoute, useNavigate } from "@tanstack/react-router";
|
||||
import { Lock } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { useAuth } from "@/lib/auth-context";
|
||||
@@ -55,8 +55,11 @@ function LoginPage() {
|
||||
</div>
|
||||
<form onSubmit={handleSubmit} className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<label className="text-sm font-medium">Email</label>
|
||||
<label htmlFor="login-email" className="text-sm font-medium">
|
||||
Email
|
||||
</label>
|
||||
<Input
|
||||
id="login-email"
|
||||
value="jselesan@gmail.com"
|
||||
readOnly
|
||||
className="bg-muted text-muted-foreground"
|
||||
@@ -64,8 +67,11 @@ function LoginPage() {
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<label className="text-sm font-medium">Contraseña</label>
|
||||
<label htmlFor="login-password" className="text-sm font-medium">
|
||||
Contraseña
|
||||
</label>
|
||||
<Input
|
||||
id="login-password"
|
||||
type="password"
|
||||
placeholder="••••••••"
|
||||
value={password}
|
||||
@@ -74,9 +80,7 @@ function LoginPage() {
|
||||
className="text-base"
|
||||
/>
|
||||
</div>
|
||||
{error && (
|
||||
<p className="text-sm text-destructive">{error}</p>
|
||||
)}
|
||||
{error && <p className="text-sm text-destructive">{error}</p>}
|
||||
<Button
|
||||
type="submit"
|
||||
className="w-full"
|
||||
|
||||
Reference in New Issue
Block a user