Skip to content

Commit

Permalink
fix: only access Node.js globals if available (#3501)
Browse files Browse the repository at this point in the history
* fix: only access Node.js global if available

* chore: adjust eslint config according to experts
  • Loading branch information
n1ru4l authored May 9, 2022
1 parent a26f7c3 commit 97c9512
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -743,3 +743,11 @@ overrides:
# Ignore docusarus related webpack aliases
import/no-unresolved:
['error', { 'ignore': ['^@theme', '^@docusaurus', '^@generated'] }]
- files:
- website/docusaurus.config.js
- website/sidebars.js
- integrationTests/**/*
- benchmark/**/*
- resources/**/*
env:
node: true
3 changes: 1 addition & 2 deletions src/jsutils/instanceOf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import { inspect } from './inspect';
export const instanceOf: (value: unknown, constructor: Constructor) => boolean =
/* c8 ignore next 6 */
// FIXME: https://github.com/graphql/graphql-js/issues/2317
// eslint-disable-next-line no-undef
process.env.NODE_ENV === 'production'
globalThis.process?.env.NODE_ENV === 'production'
? function instanceOf(value: unknown, constructor: Constructor): boolean {
return value instanceof constructor;
}
Expand Down

0 comments on commit 97c9512

Please sign in to comment.