From 110a387f58263edcbe26216d674b477a56f3643b Mon Sep 17 00:00:00 2001 From: comatory Date: Thu, 7 Mar 2024 09:49:51 +0100 Subject: [PATCH] remove case sensitivity in must colocate fragment rule --- src/rule-must-colocate-fragment-spreads.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/rule-must-colocate-fragment-spreads.js b/src/rule-must-colocate-fragment-spreads.js index e9c3d91..1619751 100644 --- a/src/rule-must-colocate-fragment-spreads.js +++ b/src/rule-must-colocate-fragment-spreads.js @@ -103,10 +103,6 @@ function getGraphQLFragmentSpreads(graphQLAst) { return fragmentSpreads; } -function isFirstLetterUppercase(word) { - return /^\p{Lu}/u.test(word); -} - function getGraphQLFragmentDefinitionName(graphQLAst) { let name = null; visit(graphQLAst, { @@ -171,11 +167,7 @@ function checkColocation(context) { ImportDeclaration(node) { if (node.importKind === 'value') { node.specifiers.forEach(specifier => { - if ( - allowNamedImports && - specifier.imported && - isFirstLetterUppercase(specifier.imported.name) - ) { + if (allowNamedImports && specifier.imported) { foundImportedModules.push({ type: 'namedImport', value: specifier.imported.name