Skip to content

Commit e85fc46

Browse files
committed
ESLint: Enable ignoreRestSiblings option for no-unused-vars rule
1 parent a972672 commit e85fc46

File tree

9 files changed

+7
-24
lines changed

9 files changed

+7
-24
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/block-library/src/comments-title/deprecated.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ export default [
1818
},
1919
supports,
2020
migrate: ( oldAttributes ) => {
21-
/* eslint-disable no-unused-vars */
2221
const {
2322
singleCommentLabel,
2423
multipleCommentsLabel,
2524
...newAttributes
2625
} = oldAttributes;
27-
/* eslint-enable no-unused-vars */
2826
return newAttributes;
2927
},
3028
isEligible: ( { multipleCommentsLabel, singleCommentLabel } ) =>

packages/components/src/mobile/bottom-sheet/keyboard-avoiding-view.native.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,8 @@ class KeyboardAvoidingView extends Component {
9898
}
9999

100100
render() {
101-
const {
102-
children,
103-
enabled,
104-
keyboardVerticalOffset, // eslint-disable-line no-unused-vars
105-
style,
106-
...props
107-
} = this.props;
101+
const { children, enabled, keyboardVerticalOffset, style, ...props } =
102+
this.props;
108103

109104
let finalStyle = style;
110105
if ( Platform.OS === 'ios' ) {

packages/components/src/navigation/use-navigation-tree-nodes.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ export const useNavigationTreeNodes = () => {
99
const getNode = ( key ) => nodes[ key ];
1010

1111
const addNode = ( key, value ) => {
12-
// eslint-disable-next-line no-unused-vars
1312
const { children, ...newNode } = value;
1413
return setNodes( ( original ) => ( {
1514
...original,
@@ -19,7 +18,6 @@ export const useNavigationTreeNodes = () => {
1918

2019
const removeNode = ( key ) => {
2120
return setNodes( ( original ) => {
22-
// eslint-disable-next-line no-unused-vars
2321
const { [ key ]: removedNode, ...remainingNodes } = original;
2422
return remainingNodes;
2523
} );

packages/editor/src/components/provider/index.native.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -319,13 +319,7 @@ class NativeEditorProvider extends Component {
319319
}
320320

321321
render() {
322-
const {
323-
children,
324-
post, // eslint-disable-line no-unused-vars
325-
capabilities,
326-
settings,
327-
...props
328-
} = this.props;
322+
const { children, post, capabilities, settings, ...props } = this.props;
329323
const editorSettings = this.getEditorSettings( settings, capabilities );
330324

331325
return (

packages/eslint-plugin/configs/es5.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ module.exports = {
5252
'no-unreachable': 'error',
5353
'no-unsafe-negation': 'error',
5454
'no-unused-expressions': 'error',
55-
'no-unused-vars': 'error',
55+
'no-unused-vars': [ 'error', { ignoreRestSiblings: true } ],
5656
'no-useless-return': 'error',
5757
'no-whitespace-before-property': 'error',
5858
'no-with': 'error',

packages/eslint-plugin/configs/jshint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = {
99
'no-trailing-spaces': 'error',
1010
'no-undef': 'error',
1111
'no-unused-expressions': 'error',
12-
'no-unused-vars': 'error',
12+
'no-unused-vars': [ 'error', { ignoreRestSiblings: true } ],
1313
'one-var': [ 'error', 'always' ],
1414
quotes: [ 'error', 'single' ],
1515
'wrap-iife': [ 'error', 'any' ],

packages/react-native-aztec/src/AztecView.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ class AztecView extends Component {
214214
}
215215

216216
render() {
217-
// eslint-disable-next-line no-unused-vars
218217
const { onActiveFormatsChange, ...otherProps } = this.props;
219218
// `style` has to be destructured separately, without `otherProps`, because of:
220219
// https://github.com/WordPress/gutenberg/issues/23611

packages/react-native-editor/src/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ const registerGutenberg = ( {
3636
constructor( props ) {
3737
super( props );
3838

39-
// eslint-disable-next-line no-unused-vars
4039
const { rootTag, ...parentProps } = this.props;
4140

4241
// Setup locale.

0 commit comments

Comments
 (0)