Unused JavaScript functions/constants/exports

Hi,

Just as I upgraded to PyCharm 2017.2, I am seeing some issues with the IDE not recognizing when a JavaScript export is used or not. This was not the case in 2017.1 and is definitely a regression. please see below:

// sagas/clientBlockTradeSagas.js

// sagas/index.js 

 

Any ideas?

0
6 comments

can't recreate - function is not reported as unused to me:

sample project that shows up the issue would be helpful

0
Avatar
Permanently deleted user

Hi, 
Happens to me too in latest version of PhpStorm 2017.2.1 (Build #PS-172.3544.41, built on August 2, 2017).

I work with React and most components are loaded via ReactRouter (so no direct importing inside codebase). And now I see Unused default export and underlined export default. That was not a case in previous version of IDE.

0

 if the exported module is not imported in your code, 'unused export' warnings are expected...

0
Avatar
Permanently deleted user

This is actually my fault. I closed the IDE when indexing was happening and it seems like indexing aborted for some reason. Not sure if this is a bug or not. But indexing didn't complete hence the error. Dominik's error is different though and I agree with your diagnosis...

1
Avatar
Permanently deleted user

@Elena: what if I'm creating a module that is used from a different project? The exported function is not going to be used in the current project.

1

Just suppress the warning then - Alt+Enter, Right, Suppress for statement

2

Please sign in to leave a comment.