chore: update package.json and TypeScript configuration across multiple packages

- Added linting and type-checking scripts to package.json for api, web, and ui packages.
- Updated ESLint configuration to ignore specific directories and added global window variable.
- Modified TypeScript configuration for ui package to exclude turbo generators.
- Refactored Button, Card, and Code components to use props for better readability and consistency.
This commit is contained in:
Juan Sebastián Montoya 2025-05-06 00:35:39 -05:00
parent f55f3e8c31
commit 7d4796c8eb
8 changed files with 22 additions and 20 deletions

View file

@ -7,6 +7,8 @@
"test": "test" "test": "test"
}, },
"scripts": { "scripts": {
"lint": "eslint . --max-warnings 0",
"check-types": "tsc --noEmit",
"test": "ts-node --test test/**/*.test.ts", "test": "ts-node --test test/**/*.test.ts",
"start": "node dist/index.js", "start": "node dist/index.js",
"dev": "nodemon --delay 2000ms src/index.ts", "dev": "nodemon --delay 2000ms src/index.ts",

View file

@ -4,6 +4,8 @@
"version": "0.0.0", "version": "0.0.0",
"type": "module", "type": "module",
"scripts": { "scripts": {
"lint": "eslint . --max-warnings 0",
"check-types": "tsc --noEmit",
"dev": "vite", "dev": "vite",
"build": "tsc -b && vite build", "build": "tsc -b && vite build",
"preview": "vite preview" "preview": "vite preview"

View file

@ -13,11 +13,15 @@ export const config = [
{ {
files: ['**/*.{ts,tsx}'], files: ['**/*.{ts,tsx}'],
...solid, ...solid,
ignores: ['turbo/generators/**'],
languageOptions: { languageOptions: {
parser: tsParser, parser: tsParser,
parserOptions: { parserOptions: {
project: 'tsconfig.json', project: 'tsconfig.json',
}, },
globals: {
window: true,
},
}, },
}, },
]; ];

View file

@ -5,6 +5,7 @@
"exports": { "exports": {
"./*": "./src/*.tsx" "./*": "./src/*.tsx"
}, },
"type": "module",
"scripts": { "scripts": {
"lint": "eslint . --max-warnings 0", "lint": "eslint . --max-warnings 0",
"generate:component": "turbo gen react-component", "generate:component": "turbo gen react-component",

View file

@ -8,13 +8,13 @@ interface ButtonProps {
appName: string; appName: string;
} }
export const Button = ({ children, className, appName }: ButtonProps) => { export const Button = (props: ButtonProps) => {
return ( return (
<button <button
class={className} class={props.className}
onClick={() => alert(`Hello from your ${appName} app!`)} onClick={() => window.alert(`Hello from your ${props.appName} app!`)}
> >
{children} {props.children}
</button> </button>
); );
}; };

View file

@ -1,11 +1,6 @@
import { type JSX } from 'solid-js/jsx-runtime'; import { type JSX } from 'solid-js/jsx-runtime';
export function Card({ export function Card(props: {
className,
title,
children,
href,
}: {
className?: string; className?: string;
title: string; title: string;
children: JSX.Element; children: JSX.Element;
@ -13,15 +8,15 @@ export function Card({
}): JSX.Element { }): JSX.Element {
return ( return (
<a <a
class={className} class={props.className}
href={`${href}?utm_source=create-turbo&utm_medium=basic&utm_campaign=create-turbo"`} href={`${props.href}?utm_source=create-turbo&utm_medium=basic&utm_campaign=create-turbo"`}
rel='noopener noreferrer' rel='noopener noreferrer'
target='_blank' target='_blank'
> >
<h2> <h2>
{title} <span>-&gt;</span> {props.title} <span>-&gt;</span>
</h2> </h2>
<p>{children}</p> <p>{props.children}</p>
</a> </a>
); );
} }

View file

@ -1,11 +1,8 @@
import { type JSX } from 'solid-js/jsx-runtime'; import { type JSX } from 'solid-js/jsx-runtime';
export function Code({ export function Code(props: {
children,
className,
}: {
children: JSX.Element; children: JSX.Element;
className?: string; className?: string;
}): JSX.Element { }): JSX.Element {
return <code class={className}>{children}</code>; return <code class={props.className}>{props.children}</code>;
} }

View file

@ -3,5 +3,6 @@
"compilerOptions": { "compilerOptions": {
"outDir": "dist" "outDir": "dist"
}, },
"include": ["src"] "include": ["src"],
"exclude": ["turbo/generators"]
} }