{"name":"@putout/plugin-declare-before-reference","version":"10.5.0","type":"module","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout plugin adds ability move declarations before references","homepage":"http://github.com/coderaiser/putout/tree/master/packages/plugin-declare-before-reference#readme","main":"lib/declare-before-reference.js","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git+https://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","putout-plugin-apply","plugin","declare-before-reference"],"devDependencies":{"@putout/eslint-flat":"^4.0.0","@putout/plugin-arguments":"*","@putout/plugin-destructuring":"*","@putout/plugin-nodejs":"*","@putout/plugin-printer":"*","@putout/plugin-promises":"*","@putout/plugin-putout":"*","@putout/plugin-remove-nested-blocks":"*","@putout/plugin-tape":"*","@putout/plugin-try-catch":"*","@putout/plugin-variables":"*","@putout/test":"^15.0.0","eslint":"^10.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^31.0.0","madrun":"^13.0.0","nodemon":"^3.0.1","superc8":"^12.0.0"},"peerDependencies":{"putout":">=42"},"license":"MIT","engines":{"node":">=22"},"publishConfig":{"access":"public"},"_id":"@putout/plugin-declare-before-reference@10.5.0","gitHead":"e0ef86af97e259ab830012ed9cc118c00a89d42e","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"25.9.0","_npmVersion":"11.4.2","dist":{"integrity":"sha512-AgMWDjl5pE6i3lfjPPduiE2RJOP6psY69YVbJXou2+mZXk6E3IXoThLDDz9dcteVK31Ls//rjjUZKvpr+AGpPw==","shasum":"9b1b02a1547142e74e9f5b2ab08dda32d17d3cee","tarball":"http://registry-npm.ywwl.com/@putout/plugin-declare-before-reference/download/@putout/plugin-declare-before-reference-10.5.0.tgz","fileCount":4,"unpackedSize":9931,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCXYUTwAs4D4dbB/DuNUr62FD0DYWOuUrE0AB45BTnnwAIgFQCMnfBVaA/vn8kMYu5rSgjr0TgP/50E3vPd7QKS6pI="}],"size":3447,"noattachment":false,"key":"/@putout/plugin-declare-before-reference/-/@putout/plugin-declare-before-reference-10.5.0.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-declare-before-reference_10.5.0_1777322068340_0.6756475125239549"},"_hasShrinkwrap":false,"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":1777322068474,"_cnpm_publish_time":1777322068474,"dist-tags":{"latest":"10.5.0"}}