{"_id":"@1o1w1/confusing-browser-globals","_rev":"1-9e18f3524b8d913d06ab3bb2270bb44b","name":"@1o1w1/confusing-browser-globals","dist-tags":{"latest":"1.0.7"},"versions":{"1.0.7":{"name":"@1o1w1/confusing-browser-globals","version":"1.0.7","description":"A list of browser globals that are often used by mistake instead of local variables","license":"MIT","main":"index.js","scripts":{"test":"jest"},"repository":{"type":"git","url":"git+https://github.com/1o1w1/spa-webpack.git","directory":"packages/confusing-browser-globals"},"keywords":["eslint","globals"],"devDependencies":{"jest":"24.7.1"},"bugs":{"url":"https://github.com/1o1w1/spa-webpack/issues"},"homepage":"https://github.com/1o1w1/spa-webpack#readme","_id":"@1o1w1/confusing-browser-globals@1.0.7","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"1o1w1","email":"610744313@qq.com"},"dist":{"integrity":"sha512-0tHSZsVosCo18Obdml+LktblJ2/XPmmfyLTLG1VpyEBk80JPBkgIuMgb0FytaAPcbnUPnvgb2GPq8B/1JpDnVA==","shasum":"d002cccf2d787360083c8a1f15732531ce94fda1","tarball":"https://registry.npmjs.org/@1o1w1/confusing-browser-globals/-/confusing-browser-globals-1.0.7.tgz","fileCount":4,"unpackedSize":3969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJczvE/CRA9TVsSAnZWagAADdIQAJqnwcIgYb6ihr7SEc42\nP3G0mnpw5XR8c4yVDWeIMDpEmZddwCxA6Ddy1D8nMV1pMO0WHph88at3caHd\nEaSgRX0QxbZ3rmFEJbL15Y//uMpw9HsgsfON86rb2j2EqefP0D+cPK5x+Btc\nk7fR6jiseBtzlV5EXqBqRBpGnqh6w//sFWbw09ZHe86A1IifKGHyLwqytQmg\nV+Ak+h7XsF6Sxv77lSoTa/srj+zmvYK8007MFlohNEG7Jn5yfXFUuAErv3JB\nVLbsCCMhztiHDFa6ZEf5d4NSN+huItVyCMA9GDiFon10bgqcBcnRdFlD38aW\nncHDwqNsX1WFSXM8d3WV4X0hp005ZAP0O9GdIh72clRiSy2zb+2Bf6tFzMHP\nXGy085W/2TpRRC3E9+/0akRdwlEc8/21gzpStYYeFUg07VSzWK8ZYSyEuWGt\n9o3UvrkH4UGOVUKNKU2t3a2uYIJaWM0pOPj7TGCZkvVmCSYYdZNB1jBGxo9b\nTb3OHZ66sdsIecfzZXTHKtFyt7O4enUHzcs9m/ZPKPEqmtX5AS7GeTwLCiPw\nd9N4sf+/tfQ8Ukw3Jr99vTAWPKIpI19wowF9JuaAz2uG0toDUT9VrnvdkCS3\n/gOhDvuyi+IUmcrUp4HlGh/HsJHNAIwx7UsSrRXdr8wQAelpXf7vzZvdFYgW\nARJH\r\n=FM2a\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0tc74Nq8mHUHCNdkptNzXnmpnp5hLpBBafAMsjHyhuwIhALRgkmrdYWEADHKYVi/4A8bfguEPpnwtALG8PO4FPpCH"}]},"maintainers":[{"name":"1o1w1","email":"610744313@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/confusing-browser-globals_1.0.7_1557066046519_0.5910071107243031"},"_hasShrinkwrap":false}},"time":{"created":"2019-05-05T14:20:46.495Z","1.0.7":"2019-05-05T14:20:46.663Z","modified":"2022-04-04T10:33:52.153Z"},"maintainers":[{"name":"1o1w1","email":"610744313@qq.com"}],"description":"A list of browser globals that are often used by mistake instead of local variables","homepage":"https://github.com/1o1w1/spa-webpack#readme","keywords":["eslint","globals"],"repository":{"type":"git","url":"git+https://github.com/1o1w1/spa-webpack.git","directory":"packages/confusing-browser-globals"},"bugs":{"url":"https://github.com/1o1w1/spa-webpack/issues"},"license":"MIT","readme":"# confusing-browser-globals\r\n\r\nA curated list of browser globals that commonly cause confusion and are not recommended to use without an explicit `window.` qualifier.\r\n\r\n## Motivation\r\n\r\nSome global variables in browser are likely to be used by people without the intent of using them as globals, such as `status`, `name`, `event`, etc.\r\n\r\nFor example:\r\n\r\n```js\r\nhandleClick() { // missing `event` argument\r\n  this.setState({\r\n  \ttext: event.target.value // uses the `event` global: oops!\r\n  });\r\n}\r\n```\r\n\r\nThis package exports a list of globals that are often used by mistake. You can feed this list to a static analysis tool like ESLint to prevent their usage without an explicit `window.` qualifier.\r\n\r\n## Installation\r\n\r\n```sh\r\nnpm install --save confusing-browser-globals\r\n```\r\n\r\n## Usage\r\n\r\nIf you use Create React App, you don't need to configure anything, as this rule is already included in the default `eslint-config-react-app` preset.\r\n\r\nIf you maintain your own ESLint configuration, you can do this:\r\n\r\n```js\r\nvar restrictedGlobals = require('confusing-browser-globals');\r\n\r\nmodule.exports = {\r\n  rules: {\r\n    'no-restricted-globals': ['error'].concat(restrictedGlobals),\r\n  },\r\n};\r\n```\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md"}