Add unused arg validation rule

This commit is contained in:
Brahim Hadriche committed 2023-12-22 11:42:51 -05:00
1 parent 192401c847
commit 8f1d3778d8
11 files changed
+32 -23

No files matched your search

+9
View File
@@ -27,6 +27,15 @@
"regex": "@\\.\\w+\\(invalid\\)",
"regexFlags": "ig",
"message": "the arg invalid in @.func(invalid) is not needed. Just use @.func() instead."
},
{
// Tagging unused variables (Available since Roku OS 11.0) – Variables can explicitly
// be marked as unused by prepending an underscore to the value (for example, sub myTask(_x)).
// https://developer.roku.com/en-ca/docs/references/brightscript/language/expressions-variables-types.md#types
"code": "UNUSED_ARG_STARTS_WITH_UNDERSCORE",
"regex": "\\b(?!_unused)unused\\b",
"regexFlags": "ig",
"message": "unused args should start with _ (e.g. _unused)"
}
],
"files": [