Skip to content

Commit 2e78df4

Browse files
Code-Hexsutt0n
authored andcommitted
fixed lint failure
1 parent 36b5206 commit 2e78df4

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

eslint.config.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@ export default antfu({
1212
'README.md',
1313
],
1414
}, {
15-
rules: { 'style/semi': 'off' },
15+
rules: {
16+
'style/semi': 'off',
17+
'regexp/no-unused-capturing-group': 'off',
18+
},
1619
})

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "graphql-codegen-typescript-validation-schema",
33
"version": "0.14.1",
4+
"packageManager": "[email protected]",
45
"description": "GraphQL Code Generator plugin to generate form validation schema from your GraphQL schema",
56
"respository": {
67
"type": "git",
@@ -86,6 +87,5 @@
8687
"vitest": "^1.0.0",
8788
"yup": "1.4.0",
8889
"zod": "3.23.8"
89-
},
90-
"packageManager": "[email protected]"
90+
}
9191
}

src/directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ function buildApiFromDirectiveObjectArguments(config: FormattedDirectiveObjectAr
186186
}
187187

188188
function applyArgToApiSchemaTemplate(template: string, apiArgs: any[]): string {
189-
const matches = template.matchAll(/[$](\d+)/g);
189+
const matches = template.matchAll(/\$(\d+)/g);
190190
for (const match of matches) {
191191
const placeholder = match[0]; // `$1`
192192
const idx = Number.parseInt(match[1], 10) - 1; // start with `1 - 1`

src/yup/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,9 @@ function shapeFields(fields: readonly (FieldDefinitionNode | InputValueDefinitio
279279
defaultValue?.kind === Kind.INT
280280
|| defaultValue?.kind === Kind.FLOAT
281281
|| defaultValue?.kind === Kind.BOOLEAN
282-
)
282+
) {
283283
fieldSchema = `${fieldSchema}.default(${defaultValue.value})`;
284+
}
284285

285286
if (defaultValue?.kind === Kind.STRING || defaultValue?.kind === Kind.ENUM)
286287
fieldSchema = `${fieldSchema}.default("${defaultValue.value}")`;

0 commit comments

Comments
 (0)