File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
packages/plugin/src/rules/require-import-fragment Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,7 @@ function withMocks({
1919 code : ruleTester . fromMockFile ( filename . split ( 'mocks' ) [ 1 ] ) ,
2020 parserOptions : {
2121 graphQLConfig : {
22- documents : [
23- filename ,
24- './__tests__/mocks/import-fragments/fragments/**/*.gql' ,
25- ] ,
22+ documents : [ filename , './__tests__/mocks/import-fragments/fragments/**/*.gql' ] ,
2623 } ,
2724 } satisfies ParserOptionsForTests ,
2825 errors,
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import path from 'node:path';
22import { NameNode } from 'graphql' ;
33import { GraphQLESTreeNode } from '../../estree-converter/index.js' ;
44import { GraphQLESLintRule } from '../../types.js' ;
5- import { requireSiblingsOperations } from '../../utils.js' ;
5+ import { requireSiblingsOperations , slash } from '../../utils.js' ;
66
77const RULE_ID = 'require-import-fragment' ;
88const SUGGESTION_ID = 'add-import-expression' ;
@@ -99,9 +99,9 @@ export const rule: GraphQLESLintRule = {
9999 source => source . filePath === filePath ,
100100 ) ;
101101 if ( fragmentInSameFile ) return ;
102- console . log ( fragmentsFromSiblings )
102+ console . log ( fragmentsFromSiblings ) ;
103103 const suggestedFilePaths = fragmentsFromSiblings . length
104- ? fragmentsFromSiblings . map ( o => path . relative ( path . dirname ( filePath ) , o . filePath ) )
104+ ? fragmentsFromSiblings . map ( o => slash ( path . relative ( path . dirname ( filePath ) , o . filePath ) ) )
105105 : [ 'CHANGE_ME.graphql' ] ;
106106
107107 context . report ( {
You can’t perform that action at this time.
0 commit comments