Skip to content

Commit 0926554

Browse files
ESLint: disallow using node globals in src/tests (#3537)
1 parent 4f062aa commit 0926554

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.eslintrc.yml

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
parserOptions:
22
sourceType: script
33
env:
4-
node: true
54
es2022: true
65
reportUnusedDisableDirectives: true
76
plugins:
@@ -663,19 +662,25 @@ overrides:
663662
import/no-restricted-paths: off
664663
import/no-extraneous-dependencies: [error, { devDependencies: true }]
665664
- files: 'integrationTests/*'
665+
env:
666+
node: true
666667
rules:
667668
node/no-sync: off
668669
node/no-unpublished-require: [error, { allowModules: ['mocha'] }]
669670
import/no-extraneous-dependencies: [error, { devDependencies: true }]
670671
import/no-nodejs-modules: off
671672
- files: 'integrationTests/*/**'
673+
env:
674+
node: true
672675
rules:
673676
node/no-sync: off
674677
node/no-missing-require: [error, { allowModules: ['graphql'] }]
675678
import/no-commonjs: off
676679
import/no-nodejs-modules: off
677680
no-console: off
678681
- files: 'benchmark/**'
682+
env:
683+
node: true
679684
rules:
680685
internal-rules/only-ascii: [error, { allowEmoji: true }]
681686
node/no-sync: off
@@ -685,6 +690,8 @@ overrides:
685690
no-console: off
686691
no-await-in-loop: off
687692
- files: 'resources/**'
693+
env:
694+
node: true
688695
rules:
689696
internal-rules/only-ascii: [error, { allowEmoji: true }]
690697
node/no-unpublished-require: off
@@ -702,6 +709,8 @@ overrides:
702709
node/no-unpublished-import: off
703710
import/no-default-export: off
704711
- files: 'website/**'
712+
env:
713+
node: true
705714
plugins:
706715
- 'react'
707716
extends:

src/jsutils/instanceOf.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ import { inspect } from './inspect';
77
* See: https://webpack.js.org/guides/production/
88
*/
99
export const instanceOf: (value: unknown, constructor: Constructor) => boolean =
10-
/* c8 ignore next 5 */
10+
/* c8 ignore next 6 */
1111
// FIXME: https://github.com/graphql/graphql-js/issues/2317
12+
// eslint-disable-next-line no-undef
1213
process.env.NODE_ENV === 'production'
1314
? function instanceOf(value: unknown, constructor: Constructor): boolean {
1415
return value instanceof constructor;

0 commit comments

Comments
 (0)