diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1ddd27..cce39eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,3 +39,11 @@ jobs: - uses: actions/checkout@v4 - name: Run lint run: pnpm lint + + typecheck: + name: Typecheck + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v4 + - name: Run typecheck + run: pnpm --loglevel debug --recursive type-check diff --git a/demo/with-next/tsconfig.json b/demo/with-next/tsconfig.json index e7ff90f..56ad46b 100644 --- a/demo/with-next/tsconfig.json +++ b/demo/with-next/tsconfig.json @@ -1,26 +1,21 @@ { + "extends": "../../tsconfig.json", "compilerOptions": { - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, - "strict": true, - "noEmit": true, - "esModuleInterop": true, - "module": "esnext", + "types": ["node", "next"], "moduleResolution": "bundler", + "module": "ESNext", + "typeRoots": ["node_modules/@types"], + "noEmit": true, "resolveJsonModule": true, "isolatedModules": true, - "jsx": "preserve", - "incremental": true, - "plugins": [ - { - "name": "next" - } - ], + "skipLibCheck": true, + "jsx": "react-jsx", + "rootDir": ".", + "baseUrl": ".", "paths": { "@/*": ["./*"] } }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], - "exclude": ["node_modules"] + "include": ["**/*.ts", "**/*.tsx"], + "exclude": ["node_modules", ".next", ".turbo"] } diff --git a/package.json b/package.json index ab92748..6c2211b 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "lint": "prettier --check .", "format": "prettier --write .", "build": "turbo run build", - "prepublishOnly": "npm run build" + "prepublishOnly": "npm run build", + "typecheck": "" }, "devDependencies": { "prettier-plugin-organize-imports": "^4.1.0", diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index afd41cf..a0c0fd4 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -1,31 +1,16 @@ { + "extends": "../../tsconfig.json", "compilerOptions": { - "strict": true, + "types": ["node", "jest"], + "moduleResolution": "bundler", "rootDir": ".", - "outDir": "build", - "declaration": true, - "declarationDir": "build", - "module": "ESNext", - "moduleResolution": "node", - "target": "ES2020", - "lib": ["es6", "dom", "es2016", "es2017", "es2021"], - "sourceMap": false, - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "noImplicitAny": false, - "skipLibCheck": true, "baseUrl": ".", - "paths": { - "@/*": ["."] - } + "typeRoots": ["./node_modules/@types"], + "noEmit": true, + "resolveJsonModule": true, + "isolatedModules": true, + "skipLibCheck": true }, - "include": [".", "jest.config.ts"], - "exclude": ["node_modules/**", "build"], - "watchOptions": { - "watchFile": "useFsEvents", - "watchDirectory": "useFsEvents", - "fallbackPolling": "dynamicPriority", - "synchronousWatchDirectory": true, - "excludeDirectories": ["../node_modules", "build"] - } + "include": ["**/*.ts", "**/*.tsx"], + "exclude": ["node_modules", "build", ".turbo", "coverage"] } diff --git a/packages/react/tsconfig.json b/packages/react/tsconfig.json index f5b2932..d6c8997 100644 --- a/packages/react/tsconfig.json +++ b/packages/react/tsconfig.json @@ -1,32 +1,17 @@ { + "extends": "../../tsconfig.json", "compilerOptions": { - "strict": true, - "rootDir": "src", - "outDir": "build", - "declaration": true, - "declarationDir": "build", - "module": "ESNext", - "moduleResolution": "node", - "target": "ES2020", - "lib": ["es6", "dom", "es2016", "es2017", "es2021"], - "sourceMap": false, - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "jsx": "react-jsx", - "noImplicitAny": false, - "skipLibCheck": true, + "types": ["node", "react"], + "moduleResolution": "bundler", + "rootDir": ".", "baseUrl": ".", - "paths": { - "@/*": ["."] - } + "typeRoots": ["./node_modules/@types"], + "noEmit": true, + "resolveJsonModule": true, + "isolatedModules": true, + "skipLibCheck": true, + "jsx": "react-jsx" }, - "include": ["."], - "exclude": ["node_modules/**", "build"], - "watchOptions": { - "watchFile": "useFsEvents", - "watchDirectory": "useFsEvents", - "fallbackPolling": "dynamicPriority", - "synchronousWatchDirectory": true, - "excludeDirectories": ["../node_modules", "build"] - } + "include": ["./**/*.ts", "./**/*.tsx"], + "exclude": ["node_modules", "build", ".turbo", "coverage"] } diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..eb12733 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "strict": true, + "rootDir": "src", + "outDir": "build", + "declaration": true, + "declarationDir": "build", + "module": "ESNext", + "moduleResolution": "node", + "target": "ES2020", + "lib": ["es6", "dom", "es2016", "es2017", "es2021"], + "sourceMap": false, + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "jsx": "react-jsx", + "noImplicitAny": false, + "skipLibCheck": true, + "baseUrl": ".", + "paths": { + "@/*": ["."] + } + }, + "include": ["packages/**/*", "demo/**/*"], + "exclude": ["node_modules/**", "build"], + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority", + "synchronousWatchDirectory": true, + "excludeDirectories": ["../node_modules", "build"] + } +}