From 8e143e860258bedc328af931d4a471c062de56d3 Mon Sep 17 00:00:00 2001 From: OrJDev Date: Sat, 12 Nov 2022 17:38:42 +0200 Subject: [PATCH] 1.0.70 --- package.json | 2 +- src/helpers/utils/getIndexPage.ts | 6 ++---- src/installers/Prisma/files/client.txt | 1 + src/vercel.ts | 4 ++-- template/base/.eslintrc.json | 14 ++++++++++++++ template/base/package.json | 9 +++++++-- template/base/vite.config.ts | 2 +- 7 files changed, 28 insertions(+), 10 deletions(-) create mode 100644 template/base/.eslintrc.json diff --git a/package.json b/package.json index adcee2e..441ec6a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "create-jd-app", - "version": "1.0.69", + "version": "1.0.70", "main": "dist/index.js", "scripts": { "test": "ts-node -r tsconfig-paths/register src", diff --git a/src/helpers/utils/getIndexPage.ts b/src/helpers/utils/getIndexPage.ts index 95f8c72..3fa1ae8 100644 --- a/src/helpers/utils/getIndexPage.ts +++ b/src/helpers/utils/getIndexPage.ts @@ -8,16 +8,14 @@ const getIndexPage: IUtil = (ctx) => { const withStyles = getStyle(uswTW, "font-bold text-2xl text-gray-500"); const innerRes = getRes(ctx, shouldUsePrisma, useTRPC); const innerContent = getContent(withStyles, shouldUsePrisma, useTRPC); - return `import { ParentComponent${ + return `import { type ParentComponent${ useTRPC || shouldUsePrisma ? ", Switch, Match" : "" }${shouldUsePrisma ? ", createResource" : ""} } from "solid-js"; import { Title } from "solid-start";${ useTRPC ? '\nimport { trpc } from "~/utils/trpc"' : "" } -interface IHomeProps {} - -const Home: ParentComponent = ({}) => {${innerRes} +const Home: ParentComponent = () => {${innerRes} return ( <> Home diff --git a/src/installers/Prisma/files/client.txt b/src/installers/Prisma/files/client.txt index 6d1e656..f9b9b4a 100644 --- a/src/installers/Prisma/files/client.txt +++ b/src/installers/Prisma/files/client.txt @@ -2,6 +2,7 @@ import { PrismaClient } from "@prisma/client"; import env from "~/env/server"; declare global { + // eslint-disable-next-line no-var var prisma: PrismaClient | undefined; } diff --git a/src/vercel.ts b/src/vercel.ts index ee72a50..a52eb06 100644 --- a/src/vercel.ts +++ b/src/vercel.ts @@ -1,10 +1,10 @@ import { IPkg, IEnv } from "~types"; export const config = `import solid from "solid-start/vite"; +import dotenv from "dotenv"; import { defineConfig } from "vite"; -// @ts-ignore +// @ts-expect-error no typing import vercel from "solid-start-vercel"; -import dotenv from "dotenv"; export default defineConfig(() => { dotenv.config(); diff --git a/template/base/.eslintrc.json b/template/base/.eslintrc.json new file mode 100644 index 0000000..80d4f31 --- /dev/null +++ b/template/base/.eslintrc.json @@ -0,0 +1,14 @@ +{ + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "./tsconfig.json" + }, + "plugins": ["@typescript-eslint"], + "extends": [ + "plugin:solid/typescript", + "plugin:@typescript-eslint/recommended" + ], + "rules": { + "@typescript-eslint/consistent-type-imports": "warn" + } +} diff --git a/template/base/package.json b/template/base/package.json index a015d85..1025d58 100644 --- a/template/base/package.json +++ b/template/base/package.json @@ -3,13 +3,18 @@ "scripts": { "dev": "solid-start dev", "build": "solid-start build", - "start": "solid-start start" + "start": "solid-start start", + "lint": "eslint --fix \"**/*.{ts,tsx,js,jsx}\"" }, "type": "module", "devDependencies": { "solid-start-node": "^0.2.1", "typescript": "^4.8.3", - "vite": "^3.1.0" + "vite": "^3.1.0", + "@typescript-eslint/eslint-plugin": "^5.42.1", + "@typescript-eslint/parser": "^5.42.1", + "eslint": "^8.27.0", + "eslint-plugin-solid": "^0.8.0" }, "dependencies": { "@solidjs/meta": "^0.28.0", diff --git a/template/base/vite.config.ts b/template/base/vite.config.ts index 7af8ffc..873d6c1 100644 --- a/template/base/vite.config.ts +++ b/template/base/vite.config.ts @@ -1,6 +1,6 @@ import solid from "solid-start/vite"; -import { defineConfig } from "vite"; import dotenv from "dotenv"; +import { defineConfig } from "vite"; export default defineConfig(() => { dotenv.config();