rokucommunity / bslint

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

Incorrect usage of CreateObject for component usage #61

Open TwitchBronBron opened 2 years ago

TwitchBronBron commented 2 years ago

It appears that the LINT4002 bslint rule incorrectly scans for the component name anywhere in the CreateObject call. Instead, it should only look for them directly following a "roSGNode".

<?xml version="1.0" encoding="utf-8" ?>
<component name="Parent" extends="Group">
</component>
? createObject("Parent") 'bslint should NOT consider this valid usage of the `Parent` component
? createObject("roSGNode", "Parent") ' THIS is the proper usage of `Parent` component