Skip to content

Conversation

sheetalkamat
Copy link
Member

It won't not be marked as isReferenced in resolveName when there is no diagnosticMessage when resolving it.
Fixes #10312

//@noUnusedLocals:true
//@noUnusedParameters:true
//@module: commonjs
//@jsx: react
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a test for reactNamesapce and noUnusedLocals

@@ -0,0 +1,23 @@
//@noUnusedLocals:true
//@noUnusedParameters:true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you do not need the unused params here.

@sheetalkamat sheetalkamat merged commit 67873ca into master Oct 19, 2016
@sheetalkamat sheetalkamat deleted the unusedLocals branch October 19, 2016 20:44
@bartosz-k
Copy link

what about custom JSX backend using reactNamespace param in tsconfig.json? Is it handled here too?

@mhegazy
Copy link
Contributor

mhegazy commented Oct 19, 2016

what about custom JSX backend using reactNamespace param in tsconfig.json? Is it handled here too?

yup. see the test in https://github.com/Microsoft/TypeScript/blob/67873ca20b334c0b21e2a70440ab431a8b4bc41b/tests/cases/compiler/unusedImports15.ts

@fspillner
Copy link

It seems, that it doesn't work with new jsxFactory param in tsconfig.json. Can somebody confirm this? Should I open new issue?

@mhegazy
Copy link
Contributor

mhegazy commented Feb 15, 2017

Should I open new issue?

yes please.

@fspillner
Copy link

@mhegazy here you go: #14109

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--noUnusedLocals doesn't consider React to be "used" when using JSX files
5 participants