Skip to content

Commit

Permalink
🎨 Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Anees Iqbal committed Dec 27, 2020
1 parent 83921d7 commit 5b45d48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
3 changes: 1 addition & 2 deletions lib/rules/jsx-embed-condition.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ module.exports = {
}
context.report({
node,
message:
'Using && to condition JSX embeds is forbidden. Convert it to a ternary operation instead'
message: 'Using && to condition JSX embeds is forbidden. Convert it to a ternary operation instead'
});
}
};
Expand Down
12 changes: 4 additions & 8 deletions tests/lib/rules/jsx-embed-condition.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const RuleTester = require('eslint').RuleTester;
const rule = require('../../../lib/rules/jsx-embed-condition');

const parserOptions = {
ecmaVersion: 2018,
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true
Expand All @@ -40,13 +40,9 @@ ruleTester.run('jsx-embed-condition', rule, {
code: '<App>{x ? <div>{y ? <y /> : <z />}</div> : null}</App>'
}, {
code: '<App x={x && y}>{x ? <div>{y ? <y /> : <z />}</div> : null}</App>'
}
// {
// code: '<App test>{x ?? <div />}</App>'
// }
// TODO: ^ Using above gives a Parsing error in ESLint.
// Is the parser out of date
],
}, {
code: '<App test>{x ?? <div />}</App>'
}],

invalid: [{
code: '<div>{x && <div />}</div>',
Expand Down

0 comments on commit 5b45d48

Please sign in to comment.