Skip to content

Commit 97c9512

Browse files
authored
fix: only access Node.js globals if available (#3501)
* fix: only access Node.js global if available * chore: adjust eslint config according to experts
1 parent a26f7c3 commit 97c9512

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.eslintrc.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,3 +743,11 @@ overrides:
743743
# Ignore docusarus related webpack aliases
744744
import/no-unresolved:
745745
['error', { 'ignore': ['^@theme', '^@docusaurus', '^@generated'] }]
746+
- files:
747+
- website/docusaurus.config.js
748+
- website/sidebars.js
749+
- integrationTests/**/*
750+
- benchmark/**/*
751+
- resources/**/*
752+
env:
753+
node: true

src/jsutils/instanceOf.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ import { inspect } from './inspect';
99
export const instanceOf: (value: unknown, constructor: Constructor) => boolean =
1010
/* c8 ignore next 6 */
1111
// FIXME: https://github.com/graphql/graphql-js/issues/2317
12-
// eslint-disable-next-line no-undef
13-
process.env.NODE_ENV === 'production'
12+
globalThis.process?.env.NODE_ENV === 'production'
1413
? function instanceOf(value: unknown, constructor: Constructor): boolean {
1514
return value instanceof constructor;
1615
}

0 commit comments

Comments
 (0)