Skip to content

Commit

Permalink
Merge pull request #31 from edvardchen/ignore-default-assignment
Browse files Browse the repository at this point in the history
Ignore default assignment
  • Loading branch information
edvardchen authored Aug 2, 2020
2 parents a6484bc + 63cabf5 commit 0a2ee26
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 83 deletions.
5 changes: 5 additions & 0 deletions lib/rules/no-literal-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,11 @@ module.exports = {
}
},

'AssignmentPattern > Literal'(node) {
// allow function bar(input = 'foo') {}
visited.add(node);
},

'CallExpression Literal'(node) {
const parent = getNearestAncestor(node, 'CallExpression');
if (isValidFunctionCall(parent)) visited.add(node);
Expand Down
Loading

0 comments on commit 0a2ee26

Please sign in to comment.