Skip to content

Commit

Permalink
add eslint rule to reduce node-fetch usage
Browse files Browse the repository at this point in the history
  • Loading branch information
dsokal committed Sep 14, 2021
1 parent 390e6fe commit 2463e95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ module.exports = {
name: 'lodash',
message: "Don't use lodash, it's heavy!",
},
{
name: 'node-fetch',
message: 'Use got instead, node-fetch is used only for the GraphQL client.',

This comment has been minimized.

Copy link
@LinusU

LinusU Sep 14, 2021

From following nodejs/node#19393 it seems like fetch being included in a future Node.js version is very likely, and might happen quite soon! If you transition to using node-fetch instead of got it will be very easy to not have a dependency at all once you drop support for older versions of Node.js ☺️

This comment has been minimized.

Copy link
@dsokal

dsokal Sep 14, 2021

Author Contributor

Thanks for the feedback, but we can move away from got that easily. If you're interested in why, see #32

},
],
},
],
Expand Down
3 changes: 3 additions & 0 deletions packages/eas-cli/src/graphql/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import {
fetchExchange,
} from '@urql/core';
import { retryExchange } from '@urql/exchange-retry';
// node-fetch is used here because @urql/core uses the fetch API under the hood
// don't use node-fetch elsewhere
// eslint-disable-next-line
import fetch from 'node-fetch';

import { getExpoApiBaseUrl } from '../api';
Expand Down

0 comments on commit 2463e95

Please sign in to comment.