Registry / devops / eslint-plugin-no-unused-vars-rest

eslint-plugin-no-unused-vars-rest

JSON →
library1.0.6jsnpmunverified

DEPRECATED ESLint plugin (v1.0.6, final release) that extended the core no-unused-vars rule with an ignoreDestructuredVarsWithRest option, allowing unused variables in destructuring patterns containing rest properties. As of ESLint 3.15.0 (December 2016), the core no-unused-vars rule natively supports this behavior via the ignoreRestSiblings option. This plugin is no longer maintained and should not be used in new projects. It only supports ESLint 3.x and has no releases beyond v1.0.6.

npm install eslint-plugin-no-unused-vars-rest
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-NO-U
E
eslint-plugin-no-unused-vars-rest
devopsjavascriptv1.0.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Plugin
In .eslintrc: { "plugins": ["no-unused-vars-rest"], "rules": { "no-unused-vars-rest/no-unused-vars": [2, { "ignoreDestructuredVarsWithRest": true }] } }
Using plugin without disabling core no-unused-vars rule
Plugin provides a single rule; you must disable the core 'no-unused-vars' rule to avoid conflicts.
Recommended config
In .eslintrc: { "extends": ["plugin:no-unused-vars-rest/recommended"] }
Using plugin:no-unused-vars-rest/recommended without also disabling core rule
The recommended config automatically disables the core rule and enables the plugin rule with ignoreDestructuredVarsWithRest: true.
Rule config (error level)
"no-unused-vars-rest/no-unused-vars": ["error", { "ignoreDestructuredVarsWithRest": true }]
"no-unused-vars-rest/no-unused-vars": [2, { "ignoreDestructuredVarsWithRest": true }]
ESLint supports both integer (0/1/2) and string (off/warn/error) severities. The plugin accepts the same options as core no-unused-vars plus ignoreDestructuredVarsWithRest.

Shows how to configure the plugin to ignore unused variables in destructuring with rest, and demonstrates the feature with a common pattern.

// Install: npm install --save-dev eslint eslint-plugin-no-unused-vars-rest // .eslintrc.json { "plugins": ["no-unused-vars-rest"], "rules": { "no-unused-vars": "off", "no-unused-vars-rest/no-unused-vars": ["error", { "ignoreDestructuredVarsWithRest": true }] } } // Example file: test.js const { extra, ...rest } = { a: 1, b: 2 }; // 'extra' is used in destructuring but not referenced -> normally an error, now allowed module.exports = rest;
Debug
Known issues
deprecatedThis plugin is deprecated; functionality is now in core ESLint no-unused-vars with ignoreRestSiblings option since ESLint 3.15.0.
fix
Upgrade to ESLint >=3.15.0 and use core rule with ignoreRestSiblings: true instead of this plugin. Example: { 'rules': { 'no-unused-vars': ['error', { 'ignoreRestSiblings': true }] } }
affects: >=1.0.0
breakingIncompatible with ESLint 4+ because of peer dependency on eslint ^3.0.0.
fix
Do not install this plugin with ESLint 4+. Use core no-unused-vars rule instead.
affects: >=1.0.0
gotchaYou must disable the core no-unused-vars rule; otherwise both rules will run and you may get duplicate errors or contradictory behavior.
fix
Add 'no-unused-vars': 'off' or 0 to your ESLint config.
affects: >=1.0.0
Errors
Common errors & fixes
ESLint configuration error: Cannot find module 'eslint-plugin-no-unused-vars-rest'
Plugin not installed or not in node_modules.
fix
Run npm install eslint-plugin-no-unused-vars-rest --save-dev
ESLint configuration error: Rule 'no-unused-vars-rest/no-unused-vars' is not available
Plugin not listed in 'plugins' section of ESLint config.
fix
Add '"no-unused-vars-rest"' to the plugins array in your ESLint config.
Unused variable: 'extra'
IgnoreDestructuredVarsWithRest not enabled or core no-unused-vars rule not disabled.
fix
Enable the plugin rule with ignoreDestructuredVarsWithRest: true and disable core no-unused-vars.
Upgrade
Version history
1.0.6latest on npm
Audit
Dependencies
eslintrequiredpeer dependency; plugin requires ESLint ^3.0.0 and is incompatible with ESLint 2.x or 4+
Agent activity
7 hits · last 30 days
node
6
Resources
eslint-plugin-no-unused-vars-rest — npm install eslint-plugin-no-unused-vars-rest · libregistry