Skip to content

Commit 0cc689c

Browse files
committed
aa
1 parent 80e174f commit 0cc689c

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

.changeset/spotty-lobsters-enjoy.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
'@graphql-eslint/eslint-plugin': patch
33
---
44

5-
`allowLeadingUnderscore` and `allowTrailingUnderscore` should not conflict with `ignorePattern` in `naming-convention` rule
5+
`allowLeadingUnderscore` and `allowTrailingUnderscore` should not conflict with `ignorePattern` in
6+
`naming-convention` rule

packages/plugin/src/rules/naming-convention/index.test.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,13 @@ ruleTester.run<RuleOptions>('naming-convention', rule, {
229229
_someField_: Boolean!
230230
}
231231
`,
232-
options: [{
233-
'FieldDefinition[parent.name.value=SomeType]': {
234-
ignorePattern: ".*someField.*"
235-
}
236-
}]
232+
options: [
233+
{
234+
'FieldDefinition[parent.name.value=SomeType]': {
235+
ignorePattern: '.*someField.*',
236+
},
237+
},
238+
],
237239
},
238240
],
239241
invalid: [
@@ -271,8 +273,8 @@ ruleTester.run<RuleOptions>('naming-convention', rule, {
271273
},
272274
],
273275
errors: [
274-
{ message: 'Input "_idOperatorsFilterFindManyUserInput" should be in PascalCase format', },
275-
{ message: 'Input "_idOperatorsFilterFindOneUserInput" should be in PascalCase format', },
276+
{ message: 'Input "_idOperatorsFilterFindManyUserInput" should be in PascalCase format' },
277+
{ message: 'Input "_idOperatorsFilterFindOneUserInput" should be in PascalCase format' },
276278
{ message: 'Input "_idOperatorsFilterRemoveManyUserInput" should be in PascalCase format' },
277279
{ message: 'Input "_idOperatorsFilterRemoveOneUserInput" should be in PascalCase format' },
278280
{ message: 'Input "_idOperatorsFilterUpdateManyUserInput" should be in PascalCase format' },

packages/plugin/src/rules/naming-convention/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ export const rule: GraphQLESLintRule<RuleOptions> = {
342342
create(context) {
343343
const options = context.options[0] || {};
344344
const { allowLeadingUnderscore, allowTrailingUnderscore, types, ...restOptions } = options;
345-
const ignoredNodes = new Set<unknown>()
345+
const ignoredNodes = new Set<unknown>();
346346

347347
function normalisePropertyOption(kind: string): PropertySchema {
348348
const style = (restOptions[kind] || types) as Options;
@@ -405,7 +405,7 @@ export const rule: GraphQLESLintRule<RuleOptions> = {
405405
const name = nodeName.replace(/(^_+)|(_+$)/g, '');
406406
if (ignorePattern && new RegExp(ignorePattern, 'u').test(name)) {
407407
if ('name' in n) {
408-
ignoredNodes.add(n.name)
408+
ignoredNodes.add(n.name);
409409
}
410410
return;
411411
}
@@ -490,7 +490,7 @@ export const rule: GraphQLESLintRule<RuleOptions> = {
490490

491491
const checkUnderscore = (isLeading: boolean) => (node: GraphQLESTreeNode<NameNode>) => {
492492
if (ignoredNodes.has(node)) {
493-
return
493+
return;
494494
}
495495
if (node.parent.kind === 'Field' && node.parent.alias !== node) {
496496
return;

0 commit comments

Comments
 (0)