From 563d40653864ec937166bec89a63dfd43521facd Mon Sep 17 00:00:00 2001 From: Thibault Le Ouay Date: Thu, 29 Jun 2023 13:14:31 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Lint=20(#9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ๐Ÿšง wip database schema * ๐Ÿšง wip database schema * ๐Ÿšง wip database schema * ๐Ÿšง wip database schema * ๐Ÿšง clerk and trpc * ๐Ÿš€ clerk * ๐ŸŸข * ๐Ÿš€ trpc * ๐Ÿš€ convert to localpackage * ๐Ÿ”“ pnpm lockfile * ๐Ÿงน lint * ๐ŸŸข fix build * ๐Ÿ“ linting * ๐Ÿš‘ Middleware --- .eslintrc.cjs | 21 + .eslintrc.js | 10 - apps/docs/.eslintrc.js | 4 - apps/docs/.gitignore | 34 -- apps/docs/README.md | 30 - apps/docs/app/layout.tsx | 11 - apps/docs/app/page.tsx | 10 - apps/docs/next-env.d.ts | 5 - apps/docs/next.config.js | 4 - apps/docs/package.json | 25 - apps/docs/tsconfig.json | 8 - apps/web/.eslintrc.js | 4 - apps/web/package.json | 2 +- apps/web/src/app/_components/background.tsx | 9 +- apps/web/src/app/_components/hero-form.tsx | 4 +- .../web/src/app/_components/submit-button.tsx | 6 +- apps/web/src/app/action.ts | 20 +- apps/web/src/app/api/og/route.tsx | 6 +- apps/web/src/app/api/send/route.ts | 2 +- apps/web/src/app/api/webhook/clerk/route.ts | 10 +- apps/web/src/app/layout.tsx | 8 +- apps/web/src/app/page.tsx | 32 +- apps/web/src/components/ui/badge.tsx | 15 +- apps/web/src/components/ui/button.tsx | 27 +- apps/web/src/components/ui/command.tsx | 78 +-- apps/web/src/components/ui/dialog.tsx | 18 +- apps/web/src/components/ui/input.tsx | 9 +- apps/web/src/components/ui/table.tsx | 14 +- apps/web/src/components/ui/toast.tsx | 59 +- apps/web/src/components/ui/use-toast.ts | 126 ++-- apps/web/src/lib/utils.ts | 3 +- apps/web/src/middleware.ts | 1 + package.json | 4 +- packages/api/src/router/clerk/type.ts | 2 +- packages/api/src/router/clerk/webhook.ts | 5 +- packages/api/src/router/workspace.ts | 3 +- packages/api/src/trpc.ts | 1 - packages/config/eslint/index.js | 50 ++ packages/config/eslint/package.json | 24 + packages/db/drizzle.config.ts | 1 + packages/db/src/db.ts | 6 +- packages/db/src/schema/incident.ts | 7 +- packages/db/src/schema/index.ts | 2 - packages/db/src/schema/monitor.ts | 8 +- packages/db/src/schema/page.ts | 10 +- packages/db/src/schema/user.ts | 3 +- packages/db/src/schema/workspace.ts | 3 +- packages/eslint-config-custom/index.js | 18 - packages/eslint-config-custom/package.json | 23 - packages/tinybird/src/client.ts | 2 +- packages/ui/package.json | 2 +- pnpm-lock.yaml | 567 +++++++++++++----- pnpm-workspace.yaml | 1 + prettier.config.cjs | 31 + 54 files changed, 804 insertions(+), 584 deletions(-) create mode 100644 .eslintrc.cjs delete mode 100644 .eslintrc.js delete mode 100644 apps/docs/.eslintrc.js delete mode 100644 apps/docs/.gitignore delete mode 100644 apps/docs/README.md delete mode 100644 apps/docs/app/layout.tsx delete mode 100644 apps/docs/app/page.tsx delete mode 100644 apps/docs/next-env.d.ts delete mode 100644 apps/docs/next.config.js delete mode 100644 apps/docs/package.json delete mode 100644 apps/docs/tsconfig.json delete mode 100644 apps/web/.eslintrc.js create mode 100644 packages/config/eslint/index.js create mode 100644 packages/config/eslint/package.json delete mode 100644 packages/eslint-config-custom/index.js delete mode 100644 packages/eslint-config-custom/package.json create mode 100644 prettier.config.cjs diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 000000000..f17447442 --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,21 @@ +/** @type {import("eslint").Linter.Config} */ +const config = { + root: true, + extends: ["@openstatus"], // uses the config in `packages/config/eslint` + parser: "@typescript-eslint/parser", + parserOptions: { + ecmaVersion: "latest", + tsconfigRootDir: __dirname, + project: [ + "./apps/*/tsconfig.json", + "./packages/*/tsconfig.json", + ], + }, + settings: { + next: { + rootDir: ["apps/*/"], + }, + }, +}; + +module.exports = config; \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5b999efa4..000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - root: true, - // This tells ESLint to load the config from the package `eslint-config-custom` - extends: ["custom"], - settings: { - next: { - rootDir: ["apps/*/"], - }, - }, -}; diff --git a/apps/docs/.eslintrc.js b/apps/docs/.eslintrc.js deleted file mode 100644 index c8df60750..000000000 --- a/apps/docs/.eslintrc.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - root: true, - extends: ["custom"], -}; diff --git a/apps/docs/.gitignore b/apps/docs/.gitignore deleted file mode 100644 index 1437c53f7..000000000 --- a/apps/docs/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# next.js -/.next/ -/out/ - -# production -/build - -# misc -.DS_Store -*.pem - -# debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# local env files -.env.local -.env.development.local -.env.test.local -.env.production.local - -# vercel -.vercel diff --git a/apps/docs/README.md b/apps/docs/README.md deleted file mode 100644 index 4fae62aff..000000000 --- a/apps/docs/README.md +++ /dev/null @@ -1,30 +0,0 @@ -## Getting Started - -First, run the development server: - -```bash -yarn dev -``` - -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. - -You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file. - -[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`. - -The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. - -## Learn More - -To learn more about Next.js, take a look at the following resources: - -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn/foundations/about-nextjs) - an interactive Next.js tutorial. - -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! - -## Deploy on Vercel - -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js. - -Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/apps/docs/app/layout.tsx b/apps/docs/app/layout.tsx deleted file mode 100644 index 225b6038d..000000000 --- a/apps/docs/app/layout.tsx +++ /dev/null @@ -1,11 +0,0 @@ -export default function RootLayout({ - children, -}: { - children: React.ReactNode; -}) { - return ( - - {children} - - ); -} diff --git a/apps/docs/app/page.tsx b/apps/docs/app/page.tsx deleted file mode 100644 index 771984846..000000000 --- a/apps/docs/app/page.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { Button, Header } from "ui"; - -export default function Page() { - return ( - <> -
-