Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing import extension, check with lint #4795

Merged
merged 1 commit into from Oct 29, 2022

Conversation

glasser
Copy link
Contributor

@glasser glasser commented Oct 28, 2022

馃毃 IMPORTANT: Please do not create a Pull Request without creating an issue first.

Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of the pull request.

This is a build regression from #4778. I can file an issue if you really want me to.

Description

Some pure-ESM processors (eg, tsc with `moduleResolution: 'nodenext') require extensions on all imports. #4778 added two import-less extensions. This PR fixes them and adds linting (from an already-installed plugin) to catch future errors. Test execution does not appear to require these extensions so we only check non-test files (there's another 17 errors to fix if you want to check tests too).

While this requirement isn't documented anywhere I found quickly, I have to assume it's intentional (since #4539) because every other import uses it.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Screenshots/Sandbox (if appropriate/relevant):

n/a

How Has This Been Tested?

#4778 (specifically, @graphql-tools/utils@8.13.0 broke a build in my project.

The breakage pointed directly at these two lines.

The lint rule I added also found only these two lines. So I fixed them. I have not yet actually verified that the built package fixes my original problem, but it sure seems likely.

Checklist:

  • I have followed the CONTRIBUTING doc and the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests and linter rules pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Further comments

Pretty simple I hope.

@changeset-bot
Copy link

changeset-bot bot commented Oct 28, 2022

馃 Changeset detected

Latest commit: a6667cd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 29 packages
Name Type
@graphql-tools/utils Patch
@graphql-tools/batch-delegate Patch
@graphql-tools/batch-execute Patch
@graphql-tools/delegate Patch
@graphql-tools/executor Patch
@graphql-tools/graphql-tag-pluck Patch
@graphql-tools/import Patch
@graphql-tools/links Patch
@graphql-tools/load Patch
@graphql-tools/merge Patch
@graphql-tools/mock Patch
@graphql-tools/node-require Patch
@graphql-tools/relay-operation-optimizer Patch
@graphql-tools/resolvers-composition Patch
@graphql-tools/schema Patch
@graphql-tools/stitch Patch
@graphql-tools/stitching-directives Patch
@graphql-tools/wrap Patch
@graphql-tools/apollo-engine-loader Patch
@graphql-tools/code-file-loader Patch
@graphql-tools/git-loader Patch
@graphql-tools/github-loader Patch
@graphql-tools/graphql-file-loader Patch
@graphql-tools/json-file-loader Patch
@graphql-tools/module-loader Patch
@graphql-tools/prisma-loader Patch
@graphql-tools/url-loader Patch
graphql-tools Patch
federation-benchmark Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Some pure-ESM processors (eg, `tsc` with `moduleResolution: 'nodenext')
require extensions on all imports. ardatan#4778 added two import-less
extensions. This PR fixes them and adds linting (from an
already-installed plugin) to catch future errors. Test execution does
not appear to require these extensions so we only check non-test files
(there's another 17 errors to fix if you want to check tests too).
@glasser
Copy link
Contributor Author

glasser commented Oct 28, 2022

The failing tests appear to be memory issues and I can't imagine that they are caused by this PR.

Since the issue breaks certain builds it would be great if this could be released quickly after merging!

@ardatan
Copy link
Owner

ardatan commented Oct 29, 2022

@B2o5T Could you review eslint rules?

@ardatan ardatan merged commit f7daf77 into ardatan:master Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants