rokucommunity / bslint

A linter for BrightScript and BrighterScript.
MIT License
27 stars 14 forks source link

Don't mark vars with leading underscores as unused #75

Open TwitchBronBron opened 1 year ago

TwitchBronBron commented 1 year ago

Roku recently introduced the paradigm of using underscores to indicate that a variable is unused. bslint should probably follow the same concept.

Question: Should we revise the 'unused-variable'?: RuleSeverity; to contain options instead of just severity? Perhaps something like:

{
    "unused-variable": "all" | "all-except-leading-underscores" | etc..
}
elsassph commented 1 year ago

I would say this rule should apply to function parameters only.

Maybe introduce unused-parameters rule for functions (see #72), where we would error only if the parameter name doesn't start with _.