{"name":"@putout/plugin-declare-before-reference","version":"8.3.0","keywords":["putout","putout-plugin","putout-plugin-apply","plugin","declare-before-reference"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/plugin-declare-before-reference@8.3.0","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"http://github.com/coderaiser/putout/tree/master/packages/plugin-declare-before-reference#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"41f36d424a618205c62ec17fa9020b77a966236b","tarball":"http://registry-npm.ywwl.com/@putout/plugin-declare-before-reference/download/@putout/plugin-declare-before-reference-8.3.0.tgz","fileCount":4,"integrity":"sha512-a4m3xzTQpCcNag0MpbjeIEEyw5UyUfseRqp9aTBfmpb1aQwVMgXw48qzGiUzGcqxQzngs+kKZehVcNS9JEeXdw==","signatures":[{"sig":"MEUCID2kGWeRBdKlAHEvjIfgyP+QEVo4rqE8cR9pdctqw0c1AiEAmJRiTgU161S4AAENgrE5a19pUn02sKqfKyFGCYT1xI0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9169,"size":3276,"noattachment":false,"key":"/@putout/plugin-declare-before-reference/-/@putout/plugin-declare-before-reference-8.3.0.tgz"},"main":"lib/declare-before-reference.js","type":"module","engines":{"node":">=20"},"gitHead":"28d5e685aeccf0baab86a5bc52cdf2a5116c4cdb","release":false,"scripts":{"lint":"madrun lint","test":"madrun test","report":"madrun report","coverage":"madrun coverage","fix:lint":"madrun fix:lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","watch:test":"madrun watch:test"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"changelog":false,"repository":{"url":"git+https://github.com/coderaiser/putout.git","type":"git"},"_npmVersion":"11.4.2","description":"🐊Putout plugin adds ability move declarations before references","directories":{},"_nodeVersion":"25.1.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","eslint":"^9.0.0","madrun":"^11.0.0","nodemon":"^3.0.1","@putout/test":"^14.0.0","eslint-plugin-n":"^17.0.0","@putout/eslint-flat":"^3.0.0","@putout/plugin-tape":"*","eslint-plugin-putout":"^28.0.0","@putout/plugin-nodejs":"*","@putout/plugin-putout":"*","@putout/plugin-printer":"*","@putout/plugin-promises":"*","@putout/plugin-try-catch":"*","@putout/plugin-remove-nested-blocks":"*","@putout/plugin-reuse-duplicate-init":"*","@putout/plugin-remove-useless-arguments":"*","@putout/plugin-remove-useless-variables":"*","@putout/plugin-merge-destructuring-properties":"*"},"peerDependencies":{"putout":">=40"},"_npmOperationalInternal":{"tmp":"tmp/plugin-declare-before-reference_8.3.0_1762981877155_0.8961997432632982","host":"s3://npm-registry-packages-npm-production"},"readme":"# @putout/plugin-declare-before-reference [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-declare-before-reference.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-declare-before-reference \"npm\"\n\n> The `ReferenceError` object represents an error when a variable hasn't yet been initialized in the current scope is referenced.\n>\n> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError)\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to apply declare before reference to avoid `ReferenceError`.\n\nThe rule is similar to **ESLint's** [no-use-before-define](https://eslint.org/docs/rules/no-use-before-define), but it's auto fixable,\nand ignores:\n\n- ✅ Function declarations\n- ✅ Class declarations\n- ✅ Different scopes\n\nAlso it works only on top level and helps to [@operator/declare](https://github.com/coderaiser/putout/tree/master/packages/operator-declare#readme) with a bunch of nested declarations.\n\n## Install\n\n```\nnpm i @putout/plugin-declare-before-reference\n```\n\n## Rule\n\n```json\n{\n    \"rules\": {\n        \"declare-before-reference\": \"on\"\n    }\n}\n```\n\n## ❌ Example of incorrect code\n\n```js\nconst {remove} = operator;\n\nconst {types, operator} = require('putout');\n```\n\n## ✅ Example of correct code\n\n```js\nconst {types, operator} = require('putout');\n\nconst {remove} = operator;\n```\n\n## Comparison\n\nLinter | Rule | Fix\n--------|-------|------------|\n🐊 **Putout** | [`declare-before-reference`](https://github.com/coderaiser/putout/tree/master/packages/plugin-declare-before-reference#readme) | ✅\n⏣ **ESLint** | [`no-use-before-define`](https://eslint.org/docs/rules/no-use-before-define) | ❌\n\n## License\n\nMIT\n","publish_time":1762981877320,"_cnpm_publish_time":1762981877320,"dist-tags":{"latest":"10.5.0"}}