{"name":"@putout/plugin-declare-undefined-variables","version":"7.1.1","type":"commonjs","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout plugin adds ability to declare undefined variables","homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-declare-undefined-variables#readme","main":"lib/index.js","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git://github.com/coderaiser/putout.git"},"scripts":{"test":"madrun test","watch:test":"madrun watch:test","lint":"madrun lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","fix:lint":"madrun fix:lint","coverage":"madrun coverage","report":"madrun report"},"dependencies":{},"keywords":["putout","putout-plugin","plugin","declare-undefined-variables"],"devDependencies":{"@putout/plugin-remove-unused-expressions":"*","@putout/plugin-strict-mode":"*","@putout/test":"^5.0.0","c8":"^7.5.0","eslint":"^8.0.1","eslint-plugin-node":"^11.0.0","eslint-plugin-putout":"^15.0.0","lerna":"^5.0.0","madrun":"^9.0.0","montag":"^1.2.1","nodemon":"^2.0.1","supertape":"^7.0.0"},"peerDependencies":{"putout":">=25"},"license":"MIT","engines":{"node":">=16"},"publishConfig":{"access":"public"},"gitHead":"566a284c239da4f4e370905f20205348a759af6c","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_id":"@putout/plugin-declare-undefined-variables@7.1.1","_nodeVersion":"18.3.0","_npmVersion":"8.3.0","dist":{"integrity":"sha512-Bne48v6Ipasl0RuX8LFHISOJHvCPZ6xC2ZscJfoFkfAW8B9WADqX6huYgyRsW1gsJQUzH88A588JKP/IR1KTGw==","shasum":"50f9726e9b624a98b989aa251c497247197c1f33","tarball":"http://registry-npm.ywwl.com/@putout/plugin-declare-undefined-variables/download/@putout/plugin-declare-undefined-variables-7.1.1.tgz","fileCount":11,"unpackedSize":8985,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkfWrO7IH4K4OjXqdyBHofBjf2aDsGyZxDe+jcoLRCAgIgaU8VUs3lUzOG7sOdbJ2d0HexcybVXQZvImjwzL3wTlE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJioyXwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqWZRAAmHXFsABvDhvo8jszuZFc2jV9AYVTc8V4c19nUAFD565a4uQh\r\n1hNyPu+ZlCNcJhpAlC2GA2uESiYsrcdcLgQO+0dRuAfSMpM38Oypiv/78LS4\r\nEhTDxBIq4v7nz5Lc5meuFGWDNALZlM9zcXBajmyNjDgzzT0IZ8L4DrU5pS82\r\n5ecoqAtfnG96/YpQC96KSsl4Oq1jC/PpXDQnl+GSzm0+hrnYcKbzeaOm8ryI\r\noS7K7jK+gQc5uh8itwQrDcTzX71N3OCslkDfpmx0ZDnwLa7nKb1bjO1L4BnN\r\n9wrxQwgFLUG/Qp+rfvqQT23qG86hlzWzJAP5Ii74X+33naPTR43nv9pDNowt\r\nTkhWPIGZ34GG79AyosrrgbsaO6E3uQBf+ofNgsMbhK3nRWT/GXaTU2NEpEY8\r\nK7frh4aQxOdLzFuaBz/tHzz7oDsL5qm7QpXleFjzaRAmkQu7YFWQryrpmbec\r\nxU5K666k3HTTwdUOdi0M5wwjWy5riwM/4wXyAD87LAT6TUHIwkfG7IuWeQmR\r\ntT6nkp4Rev5aVQ7gxWc+4U/dEeLhjqmfKwXt7BF+7qfCL6VCcnUjCYFfoJIQ\r\nfujX/pPJOLP8/9C/GmUT5y1yxIJpvXDDC0+U3Qe72yW/ZCPm6rJ2gcMJ08jA\r\nomOkC/66LcO6VSbKM1ZKD8uHvyxyU35p8ow=\r\n=PCWY\r\n-----END PGP SIGNATURE-----\r\n","size":3329,"noattachment":false,"key":"/@putout/plugin-declare-undefined-variables/-/@putout/plugin-declare-undefined-variables-7.1.1.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-declare-undefined-variables_7.1.1_1654859248769_0.6908794795477733"},"_hasShrinkwrap":false,"readme":"# @putout/plugin-declare-undefined-variables [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-declare-undefined-variables.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-declare-undefined-variables\"npm\"\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to declare variable that was not defined before, including:\n\n- is types: `isFn`, `isString`, `isNumber`, `isObject`, `isBool`, `isUndefined`, `isSymbol` and `isNull`;\n- [maybe](https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-maybe#readme): `maybeArray`, `maybeFn`, `maybeEmptyArray`;\n- wrap: `not`,`id`, `returns`;\n- fresh-import: `freshImport`, `freshImportDefault`;\n- `fixtures`: `readFixture(name)`;\n- properties of `Object`;\n- [wraptile](https://github.com/coderaiser/wraptile);\n- [fullstore](https://github.com/coderaiser/fullstore);\n- [currify](https://github.com/coderaiser/currify);\n- [pipe-io](https://github.com/coderaiser/pipe-io);\n- [pullout](https://github.com/coderaiser/pullout);\n- [simport](https://github.com/coderaiser/simport);\n- [chalk](https://www.npmjs.com/package/chalk);\n- [table](https://www.npmjs.com/package/table);\n\nRenamed to [`@putout/plugin-declare`](https://www.npmjs.com/package/@putout/plugin-declare).\n\n## Install\n\n```\nnpm i putout @putout/plugin-declare-undefined-variables -D\n```\n\nAdd `.putout.json` with:\n\n```json\n{\n    \"plugins\": {\n        \"declare-undefined-variables\": \"on\"\n    }\n}\n```\n\n## Rules\n\nUse options:\n\n- ✅ `dismiss` for variables you don't want to declare;\n- ✅ `declarations` to declare variables;\n\n```json\n{\n    \"rules\": {\n        \"declare-undefined-variables\": [\"on\", {\n            \"declarations\": {\n                \"hello\": \"import {hello} from 'world'\"\n            },\n            \"dismiss\": [\n                \"assert\",\n                \"entries\",\n                \"parse\",\n                \"stringify\",\n                \"defineProperty\",\n                \"isArray\",\n                \"noop\",\n                \"join\",\n                \"keys\",\n                \"values\",\n                \"stopAll\",\n                \"once\",\n                \"putout\",\n                \"simport\"\n            ]\n        }]\n    }\n}\n```\n\n# `assign`\n\n## ❌ Example of incorrect code\n\n```js\nconst hello = 'world';\nconst object = {};\n\nassign(object, {\n    hello,\n});\n```\n\n## ✅ Example of correct code\n\n```js\nconst hello = 'world';\nconst object = {};\nconst {assign} = Object;\n\nassign(object, {\n    hello,\n});\n```\n\n# `keys`\n\n## ❌ Example of incorrect code\n\n```js\nconst hello = 'world';\nconst object = {};\n\nconst allKeys = keys(object);\n```\n\n## ✅ Example of correct code\n\n```js\nconst hello = 'world';\nconst object = {};\nconst {keys} = Object;\n\nconst allKeys = keys(object);\n```\n\n# `values`\n\n## ❌ Example of incorrect code\n\n```js\nconst object = {};\nconst allValues = values(object);\n```\n\n## ✅ Example of correct code\n\n```js\nconst {values} = Object;\n\nconst object = {};\nconst allValues = values(object);\n```\n\n# `isArray`\n\n## ❌ Example of incorrect code\n\n```js\nisArray(array);\n```\n\n## ✅ Example of correct code\n\n```js\nconst {isArray} = Array;\nisArray(array);\n```\n\n# `noop`\n\n## ❌ Example of incorrect code\n\n```js\nnoop();\n```\n\n## ✅ Example of correct code\n\n```js\nconst noop = () => {};\nnoop();\n```\n\n# Types\n\n## ❌ Example of incorrect code\n\n```js\nif (isFn(fn))\n    fn();\n```\n\n## ✅ Example of correct code\n\n```js\nconst isFn = (a) => typeof a === 'function';\n\nif (isFn(fn))\n    fn();\n```\n\n# Maybe\n\n## ❌ Example of incorrect code\n\n```js\nconst a = [\n    ...maybeArray(b),\n];\n```\n\n## ✅ Example of correct code\n\n```js\nconst {isArray} = Array;\nconst maybeArray = (a) => isArray(a) ? a : [a];\n\nconst a = [\n    ...maybeArray(b),\n];\n```\n\n## License\n\nMIT\n","publish_time":1654859248913,"_cnpm_publish_time":1654859248913,"dist-tags":{"latest":"8.0.3"}}