Skip to content

Commit

Permalink
ESLint: disallow using node globals in src/tests (#3537)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Apr 19, 2022
1 parent 4f062aa commit 0926554
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .eslintrc.yml
@@ -1,7 +1,6 @@
parserOptions:
sourceType: script
env:
node: true
es2022: true
reportUnusedDisableDirectives: true
plugins:
Expand Down Expand Up @@ -663,19 +662,25 @@ overrides:
import/no-restricted-paths: off
import/no-extraneous-dependencies: [error, { devDependencies: true }]
- files: 'integrationTests/*'
env:
node: true
rules:
node/no-sync: off
node/no-unpublished-require: [error, { allowModules: ['mocha'] }]
import/no-extraneous-dependencies: [error, { devDependencies: true }]
import/no-nodejs-modules: off
- files: 'integrationTests/*/**'
env:
node: true
rules:
node/no-sync: off
node/no-missing-require: [error, { allowModules: ['graphql'] }]
import/no-commonjs: off
import/no-nodejs-modules: off
no-console: off
- files: 'benchmark/**'
env:
node: true
rules:
internal-rules/only-ascii: [error, { allowEmoji: true }]
node/no-sync: off
Expand All @@ -685,6 +690,8 @@ overrides:
no-console: off
no-await-in-loop: off
- files: 'resources/**'
env:
node: true
rules:
internal-rules/only-ascii: [error, { allowEmoji: true }]
node/no-unpublished-require: off
Expand All @@ -702,6 +709,8 @@ overrides:
node/no-unpublished-import: off
import/no-default-export: off
- files: 'website/**'
env:
node: true
plugins:
- 'react'
extends:
Expand Down
3 changes: 2 additions & 1 deletion src/jsutils/instanceOf.ts
Expand Up @@ -7,8 +7,9 @@ import { inspect } from './inspect';
* See: https://webpack.js.org/guides/production/
*/
export const instanceOf: (value: unknown, constructor: Constructor) => boolean =
/* c8 ignore next 5 */
/* c8 ignore next 6 */
// FIXME: https://github.com/graphql/graphql-js/issues/2317
// eslint-disable-next-line no-undef
process.env.NODE_ENV === 'production'
? function instanceOf(value: unknown, constructor: Constructor): boolean {
return value instanceof constructor;
Expand Down

0 comments on commit 0926554

Please sign in to comment.