Skip to content

Commit f40f88e

Browse files
committed
[Tests] jsx-indent: add passing test case
Closes #1427
1 parent b71b6a4 commit f40f88e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/lib/rules/jsx-indent.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
// ------------------------------------------------------------------------------
1111

1212
const RuleTester = require('eslint').RuleTester;
13+
const semver = require('semver');
14+
const eslintVersion = require('eslint/package.json').version;
1315
const rule = require('../../../lib/rules/jsx-indent');
1416

1517
const parsers = require('../../helpers/parsers');
@@ -1142,6 +1144,24 @@ const Component = () => (
11421144
`,
11431145
options: [2],
11441146
},
1147+
{
1148+
code: `
1149+
type Props = {
1150+
email: string,
1151+
password: string,
1152+
error: string,
1153+
}
1154+
1155+
const SomeFormComponent = ({
1156+
email,
1157+
password,
1158+
error,
1159+
}: Props) => (
1160+
// JSX
1161+
);
1162+
`,
1163+
features: ['flow'].concat(semver.satisfies(eslintVersion, '< 8') ? 'no-babel-old' : []),
1164+
},
11451165
]),
11461166

11471167
invalid: parsers.all([

0 commit comments

Comments
 (0)