Skip to content

Commit

Permalink
Mark jsxFactorySymbol as referenced for noUnusedLocals even in verbat…
Browse files Browse the repository at this point in the history
…imModuleSyntax
  • Loading branch information
andrewbranch committed Jul 8, 2024
1 parent 3163fe7 commit b990096
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33371,7 +33371,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {

checkJsxPreconditions(node);

markLinkedReferences(node, ReferenceHint.Jsx);
markJsxAliasReferenced(node);

if (isNodeOpeningLikeElement) {
const jsxOpeningLikeNode = node;
Expand Down
14 changes: 14 additions & 0 deletions tests/cases/compiler/verbatimModuleSyntaxReactReference.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// @module: preserve
// @verbatimModuleSyntax: true
// @jsx: react
// @noEmit: true
// @noUnusedLocals: true
// @noTypesAndSymbols: true

// @Filename: react.d.ts
declare module 'react';

// @Filename: index.tsx
import React from 'react';

export const build = <div>hello </div>;

0 comments on commit b990096

Please sign in to comment.