mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 03:23:08 -06:00
Fix regression no codefix for ts2657 (#43635)
* Fix regression no codefix for ts2657 Fixes #43454 * remove unnecessary check
This commit is contained in:
parent
87d0b3e07a
commit
ab81bf734e
@ -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;
|
||||
|
||||
7
tests/cases/fourslash/codeFixWrapJsxInFragment3.ts
Normal file
7
tests/cases/fourslash/codeFixWrapJsxInFragment3.ts
Normal 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);
|
||||
7
tests/cases/fourslash/codeFixWrapJsxInFragment4.ts
Normal file
7
tests/cases/fourslash/codeFixWrapJsxInFragment4.ts
Normal 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);
|
||||
Loading…
x
Reference in New Issue
Block a user