Skip to content

Commit 5b45d48

Browse files
author
Anees Iqbal
committed
🎨 Address review comments
1 parent 83921d7 commit 5b45d48

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

lib/rules/jsx-embed-condition.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ module.exports = {
3737
}
3838
context.report({
3939
node,
40-
message:
41-
'Using && to condition JSX embeds is forbidden. Convert it to a ternary operation instead'
40+
message: 'Using && to condition JSX embeds is forbidden. Convert it to a ternary operation instead'
4241
});
4342
}
4443
};

tests/lib/rules/jsx-embed-condition.js

+4-8
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const RuleTester = require('eslint').RuleTester;
1313
const rule = require('../../../lib/rules/jsx-embed-condition');
1414

1515
const parserOptions = {
16-
ecmaVersion: 2018,
16+
ecmaVersion: 2020,
1717
sourceType: 'module',
1818
ecmaFeatures: {
1919
jsx: true
@@ -40,13 +40,9 @@ ruleTester.run('jsx-embed-condition', rule, {
4040
code: '<App>{x ? <div>{y ? <y /> : <z />}</div> : null}</App>'
4141
}, {
4242
code: '<App x={x && y}>{x ? <div>{y ? <y /> : <z />}</div> : null}</App>'
43-
}
44-
// {
45-
// code: '<App test>{x ?? <div />}</App>'
46-
// }
47-
// TODO: ^ Using above gives a Parsing error in ESLint.
48-
// Is the parser out of date
49-
],
43+
}, {
44+
code: '<App test>{x ?? <div />}</App>'
45+
}],
5046

5147
invalid: [{
5248
code: '<div>{x && <div />}</div>',

0 commit comments

Comments
 (0)