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:
parent
f55f3e8c31
commit
7d4796c8eb
8 changed files with 22 additions and 20 deletions
|
@ -7,6 +7,8 @@
|
|||
"test": "test"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint . --max-warnings 0",
|
||||
"check-types": "tsc --noEmit",
|
||||
"test": "ts-node --test test/**/*.test.ts",
|
||||
"start": "node dist/index.js",
|
||||
"dev": "nodemon --delay 2000ms src/index.ts",
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"lint": "eslint . --max-warnings 0",
|
||||
"check-types": "tsc --noEmit",
|
||||
"dev": "vite",
|
||||
"build": "tsc -b && vite build",
|
||||
"preview": "vite preview"
|
||||
|
|
|
@ -13,11 +13,15 @@ export const config = [
|
|||
{
|
||||
files: ['**/*.{ts,tsx}'],
|
||||
...solid,
|
||||
ignores: ['turbo/generators/**'],
|
||||
languageOptions: {
|
||||
parser: tsParser,
|
||||
parserOptions: {
|
||||
project: 'tsconfig.json',
|
||||
},
|
||||
globals: {
|
||||
window: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
"exports": {
|
||||
"./*": "./src/*.tsx"
|
||||
},
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"lint": "eslint . --max-warnings 0",
|
||||
"generate:component": "turbo gen react-component",
|
||||
|
|
|
@ -8,13 +8,13 @@ interface ButtonProps {
|
|||
appName: string;
|
||||
}
|
||||
|
||||
export const Button = ({ children, className, appName }: ButtonProps) => {
|
||||
export const Button = (props: ButtonProps) => {
|
||||
return (
|
||||
<button
|
||||
class={className}
|
||||
onClick={() => alert(`Hello from your ${appName} app!`)}
|
||||
class={props.className}
|
||||
onClick={() => window.alert(`Hello from your ${props.appName} app!`)}
|
||||
>
|
||||
{children}
|
||||
{props.children}
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
import { type JSX } from 'solid-js/jsx-runtime';
|
||||
|
||||
export function Card({
|
||||
className,
|
||||
title,
|
||||
children,
|
||||
href,
|
||||
}: {
|
||||
export function Card(props: {
|
||||
className?: string;
|
||||
title: string;
|
||||
children: JSX.Element;
|
||||
|
@ -13,15 +8,15 @@ export function Card({
|
|||
}): JSX.Element {
|
||||
return (
|
||||
<a
|
||||
class={className}
|
||||
href={`${href}?utm_source=create-turbo&utm_medium=basic&utm_campaign=create-turbo"`}
|
||||
class={props.className}
|
||||
href={`${props.href}?utm_source=create-turbo&utm_medium=basic&utm_campaign=create-turbo"`}
|
||||
rel='noopener noreferrer'
|
||||
target='_blank'
|
||||
>
|
||||
<h2>
|
||||
{title} <span>-></span>
|
||||
{props.title} <span>-></span>
|
||||
</h2>
|
||||
<p>{children}</p>
|
||||
<p>{props.children}</p>
|
||||
</a>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
import { type JSX } from 'solid-js/jsx-runtime';
|
||||
|
||||
export function Code({
|
||||
children,
|
||||
className,
|
||||
}: {
|
||||
export function Code(props: {
|
||||
children: JSX.Element;
|
||||
className?: string;
|
||||
}): JSX.Element {
|
||||
return <code class={className}>{children}</code>;
|
||||
return <code class={props.className}>{props.children}</code>;
|
||||
}
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
"compilerOptions": {
|
||||
"outDir": "dist"
|
||||
},
|
||||
"include": ["src"]
|
||||
"include": ["src"],
|
||||
"exclude": ["turbo/generators"]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue