mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-12 15:52:56 +10:00
Update ESLint configuration and schemas to use Zod library
- Changed ESLint configuration to target TypeScript files and added parser options for better integration. - Updated various schemas across the application to replace `nestjs-zod/z` imports with `zod` for consistency. - Refactored password validation in authentication schemas to use `z.string()` instead of `z.password()`. - Enhanced date handling in user and resume schemas by introducing a new `dateSchema` utility. - Updated `.ncurc.json` to target minor upgrades for dependencies.
This commit is contained in:
@ -3,11 +3,14 @@
|
||||
"ignorePatterns": ["!**/*"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||
"files": ["*.ts", "*.tsx"],
|
||||
"extends": [
|
||||
"plugin:tailwindcss/recommended",
|
||||
"plugin:@tanstack/eslint-plugin-query/recommended"
|
||||
],
|
||||
"parserOptions": {
|
||||
"projectService": "./apps/client/tsconfig.json"
|
||||
},
|
||||
"settings": {
|
||||
"tailwindcss": {
|
||||
"callees": ["cn", "clsx", "cva"],
|
||||
@ -39,8 +42,59 @@
|
||||
"lingui/no-unlocalized-strings": [
|
||||
2,
|
||||
{
|
||||
"ignoreFunction": ["cn"],
|
||||
"ignoreAttribute": ["alt"]
|
||||
"ignore": [
|
||||
// Ignore strings which are a single "word" (no spaces)
|
||||
// and doesn't start with an uppercase letter
|
||||
"^(?![A-Z])\\S+$",
|
||||
// Ignore UPPERCASE literals
|
||||
// Example: const test = "FOO"
|
||||
"^[A-Z0-9_-]+$"
|
||||
],
|
||||
"ignoreNames": [
|
||||
// Ignore matching className (case-insensitive)
|
||||
{ "regex": { "pattern": "className", "flags": "i" } },
|
||||
// Ignore UPPERCASE names
|
||||
// Example: test.FOO = "ola!"
|
||||
{ "regex": { "pattern": "^[A-Z0-9_-]+$" } },
|
||||
"id",
|
||||
"src",
|
||||
"srcSet",
|
||||
"styleName",
|
||||
"placeholder",
|
||||
"alt",
|
||||
"type",
|
||||
"width",
|
||||
"height",
|
||||
"displayName",
|
||||
"Authorization"
|
||||
],
|
||||
"ignoreFunctions": [
|
||||
"cn",
|
||||
"cva",
|
||||
"track",
|
||||
"Error",
|
||||
"console.*",
|
||||
"*headers.set",
|
||||
"*.addEventListener",
|
||||
"*.removeEventListener",
|
||||
"*.postMessage",
|
||||
"*.getElementById",
|
||||
"*.dispatch",
|
||||
"*.commit",
|
||||
"*.includes",
|
||||
"*.indexOf",
|
||||
"*.endsWith",
|
||||
"*.startsWith",
|
||||
"require"
|
||||
],
|
||||
// Following settings require typed linting https://typescript-eslint.io/getting-started/typed-linting/
|
||||
"useTsTypes": true,
|
||||
"ignoreMethodsOnTypes": [
|
||||
// Ignore specified methods on Map and Set types
|
||||
"Map.get",
|
||||
"Map.has",
|
||||
"Set.has"
|
||||
]
|
||||
}
|
||||
],
|
||||
"lingui/t-call-in-function": 2,
|
||||
|
||||
@ -18,7 +18,7 @@ import {
|
||||
verticalListSortingStrategy,
|
||||
} from "@dnd-kit/sortable";
|
||||
import { CSS } from "@dnd-kit/utilities";
|
||||
import { t, Trans } from "@lingui/macro";
|
||||
import { t } from "@lingui/macro";
|
||||
import { ArrowCounterClockwise, DotsSixVertical, Plus, TrashSimple } from "@phosphor-icons/react";
|
||||
import { defaultMetadata } from "@reactive-resume/schema";
|
||||
import { Button, Portal, Tooltip } from "@reactive-resume/ui";
|
||||
@ -92,9 +92,7 @@ type SectionProps = {
|
||||
};
|
||||
|
||||
const Section = ({ id, isDragging = false }: SectionProps) => {
|
||||
const name = useResumeStore((state) =>
|
||||
get(state.resume.data.sections, `${id}.name`, id),
|
||||
) as string;
|
||||
const name = useResumeStore((state) => get(state.resume.data.sections, `${id}.name`, id));
|
||||
|
||||
return (
|
||||
<div
|
||||
@ -229,13 +227,12 @@ export const LayoutSection = () => {
|
||||
|
||||
const main = page[0];
|
||||
const sidebar = page[1];
|
||||
const pageNumber = pageIndex + 1;
|
||||
|
||||
return (
|
||||
<div key={pageIndex} className="rounded border p-3 pb-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<p className="mb-3 text-xs font-bold">
|
||||
<Trans>Page {pageIndex + 1}</Trans>
|
||||
</p>
|
||||
<p className="mb-3 text-xs font-bold">{t`Page ${pageNumber}`}</p>
|
||||
|
||||
{pageIndex !== 0 && (
|
||||
<Tooltip content={t`Remove Page`}>
|
||||
|
||||
Reference in New Issue
Block a user