How to use the globals.node function in globals

To help you get started, we’ve selected a few globals examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eslint / eslint / conf / environments.js View on Github external
ecmaVersion: 8
        }
    },
    es2020: {
        globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 },
        parserOptions: {
            ecmaVersion: 11
        }
    },

    // Platforms
    browser: {
        globals: globals.browser
    },
    node: {
        globals: globals.node,
        parserOptions: {
            ecmaFeatures: {
                globalReturn: true
            }
        }
    },
    "shared-node-browser": {
        globals: globals["shared-node-browser"]
    },
    worker: {
        globals: globals.worker
    },
    serviceworker: {
        globals: globals.serviceworker
    },
github FredHutch / Oncoscape / client / node_modules / eslint / conf / environments.js View on Github external
// Requirements
//------------------------------------------------------------------------------

var globals = require("globals");

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

module.exports = {
    builtin: globals.builtin,
    browser: {
        globals: globals.browser
    },
    node: {
        globals: globals.node,
        ecmaFeatures: {
            globalReturn: true
        }
    },
    commonjs: {
        globals: globals.commonjs,
        ecmaFeatures: {
            globalReturn: true
        }
    },
    worker: {
        globals: globals.worker
    },
    amd: {
        globals: globals.amd
    },
github babel / babel / src / babel / traversal / scope.js View on Github external
return cached;
    } else {
      path.setData("scope", this);
    }

    this.parent = parent;
    this.file   = parent ? parent.file : file;

    this.parentBlock = path.parent;
    this.block       = path.node;
    this.path        = path;

    this.crawl();
  }

  static globals = flatten([globals.builtin, globals.browser, globals.node].map(Object.keys));
  static contextVariables = ["this", "arguments", "super"];

  /**
   * Description
   */

  traverse(node: Object, opts: Object, state?) {
    traverse(node, opts, this, state, this.path);
  }

  /**
   * Description
   */

  generateTemp(name: string = "temp") {
    var id = this.generateUidIdentifier(name);
github niksy / modernizr-esm / build / handle-global-reference.js View on Github external
const t = require('@babel/types');
const globals = require('globals');
const { difference } = require('lodash');

const browserGlobals = difference(
	Object.keys(globals.browser),
	Object.keys(globals.node)
);
const customGlobals = ['docElement'];

function shouldHandleEnvironmentForPath(path, globalReferenceVariable) {
	/*
	 * Handle only if
	 * * is not inside function or is inside IIFE
	 * * is not variable declarator for browser check
	 * * doesn’t already have check for browser
	 * * is not inside `try` statement
	 * * is not default import specifier and identifier is not inside custom globals
	 * * is not part of Modernizr object
	 * * is not property of object which is considered browser global
	 */
	if (
		(Boolean(
github rtsao / create-universal-package / packages / eslint-plugin-cup / lib / rules / no-undef.js View on Github external
globalScope.through.forEach(ref => {
          const identifier = ref.identifier;
          if (!considerTypeOf && hasTypeOfOperator(identifier)) {
            return;
          }

          const env = lookupEnv(identifier);
          if (env === IS_BROWSER) {
            if (globals.browser.hasOwnProperty(identifier.name)) {
              return;
            }
          } else if (env === IS_NODEJS) {
            if (globals.node.hasOwnProperty(identifier.name)) {
              return;
            }
          }

          context.report({
            node: identifier,
            message: "'{{name}}' is not defined.",
            data: identifier,
          });
        });
      },
github graalvm / graaljs / tools / node_modules / eslint / conf / environments.js View on Github external
XPathException: false,
                XPathNamespace: false,
                XPathNSResolver: false
            },
            globals.browser
        )
    },
    node: {

        /*
         * For backward compatibility.
         * Remove those on the next major release.
         */
        globals: Object.assign(
            { arguments: false, GLOBAL: false, root: false },
            globals.node
        ),
        parserOptions: {
            ecmaFeatures: {
                globalReturn: true
            }
        }
    },
    commonjs: {
        globals: globals.commonjs,
        parserOptions: {
            ecmaFeatures: {
                globalReturn: true
            }
        }
    },
    "shared-node-browser": {