Skip to content

Commit

Permalink
Fix: comma-dangle was confused by type annotations (fixes #7370) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea committed Oct 17, 2016
1 parent 7525042 commit 681c78a
Show file tree
Hide file tree
Showing 6 changed files with 4,181 additions and 6 deletions.
5 changes: 0 additions & 5 deletions lib/rules/comma-dangle.js
Expand Up @@ -171,15 +171,10 @@ module.exports = {
function getTrailingToken(node, lastItem) {
switch (node.type) {
case "ObjectExpression":
case "ObjectPattern":
case "ArrayExpression":
case "ArrayPattern":
case "CallExpression":
case "NewExpression":
return sourceCode.getLastToken(node, 1);
case "FunctionDeclaration":
case "FunctionExpression":
return sourceCode.getTokenBefore(node.body, 1);
default: {
const nextToken = sourceCode.getTokenAfter(lastItem);

Expand Down

0 comments on commit 681c78a

Please sign in to comment.