Skip to content

Commit

Permalink
Fix comment handling in jsx-curly-spacing (fixes #165)
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickcr committed Jul 27, 2015
1 parent e67538b commit 3556264
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/rules/jsx-curly-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ module.exports = function(context) {
var penultimate = context.getLastToken(node, 1);
var last = context.getLastToken(node);

if (first === penultimate && second === last) {
return;
}

validateBraceSpacing(node, first, second, penultimate, last);
}
};
Expand Down
6 changes: 6 additions & 0 deletions tests/lib/rules/jsx-curly-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ eslintTester.addRuleTest('lib/rules/jsx-curly-spacing', {
].join('\n'),
args: [1, 'never'],
ecmaFeatures: {jsx: true}
}, {
code: [
'<div>{/* comment */}</div>;'
].join('\n'),
args: [1, 'never'],
ecmaFeatures: {jsx: true}
}],

invalid: [{
Expand Down

0 comments on commit 3556264

Please sign in to comment.