Greetings all. I have noUnusedLocals set to true, and it flags an error when inside a class method. However, is just flagging a warning when it is an unused class property directly inside my class. I would like typescript to flag a error, instead of just a warning. Is this possible?
#noUnusedLocals
31 messages · Page 1 of 1 (latest)
Hover over it? TS doesn't normally give warnings, so could be eslint interferring?
a class property isn't a local variable, so this'll be under something else, if such a rule exists
oh yeah ts doesn't have that, that warning is from something else.
@blazing sun @worthy pollen thanks both.
This error comes from StencilJs... We are using @stencil-community rules, like the following:
"@stencil-community/no-unused-watch": "error", // This rule catches Stencil Watchs with non existing Props or States
I have had a look at the stencil-eslint documentation, but there doesn't seems to be a rule for unused properties:
this works for JS private members (#)
Oh I see, that is typescript
I am trying your suggestion now
so tested it, and TS shows that message, but doesn't give yellows squigglies for me
So I'm not sure what's causing that
should work if you use #foo, but not private foo
You are right
Why is this?
#foo is javascript, private foo is typescript
yes #foo is private
private foo is fake private. TS will prevent you from accessing it, but it is still there and can be accessed with JS or @surreal shore
isn't some sort of eslint for typescript ?
the real private with # is probably better IMO
Yes, but I couldn't see a rule for it
Consider just using # instead
typescript eslint is @cold edge-eslint/xxxx
You could suggest it i guess
Thanks!