File tree Expand file tree Collapse file tree 2 files changed +2
-7
lines changed
__tests__/mocks/import-fragments
src/rules/require-import-fragment Expand file tree Collapse file tree 2 files changed +2
-7
lines changed Original file line number Diff line number Diff line change 11# Imports could have extra whitespace and double/single quotes
22
3- # import BazFields from ".\ other-path\ baz-fragment.gql"
3+ # import BazFields from "./ other-path/ baz-fragment.gql"
44
55query {
66 baz {
Original file line number Diff line number Diff line change @@ -89,12 +89,7 @@ export const rule: GraphQLESLintRule = {
8989
9090 const extractedImportPath = comment . value . match ( / ( [ " ' ] ) ( (?: \1| .) * ?) \1/ ) ?. [ 2 ] ;
9191 if ( ! extractedImportPath ) continue ;
92-
93- const importPath = path . join (
94- path . dirname ( filePath ) ,
95- extractedImportPath . replaceAll ( / [ / \\ ] / g, path . sep ) ,
96- ) ;
97-
92+ const importPath = path . join ( filePath , '..' , extractedImportPath ) ;
9893 const hasInSiblings = fragmentsFromSiblings . some (
9994 source => source . filePath === importPath ,
10095 ) ;
You can’t perform that action at this time.
0 commit comments