Show unused public properties and methods
See original GitHub issueIt would be nice to have unused detection expanded, capable of detecting unused methods, exports, etc.
Code Example
Shape.js
class Shape {
constructor() {
this.color = 'red';
}
colorLog() {
console.log(this.color);
}
}
export default Shape;
Circle.js
import Shape from "./Shape";
class Circle extends Shape {
constructor() {
super();
// FIXME: description should show as unused in VSCode, as it does in WebStorm.
this.description = 'A circle shape';
}
// FIXME: circleLog should show as unused in VSCode, as it does in WebStorm.
circleLog() {
// NOTE: both VSCode and WebStorm have detected an unused variable.
const num = 2;
// NOTE: colorLog is being used, so no unused code errors in Shape.js file.
super.colorLog();
}
}
// FIXME: export should show as unused in VSCode, as it does in WebStorm.
export default Circle;
VSCode Screen
WebStorm Screen
Issue Analytics
- State:
- Created 5 years ago
- Reactions:79
- Comments:18 (1 by maintainers)
Top Results From Across the Web
Remove unused classes, properties, and functions
To find unused members with a Code Analysis Ruleset, from the Visual Studio menu select File -> New -> File… -> General ->...
Read more >Eliminating unused methods, properties and classes - MSDN
You can find it the option on the "build" tab. This will show unused properties, variables, methods etc. as errors. Thanks, but that...
Read more >How to easyily find unused public methods/properties
My task is to identify methods and properties which are not used, but exist in the projects. Well, I can find private methods...
Read more >Detecting Unused Private Properties, Methods, and Constants
Detecting Unused Private Properties, Methods, and Constants ; class Foo ; { private ; Bar $bar ; // only written - never read!...
Read more >Find unused private and public methods with Resharper
Find unused private and public methods with Resharper ... There are times when you find dependencies of some legacy code in a method...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Another vote for this feature, first priority IMO would be some kind of indication for unused variables - grey/red squiggles, don’t care much.
is there any news about this issue?