Fix regression no codefix for ts2657 (#43635)

* Fix regression no codefix for ts2657
Fixes #43454

* remove unnecessary check
This commit is contained in:
Jean Pierre 2021-05-20 14:13:38 -05:00 committed by GitHub
parent 87d0b3e07a
commit ab81bf734e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 4 deletions

View File

@ -5,10 +5,6 @@ namespace ts.codefix {
registerCodeFix({
errorCodes,
getCodeActions: context => {
const { jsx } = context.program.getCompilerOptions();
if (jsx !== JsxEmit.React && jsx !== JsxEmit.ReactNative) {
return undefined;
}
const { sourceFile, span } = context;
const node = findNodeToFix(sourceFile, span.start);
if (!node) return undefined;

View File

@ -0,0 +1,7 @@
/// <reference path='fourslash.ts' />
// @jsx: react-jsx
// @Filename: /a.tsx
////[|<a /><a />|]
verify.rangeAfterCodeFix(`<><a /><a /></>`, /*includeWhiteSpace*/false, /*errorCode*/ undefined, /*index*/ 0);

View File

@ -0,0 +1,7 @@
/// <reference path='fourslash.ts' />
// @jsx: react-jsxdev
// @Filename: /a.tsx
////[|<a></a><a />|]
verify.rangeAfterCodeFix(`<><a></a><a /></>`, /*includeWhiteSpace*/false, /*errorCode*/ undefined, /*index*/ 0);