From 193e6431967e6a2f6045ace6b136db6e403e52a6 Mon Sep 17 00:00:00 2001 From: Francesco Spilla Date: Thu, 20 Mar 2025 17:46:09 +0100 Subject: [PATCH] feat(ebitemp-api): init project + migration from nx (2) --- .npmrc | 0 apps/ebitemp-api/.prettierrc => .prettierrc | 0 README.md | 14 -------------- apps/ebitemp-api/eslint.config.mjs | 9 +++------ apps/ebitemp-api/package.json | 2 -- apps/ebitemp-api/tsconfig.json | 10 +--------- package.json | 2 +- packages/eslint-config/{base.js => base.mjs} | 17 +++++++---------- packages/eslint-config/package.json | 2 +- packages/typescript-config/base.json | 2 +- pnpm-lock.yaml | 3 --- 11 files changed, 14 insertions(+), 47 deletions(-) delete mode 100644 .npmrc rename apps/ebitemp-api/.prettierrc => .prettierrc (100%) rename packages/eslint-config/{base.js => base.mjs} (76%) diff --git a/.npmrc b/.npmrc deleted file mode 100644 index e69de29..0000000 diff --git a/apps/ebitemp-api/.prettierrc b/.prettierrc similarity index 100% rename from apps/ebitemp-api/.prettierrc rename to .prettierrc diff --git a/README.md b/README.md index 4b76073..cee9460 100644 --- a/README.md +++ b/README.md @@ -10,20 +10,6 @@ Run the following command: npx create-turbo@latest ``` -## What's inside? - -This Turborepo includes the following packages/apps: - -### Apps and Packages - -- `docs`: a [Next.js](https://nextjs.org/) app -- `web`: another [Next.js](https://nextjs.org/) app -- `@repo/ui`: a stub React component library shared by both `web` and `docs` applications -- `@repo/eslint-config`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`) -- `@repo/typescript-config`: `tsconfig.json`s used throughout the monorepo - -Each package/app is 100% [TypeScript](https://www.typescriptlang.org/). - ### Utilities This Turborepo has some additional tools already setup for you: diff --git a/apps/ebitemp-api/eslint.config.mjs b/apps/ebitemp-api/eslint.config.mjs index 32465cc..7735cdf 100644 --- a/apps/ebitemp-api/eslint.config.mjs +++ b/apps/ebitemp-api/eslint.config.mjs @@ -1,17 +1,14 @@ -// @ts-check -import eslint from '@eslint/js'; -import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; +import baseConfig from '@repo/eslint-config/base'; import globals from 'globals'; import tseslint from 'typescript-eslint'; export default tseslint.config( + ...baseConfig, { ignores: ['eslint.config.mjs'], }, - eslint.configs.recommended, - ...tseslint.configs.recommendedTypeChecked, - eslintPluginPrettierRecommended, { + extends: [tseslint.configs.recommendedTypeCheckedOnly], languageOptions: { globals: { ...globals.node, diff --git a/apps/ebitemp-api/package.json b/apps/ebitemp-api/package.json index 12de96f..afc0277 100644 --- a/apps/ebitemp-api/package.json +++ b/apps/ebitemp-api/package.json @@ -3,7 +3,6 @@ "private": true, "scripts": { "build": "nest build", - "format": "prettier --list-different --write \"src/**/*.ts\" \"test/**/*.ts\"", "dev": "nest start --debug --watch", "start:prod": "node dist/main", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", @@ -78,7 +77,6 @@ "globals": "^16.0.0", "jest": "^29.7.0", "mssql": "^11.0.1", - "prettier": "^3.4.2", "source-map-support": "^0.5.21", "supertest": "^7.0.0", "ts-jest": "^29.2.5", diff --git a/apps/ebitemp-api/tsconfig.json b/apps/ebitemp-api/tsconfig.json index a622e21..9f9b42b 100644 --- a/apps/ebitemp-api/tsconfig.json +++ b/apps/ebitemp-api/tsconfig.json @@ -1,21 +1,13 @@ { "extends": "@repo/typescript-config/base.json", "compilerOptions": { - "declaration": true, "removeComments": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "allowSyntheticDefaultImports": true, - "target": "ES2023", "sourceMap": true, "outDir": "./dist", "baseUrl": "./", - "incremental": true, - "skipLibCheck": true, - "strictNullChecks": true, - "forceConsistentCasingInFileNames": true, - "noImplicitAny": false, - "strictBindCallApply": false, - "noFallthroughCasesInSwitch": false + "incremental": true } } diff --git a/package.json b/package.json index dca319b..56b75f0 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "build": "turbo run build", "dev": "turbo run dev", "lint": "turbo run lint", - "format": "prettier --write \"**/*.{ts,tsx,md}\"", + "format": "prettier --list-different --write \"**/*.{ts,tsx,md}\"", "check-types": "turbo run check-types" }, "devDependencies": { diff --git a/packages/eslint-config/base.js b/packages/eslint-config/base.mjs similarity index 76% rename from packages/eslint-config/base.js rename to packages/eslint-config/base.mjs index 09d316e..3917fc5 100644 --- a/packages/eslint-config/base.js +++ b/packages/eslint-config/base.mjs @@ -1,18 +1,15 @@ import js from "@eslint/js"; import eslintConfigPrettier from "eslint-config-prettier"; +import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; +import onlyWarn from "eslint-plugin-only-warn"; import turboPlugin from "eslint-plugin-turbo"; import tseslint from "typescript-eslint"; -import onlyWarn from "eslint-plugin-only-warn"; -/** - * A shared ESLint configuration for the repository. - * - * @type {import("eslint").Linter.Config[]} - * */ -export const config = [ +export default tseslint.config( js.configs.recommended, - eslintConfigPrettier, ...tseslint.configs.recommended, + eslintConfigPrettier, + eslintPluginPrettierRecommended, { plugins: { turbo: turboPlugin, @@ -28,5 +25,5 @@ export const config = [ }, { ignores: ["dist/**"], - }, -]; + } +); diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index e726192..d9591d5 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -4,7 +4,7 @@ "type": "module", "private": true, "exports": { - "./base": "./base.js" + "./base": "./base.mjs" }, "devDependencies": { "@eslint/js": "^9.22.0", diff --git a/packages/typescript-config/base.json b/packages/typescript-config/base.json index 5117f2a..a4fcdb0 100644 --- a/packages/typescript-config/base.json +++ b/packages/typescript-config/base.json @@ -14,6 +14,6 @@ "resolveJsonModule": true, "skipLibCheck": true, "strict": true, - "target": "ES2022" + "target": "ES2023" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f39d39f..8ec2bad 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -210,9 +210,6 @@ importers: mssql: specifier: ^11.0.1 version: 11.0.1 - prettier: - specifier: ^3.4.2 - version: 3.5.3 source-map-support: specifier: ^0.5.21 version: 0.5.21