Skip to content

Commit cacb48f

Browse files
committed
try
1 parent 1e5a9a8 commit cacb48f

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

packages/plugin/__tests__/mocks/import-fragments/valid-baz-query.gql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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

55
query {
66
baz {

packages/plugin/src/rules/require-import-fragment/index.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff 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
);

0 commit comments

Comments
 (0)