graphql-eslint
graphql-eslint copied to clipboard
`require-import-fragment` quick fix is not compatible w/ Webpack loader + Jest transform
Issue workflow progress
Progress of the issue based on the Contributor Workflow
- [x] 1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox
- [ ] 2. A failing test has been provided
- [ ] 3. A local solution has been provided
- [ ] 4. A pull request is pending review
Describe the bug
The quick fix for require-import-fragment
creates an import that doesn't work w/ graphql-tag/loader
or jest-transform-graphql
out of the box.
To Reproduce Steps to reproduce the behavior:
- Reference a fragment in a
.graphql
file. - Run the eslint quick fix on that
.graphql
file.
Expected behavior
The following import is added:
#import './0-file-with-fragment.graphql'
- No
MyFragment
import - No space after the
#
character - Path includes
./
when in same directory
Actual behavior
The following import is added:
# import MyFragment from '0-file-with-fragment.graphql'
Environment:
- OS:
macOS 13.5.1
-
@graphql-eslint/eslint-plugin
:3.20.1
- Node.js:
v18.12.1
Additional context
N/A
++