@putout/plugin-remove-unreferenced-variables
Version:
πPutout plugin adds ability to find and remove unreferenced variables
53 lines (35 loc) β’ 999 B
Markdown
# @putout/plugin-remove-unreferenced-variables [![NPM version][NPMIMGURL]][NPMURL]
[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-remove-unreferenced-variables.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-remove-unreferenced-variables "npm"
> A **variable** is a named reference to a **value**.
>
> (c) [MDN](https://developer.mozilla.org/en-US/docs/Glossary/Variable)
π[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to find and remove **variables** without **references**. Merged with [`@putout/plugin-variables`](https://www.npmjs.com/package/@putout/plugin-variables).
## Install
```
npm i @putout/plugin-remove-unreferenced-variables -D
```
## Rule
```json
{
"rules": {
"remove-unreferenced-variables": "on"
}
}
```
## β Example of incorrect code
```js
let a;
let b;
a = 5;
b = 6;
console.log(a);
```
## β
Example of correct code
```js
let a;
a = 5;
console.log(a);
```
## License
MIT