Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
requireDollarBeforejQueryAssignment: do not blow up on reset parameter
Browse files Browse the repository at this point in the history
Fixes #2285
  • Loading branch information
markelog committed Jul 1, 2016
1 parent b419c66 commit 6ae32ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/require-dollar-before-jquery-assignment.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ module.exports.prototype = {
props.forEach(function(prop) {
left = prop.key;

if (!left.name) {
if (!left || !left.name) {
return;
}

Expand Down
4 changes: 4 additions & 0 deletions test/specs/rules/require-dollar-before-jquery-assignment.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ describe('rules/require-dollar-before-jquery-assignment', function() {
checker.configure({ requireDollarBeforejQueryAssignment: true });
});

it('should not blow up on rest params', function() {
expect(checker.checkString('var x = {...test}')).to.have.no.errors();
});

it('should report basic jquery operator', function() {
expect(checker.checkString('var x = $();'))
.to.have.one.validation.error.from('requireDollarBeforejQueryAssignment');
Expand Down

0 comments on commit 6ae32ac

Please sign in to comment.