Skip to content

vkrol/typescript-missing-nounusedlocals-error-for-react-with-new-jsx-transform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

typescript-missing-nounusedlocals-error-for-react-with-new-jsx-transform

microsoft/TypeScript#41882

Steps

  1. Run yarn
  2. Run yarn typecheck
Done in 1.98s.
  1. Replace index.tsx file content with the following code:
import React from "react";

export function Foo() {
  return <div />;
}
  1. Run yarn typecheck
index.tsx:1:1 - error TS6133: 'React' is declared but its value is never read.

1 import React from "react";
  ~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 1 error.

Result

The first run does not throw the error unlike the second one.