New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@putout/plugin-remove-unused-variables

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@putout/plugin-remove-unused-variables

putout plugin adds ability to find and remove unused variables


Version published
Weekly downloads
12K
decreased by-3.71%
Maintainers
1
Weekly downloads
 
Created

putout-plugin-remove-unused-variables NPM version Dependency Status

putout plugin adds ability to find and remove unused variables.

Install

npm i @putout/plugin-remove-unused-variables

Rule

Rule remove-unused-variables is enabled by default, to disable add to .putout.json:

{
    "rules": {
        "remove-unused-variables": false
    }
}

Code Example

const {readFileSync} = require('fs');
const source = readFileSync('./1.js', 'utf8');

const putout = require('putout');

console.log(source);
// outputs
`
const t = 'hello';
const a = t;
`

const result = putout(source, {
    plugins: [
        'remove-unused-variables'
    ]
});
// returns
`
const t = 'hello';
`

License

MIT

FAQs

Package last updated on 28 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts