Skip to content

Commit ab81bf7

Browse files
authored
Fix regression no codefix for ts2657 (microsoft#43635)
* Fix regression no codefix for ts2657 Fixes microsoft#43454 * remove unnecessary check
1 parent 87d0b3e commit ab81bf7

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

src/services/codefixes/wrapJsxInFragment.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ namespace ts.codefix {
55
registerCodeFix({
66
errorCodes,
77
getCodeActions: context => {
8-
const { jsx } = context.program.getCompilerOptions();
9-
if (jsx !== JsxEmit.React && jsx !== JsxEmit.ReactNative) {
10-
return undefined;
11-
}
128
const { sourceFile, span } = context;
139
const node = findNodeToFix(sourceFile, span.start);
1410
if (!node) return undefined;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
// @jsx: react-jsx
4+
// @Filename: /a.tsx
5+
////[|<a /><a />|]
6+
7+
verify.rangeAfterCodeFix(`<><a /><a /></>`, /*includeWhiteSpace*/false, /*errorCode*/ undefined, /*index*/ 0);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
// @jsx: react-jsxdev
4+
// @Filename: /a.tsx
5+
////[|<a></a><a />|]
6+
7+
verify.rangeAfterCodeFix(`<><a></a><a /></>`, /*includeWhiteSpace*/false, /*errorCode*/ undefined, /*index*/ 0);

0 commit comments

Comments
 (0)