Skip to content

fix project config #606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Apply auto lint-fix changes
  • Loading branch information
Code-Hex authored and github-actions[bot] committed Apr 6, 2024
commit f60d7fd5c0a2acb665f563682e25406ac4199117
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
"typings": "dist/types/index.d.ts",
"module": "dist/module/index.js",
"files": [
"!dist/**/*.tsbuildinfo",
"LICENSE",
"README.md",
"dist/**/*.{js,ts}",
"!dist/**/*.tsbuildinfo"
"dist/**/*.{js,ts}"
],
"scripts": {
"type-check": "tsc --noEmit",
Expand Down
5 changes: 3 additions & 2 deletions src/yup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,14 @@ export class YupSchemaVisitor extends BaseSchemaVisitor {
.withName(`${enumname}Schema`)
.withContent(`yup.string().oneOf([${enums?.join(', ')}]).defined()`).string,
);
} else {
}
else {
this.enumDeclarations.push(
new DeclarationBlock({})
.export()
.asKind('const')
.withName(`${enumname}Schema`)
.withContent(`yup.string<${enumname}>().oneOf(Object.values(${enumname})).defined()`).string
.withContent(`yup.string<${enumname}>().oneOf(Object.values(${enumname})).defined()`).string,
);
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/yup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ describe('yup', () => {
);

expect(result.content).toContain(
'export const PageTypeSchema = yup.string<PageType>().oneOf(Object.values(PageType)).defined()'
'export const PageTypeSchema = yup.string<PageType>().oneOf(Object.values(PageType)).defined()',
);
expect(result.content).toContain('export function PageInputSchema(): yup.ObjectSchema<PageInput>');

Expand Down
4 changes: 2 additions & 2 deletions tsconfig.main.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"compilerOptions": {
"incremental": false,
"rootDir": "src",
"types": ["node"],
"declaration": false,
"outDir": "dist/main",
"types": ["node"]
"outDir": "dist/main"
},
"exclude": [
"example",
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.module.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"types": ["node"],
"declaration": false,
"outDir": "dist/module",
"types": ["node"]
"outDir": "dist/module"
},
"exclude": [
"node_modules/**",
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.types.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"extends": "./tsconfig",
"compilerOptions": {
"rootDir": "src",
"types": ["node"],
"declarationDir": "dist/types",
"emitDeclarationOnly": true,
"outDir": "dist/types",
"types": ["node"]
"outDir": "dist/types"
},
"exclude": [
"example",
Expand Down