Can WebStorm 'audit' my imports in a NodeJS project to inform me when (and _where_) I need to only import some exports?

I'd like to be able to go through my project and change things like

import R from 'ramda'

const sillyValue = R.add(2,3)



to 

import {add} from 'ramda'

const sillyValue = add(2,3)


Does WebStorm have any kind of 'audit' function whereby it will change all the instances where an entire library is being imported to only import the exports used?  That is, do that for all the modules in the project at once.

I've found 'Optimize Imports' (https://blog.jetbrains.com/webstorm/2018/05/optimize-imports-in-webstorm/) -- would that be what I'm looking for? 

1 comment
Comment actions Permalink

WebStorm doesn't include such inspection; you can try using ESLint for this, see eslint-plugin-import plugin, no-named-as-default-member rule

0

Please sign in to leave a comment.