Skip to content

Commit 589231a

Browse files
committed
Add SpreadElement support to boolean-prop-naming
1 parent cb4d21e commit 589231a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/rules/boolean-prop-naming.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ module.exports = {
6868
* @param {Object} node The node we're getting the name of
6969
*/
7070
function getPropKey(node) {
71-
// Check for `ExperimentalSpreadProperty` so we can skip validation of those fields.
72-
// Otherwise it will look for `node.value.property` which doesn't exist and breaks Eslint.
73-
if (node.type === 'ExperimentalSpreadProperty') {
71+
// Check for `ExperimentalSpreadProperty` (ESLint 3/4) and `SpreadElement` (ESLint 5)
72+
// so we can skip validation of those fields.
73+
// Otherwise it will look for `node.value.property` which doesn't exist and breaks ESLint.
74+
if (node.type === 'ExperimentalSpreadProperty' || node.type === 'SpreadElement') {
7475
return null;
7576
}
7677
if (node.value.property) {

0 commit comments

Comments
 (0)