IssueRaiser

Show unused public properties and methods

It would be nice to have unused detection expanded, capable of detecting unused methods, exports, etc. **Code Example** _Shape.js_ ```javascript class Shape { constructor() { this.color = 'red'; } colorLog() { console.log(this.color); } } export default Shape; ``` _Circle.js_ ```javascript 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** <img width="1440" alt="screen shot 2019-01-04 at 9 23 48 pm" src="https://user-images.githubusercontent.com/12591890/50719791-161a2980-1067-11e9-8b16-3f4e4fe6b531.png"> **WebStorm Screen** <img width="1440" alt="screen shot 2019-01-04 at 9 23 07 pm" src="https://user-images.githubusercontent.com/12591890/50719793-1ca8a100-1067-11e9-8c17-071746dd085f.png">

Posted by jabacchetta on Jan 5, 2019, 3:24 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.4,000 issues0 comments

github (Other)

Show unused public properties and methods

jabacchettaJan 5, 2019, 3:24 AM

It would be nice to have unused detection expanded, capable of detecting unused methods, exports, etc. **Code Example** _Shape.js_ ```javascript class Shape { constructor() { this.color = 'red'; } colorLog() { console.log(this.color); } } export default Shape; ``` _Circle.js_ ```javascript 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** <img width="1440" alt="screen shot 2019-01-04 at 9 23 48 pm" src="https://user-images.githubusercontent.com/12591890/50719791-161a2980-1067-11e9-8b16-3f4e4fe6b531.png"> **WebStorm Screen** <img width="1440" alt="screen shot 2019-01-04 at 9 23 07 pm" src="https://user-images.githubusercontent.com/12591890/50719793-1ca8a100-1067-11e9-8c17-071746dd085f.png">

Comments (0)

No comments yet. Start the discussion.

Comment on this issue