Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
eslint-plugin-no-unused-vars-rest
Advanced tools
Readme
An enhanced version of the ESLint core rule no-unused-vars with allowances for experimental object rest properties.
This plugin provides a single rule which functions the same as the core rule no-unused-vars
, except it adds the ignoreDestructuredVarsWithRest
option. Enabling this option will allow unused variables appearing in destructuring assignments that also contain experimental rest properties. This is useful for shallow-cloning an object while omitting certain properties.
Install ESLint and eslint-plugin-no-unused-vars-rest
:
$ npm install --save-dev eslint eslint-plugin-no-unused-vars-rest
Add no-unused-vars-rest
to the plugins section of your .eslintrc
configuration file, and configure the rule under the rules section. Don't forget to disable the core rule no-unused-vars
.
{
"plugins": [
"no-unused-vars-rest"
],
"rules": {
"no-unused-vars": 0,
"no-unused-vars-rest/no-unused-vars": [2, {"ignoreDestructuredVarsWithRest": true}]
}
}
Alternatively you may use the plugin's recommended configuration, which applies the above configuration.
{
"extends": ["plugin:no-unused-vars-rest/recommended"]
}
When not using this rule the following pattern is considered a problem by the core rule no-unused-vars
:
const { extra, ...rest } = blah; // Error 'extra' is defined but never used.
return rest;
When using this rule with ignoreDestructuredVarsWithRest: true
the following pattern is acceptable:
const { extra, ...rest } = blah;
return rest;
FAQs
An enhanced version of the ESLint core rule no-unused-vars with allowances for experimental object rest properties.
The npm package eslint-plugin-no-unused-vars-rest receives a total of 148 weekly downloads. As such, eslint-plugin-no-unused-vars-rest popularity was classified as not popular.
We found that eslint-plugin-no-unused-vars-rest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.