From 5006116851c3fc189d9851016ff4f9ed579ebba5 Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Fri, 31 Oct 2025 16:09:20 +0100 Subject: [PATCH] chore: avoid including test files in dist directory --- package.json | 4 ++-- tsconfig.base.json | 14 ++++++++++++++ tsconfig.json | 16 ++++------------ tsconfig.test.json | 8 ++++++++ 4 files changed, 28 insertions(+), 14 deletions(-) create mode 100644 tsconfig.base.json create mode 100644 tsconfig.test.json diff --git a/package.json b/package.json index 5bba44da9..9781b4cb9 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,8 @@ "prepack": "pnpm run build", "install:examples": "pnpm install --filter ./examples/with-next-intl --shamefully-hoist && pnpm install --filter ./examples/with-shadcn --shamefully-hoist", "docs": "typedoc", - "lint": "tsc --noEmit && eslint ./src", - "lint:fix": "tsc --noEmit && eslint --fix ./src" + "lint": "tsc --noEmit && tsc --noEmit --project tsconfig.test.json && eslint ./src", + "lint:fix": "tsc --noEmit && tsc --noEmit --project tsconfig.test.json && eslint --fix ./src" }, "repository": { "type": "git", diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 000000000..132857350 --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "ES2021", + "moduleResolution": "nodenext", + "module": "NodeNext", + "rootDir": "./src", + "esModuleInterop": true, + "strict": true, + "skipLibCheck": true, + "jsx": "react", + "declaration": true, + "resolveJsonModule": true + }, +} diff --git a/tsconfig.json b/tsconfig.json index 0e99ccf74..149235d23 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,16 +1,8 @@ { + "extends": "./tsconfig.base.json", "compilerOptions": { - "target": "ES2021", - "moduleResolution": "nodenext", - "module": "NodeNext", - "rootDir": "./src", - "outDir": "./dist", - "esModuleInterop": true, - "strict": true, - "skipLibCheck": true, - "jsx": "react", - "declaration": true, - "resolveJsonModule": true + "outDir": "./dist" }, - "include": ["src/**/*"] + "include": ["src/**/*"], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] } diff --git a/tsconfig.test.json b/tsconfig.test.json new file mode 100644 index 000000000..beb3af805 --- /dev/null +++ b/tsconfig.test.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./dist-test" + }, + "include": ["src/**/*.test.ts", "src/**/*.test.tsx"], + "exclude": [] +}