@putout/plugin-apply-global-this
🐊Putout plugin adds ability to find and apply 'globalThis'
Last updated 3 months ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @putout/plugin-apply-global-this 
SYNC missed versions from official npm registry.

@putout/plugin-apply-global-this NPM version

Historically, accessing the global object has required different syntax in different JavaScript environments. On the web you can use window, self, or frames - but in Web Workers only self will work. In Node.js none of these work, and you must instead use global

(c) MDN

????Putout plugin adds ability to find and apply globalThis.

Check out in ????Putout Editor.

Install

npm i @putout/plugin-apply-global-this

Rule

{
    "rules": {
        "apply-global-this": "on"
    }
}

❌ Example of incorrect code

globalThis.__putout_debug = debugFn;
globalThis.CloudCmd = {};

✅ Example of correct code

globalThis.__putout_debug = debugFn;
globalThis.CloudCmd = {};

Comparison

Linter Rule Fix
???? Putout apply-global-this
ESLint no-node-globals

License

MIT

Current Tags

  • 1.0.1                                ...           latest (3 months ago)

2 Versions

  • 1.0.1                                ...           3 months ago
  • 1.0.0                                ...           3 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (0)
None
Dev Dependencies (7)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |