See which variables in a JavaScript object are unused?
Is there a way to easily see which variables in a JavaScript object are not being used?
If I have a variable which is unused then it's greyed out, which is really helpful:
let foo = 'bar'
However with the following code, neither `one` nor `two` are greyed out, even though `two` is not being used
let obj = {
one: '1',
two: '2'
}
const thing = obj.one;
Please sign in to leave a comment.
Try enabling Report unused properties in Settings | Editor | Inspections, JavaScript and TypeScript | Unused symbols | Unused global symbol
Ive tried that but no change.
works fine for me in 2020.1.1:
Could it be because Im using a .tsx file?
Works for me in .tsx:
make sure that there are no occurrences of `two` in your project
There defiantly arn't in this file, however there might be elsewhere in the project.