Skip to content

Commit

Permalink
add type checking to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-t-wang committed Jan 8, 2025
1 parent f3626f3 commit 285af2f
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 69 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
27 changes: 11 additions & 16 deletions demo/with-next/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"]
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
35 changes: 10 additions & 25 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"]
}
39 changes: 12 additions & 27 deletions packages/react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"]
}
32 changes: 32 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"]
}
}

0 comments on commit 285af2f

Please sign in to comment.