Skip to content

Commit 7e67633

Browse files
test(no-async-subscribe): only enable jsx when needed
1 parent 36f48a3 commit 7e67633

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

tests/rules/no-async-subscribe.test.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { noAsyncSubscribeRule } from '../../src/rules/no-async-subscribe';
33
import { fromFixture } from '../etc';
44
import { ruleTester } from '../rule-tester';
55

6-
ruleTester({ types: true, jsx: true }).run('no-async-subscribe', noAsyncSubscribeRule, {
6+
ruleTester({ types: true }).run('no-async-subscribe', noAsyncSubscribeRule, {
77
valid: [
88
stripIndent`
99
// sync arrow function
@@ -17,12 +17,15 @@ ruleTester({ types: true, jsx: true }).run('no-async-subscribe', noAsyncSubscrib
1717
1818
of("a").subscribe(function() {});
1919
`,
20-
stripIndent`
21-
// https://github.com/cartant/eslint-plugin-rxjs/issues/46
22-
import React, { FC } from "react";
23-
const SomeComponent: FC<{}> = () => <span>some component</span>;
24-
const someElement = <SomeComponent />;
25-
`,
20+
{
21+
code: stripIndent`
22+
// https://github.com/cartant/eslint-plugin-rxjs/issues/46
23+
import React, { FC } from "react";
24+
const SomeComponent: FC<{}> = () => <span>some component</span>;
25+
const someElement = <SomeComponent />;
26+
`,
27+
languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } },
28+
},
2629
stripIndent`
2730
// https://github.com/cartant/eslint-plugin-rxjs/issues/61
2831
const whatever = {

0 commit comments

Comments
 (0)