Skip to content

Commit

Permalink
chore: e2e strict-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvanhulle committed Sep 1, 2024
1 parent c15a3b6 commit 1686428
Show file tree
Hide file tree
Showing 18 changed files with 406 additions and 758 deletions.
2 changes: 1 addition & 1 deletion e2e/kubb.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const baseConfig = {
clean: true,
},
hooks: {
done: ['npm run typecheck', 'biome format --write ./', 'biome lint --apply-unsafe ./src'],
done: ['npm run typecheck', 'npm run typecheck:strict', 'biome format --write ./', 'biome lint --apply-unsafe ./src'],
},
plugins: [
pluginOas({
Expand Down
3 changes: 2 additions & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"generate": "kubb generate",
"generate:bun": "kubb generate --bun",
"generate:debug": "node --inspect ../packages/cli/bin/kubb.js",
"typecheck": "tsc -p ./tsconfig.json --noEmit --emitDeclarationOnly false"
"typecheck": "tsc -p ./tsconfig.strict.json --noEmit --emitDeclarationOnly false",
"typecheck:strict": "tsc -p ./tsconfig.strict.json --noEmit --emitDeclarationOnly false"
},
"dependencies": {
"@faker-js/faker": "^8.4.1",
Expand Down
2 changes: 1 addition & 1 deletion e2e/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"sourceMap": true,
"strictNullChecks": true,
"jsx": "react-jsx",
"outDir": "es",
"outDir": "dist",
"experimentalDecorators": true,
"skipLibCheck": true,
"baseUrl": ".",
Expand Down
7 changes: 7 additions & 0 deletions e2e/tsconfig.strict.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"alwaysStrict": true,
"strict": true
}
}
4 changes: 3 additions & 1 deletion examples/advanced/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"allowJs": true,
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true
"noEmit": true,
"alwaysStrict": true,
"strict": true
},
"include": ["./src/**/*", "./templates/**/*"],
"exclude": ["**/node_modules", "**/types/**", "**/mocks/**"]
Expand Down
1 change: 1 addition & 0 deletions examples/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"devDependencies": {
"@kubb/config-ts": "workspace:*",
"react": "^18.3.1",
"@types/react": "^18.3.5",
"tsup": "^8.2.4",
"typescript": "^5.5.4"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function uploadFile(
const formData = new FormData()
if (data) {
Object.keys(data).forEach((key) => {
const value = data[key]
const value = data[key as keyof typeof data]
if (typeof key === 'string' && (typeof value === 'string' || value instanceof Blob)) {
formData.append(key, value)
}
Expand Down
4 changes: 3 additions & 1 deletion examples/client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"esModuleInterop": true,
"allowJs": true,
"allowImportingTsExtensions": true,
"noEmit": true
"noEmit": true,
"alwaysStrict": true,
"strict": true
},
"include": ["./src/**/*", "./templates/**/*"],
"exclude": ["**/node_modules", "**/types/**", "**/mocks/**"]
Expand Down
4 changes: 3 additions & 1 deletion examples/msw/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"esModuleInterop": true,
"allowJs": true,
"allowImportingTsExtensions": true,
"noEmit": true
"noEmit": true,
"alwaysStrict": true,
"strict": true
},
"include": ["./src/**/*"],
"exclude": ["**/node_modules", "**/types/**", "**/mocks/**"]
Expand Down
1,106 changes: 362 additions & 744 deletions examples/simple-single/src/gen2/index.ts

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion examples/simple-single/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"esModuleInterop": true,
"allowJs": true,
"allowImportingTsExtensions": true,
"noEmit": true
"noEmit": true,
"alwaysStrict": true,
"strict": true
},
"include": ["./src/**/*"],
"exclude": ["**/node_modules", "**/types/**", "**/mocks/**"]
Expand Down
4 changes: 3 additions & 1 deletion examples/solid-query/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"esModuleInterop": true,
"allowJs": true,
"allowImportingTsExtensions": true,
"noEmit": true
"noEmit": true,
"alwaysStrict": true,
"strict": true
},
"include": ["./src/**/*"],
"exclude": ["**/node_modules", "**/types/**", "**/mocks/**"]
Expand Down
4 changes: 3 additions & 1 deletion examples/svelte-query/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"esModuleInterop": true,
"allowJs": true,
"allowImportingTsExtensions": true,
"noEmit": true
"noEmit": true,
"alwaysStrict": true,
"strict": true
},
"include": ["./src/**/*"],
"exclude": ["**/node_modules", "**/types/**", "**/mocks/**"]
Expand Down
4 changes: 3 additions & 1 deletion examples/swr/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"esModuleInterop": true,
"allowJs": true,
"allowImportingTsExtensions": true,
"noEmit": true
"noEmit": true,
"alwaysStrict": true,
"strict": true
},
"include": ["./src/**/*"],
"exclude": ["**/node_modules", "**/types/**", "**/mocks/**"]
Expand Down
4 changes: 3 additions & 1 deletion examples/typescript/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"esModuleInterop": true,
"allowJs": true,
"allowImportingTsExtensions": true,
"noEmit": true
"noEmit": true,
"alwaysStrict": true,
"strict": true
},
"include": ["./src/**/*"],
"exclude": ["**/node_modules", "**/types/**", "**/mocks/**"]
Expand Down
4 changes: 3 additions & 1 deletion examples/vue-query/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"allowJs": true,
"allowImportingTsExtensions": true,
"noEmit": true,
"paths": {}
"paths": {},
"alwaysStrict": true,
"strict": true
},
"include": ["./src/**/*", "vite.config.ts", "shims-vue.d.ts"],
"exclude": ["**/node_modules", "**/types/**", "**/mocks/**"]
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-client/src/components/Client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function Client({ name, options, typedSchemas, operation }: Props): KubbN
const formData = new FormData()
if(data) {
Object.keys(data).forEach((key) => {
const value = data[key];
const value = data[key as keyof typeof data];
if (typeof key === "string" && (typeof value === "string" || value instanceof Blob)) {
formData.append(key, value);
}
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1686428

Please sign in to comment.