Skip to content

Commit 6108482

Browse files
committed
fixed lint failure
1 parent dbce889 commit 6108482

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",
@@ -84,6 +85,5 @@
8485
"vitest": "^1.0.0",
8586
"yup": "1.4.0",
8687
"zod": "3.23.8"
87-
},
88-
"packageManager": "[email protected]"
88+
}
8989
}

src/directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function buildApiFromDirectiveObjectArguments(config: FormattedDirectiveObjectAr
154154
}
155155

156156
function applyArgToApiSchemaTemplate(template: string, apiArgs: any[]): string {
157-
const matches = template.matchAll(/[$](\d+)/g);
157+
const matches = template.matchAll(/\$(\d+)/g);
158158
for (const match of matches) {
159159
const placeholder = match[0]; // `$1`
160160
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)