Skip to content

Commit

Permalink
[skip ci] validation rule
Browse files Browse the repository at this point in the history
  • Loading branch information
iBicha committed Dec 23, 2024
1 parent 2c1306c commit 82e55d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/bsconfig.base.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
"regexFlags": "ig",
"message": "observeField(\"field\", \"callback\") is not allowed. Use observeField(\"field\", FuncName(callback)) instead."
},
{
"code": "NO_OBSERVE_FIELD_SCOPED_EX",
"regex": "\\.observeFieldScopedEx\\s*\\(",
"regexFlags": "ig",
"message": "observeFieldScopedEx is not allowed. Use MessagePortUtils.ObserveFieldScopedExSafe instead."
},
{
"code": "NO_INVALID_CALLFUNC_ARG",
"regex": "@\\.\\w+\\(invalid\\)",
Expand Down
1 change: 1 addition & 0 deletions playlet-lib/src/source/utils/MessagePortUtils.bs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ namespace MessagePortUtils
function ObserveFieldScopedExSafe(node as dynamic, field as string, port as dynamic)
' ObserveFieldScopedEx was added in 12.0
if FindMemberFunction(node, "ObserveFieldScopedEx") <> invalid
' bs:disable-next-line NO_OBSERVE_FIELD_SCOPED_EX
node.ObserveFieldScopedEx(field, port)
else
node.ObserveFieldScoped(field, port)
Expand Down

0 comments on commit 82e55d7

Please sign in to comment.