diff --git a/package.json b/package.json index 5bba44da..9781b4cb 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 00000000..13285735 --- /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 0e99ccf7..149235d2 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 00000000..beb3af80 --- /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": [] +}