Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESLint: disallow using node globals in src/tests #3537

Merged
merged 1 commit into from Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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