File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 10
10
// ------------------------------------------------------------------------------
11
11
12
12
const RuleTester = require ( 'eslint' ) . RuleTester ;
13
+ const semver = require ( 'semver' ) ;
14
+ const eslintVersion = require ( 'eslint/package.json' ) . version ;
13
15
const rule = require ( '../../../lib/rules/jsx-indent' ) ;
14
16
15
17
const parsers = require ( '../../helpers/parsers' ) ;
@@ -1142,6 +1144,24 @@ const Component = () => (
1142
1144
` ,
1143
1145
options : [ 2 ] ,
1144
1146
} ,
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
+ } ,
1145
1165
] ) ,
1146
1166
1147
1167
invalid : parsers . all ( [
You can’t perform that action at this time.
0 commit comments