Skip to content

Adds strict mode.#1732

Open
markwpearce wants to merge 7 commits into
v1from
strict_mode
Open

Adds strict mode.#1732
markwpearce wants to merge 7 commits into
v1from
strict_mode

Conversation

@markwpearce

Copy link
Copy Markdown
Collaborator

Adds strict mode option to bsconfig.json, set by default to false

"Enables a set of stricter type-checking rules and language features. When true, unknown members on Component types will be treated as errors instead of dynamic. Defaults to false."

What does strict mode do?

  • Validates unknown members on Nodes: Normally, unknown members on nodes are typed as dynamic, because Node member types can be updated (eg. through addField, update, etc). When Strict mode is on, unknown members will not be resolved
  • Validates unknown CallFunc on roSGNode: If strict mode is on, trying to do a callfunc on a generic node will give a cannot-find-callfunc error. By default, this is simply not validated.

If strict mode is on, it forces the developer to typecast the Nodes so they have known members.

@markwpearce markwpearce added this to the v1.0.0 milestone Jun 15, 2026
Comment thread src/DiagnosticFilterer.ts
* If the file diagnostics are ignored, we do not need to validate this file
*/
public isFileFiltered(file: { srcPath: string; destPath: string }) {
public isFileCompletelyFiltered(file: { srcPath: string; destPath: string }) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed name to make function more clear

Comment thread src/DiagnosticManager.ts
* If so, we can skip any Scope-based validation on this file at all, which can save a lot of time for large files
* with many diagnostics that are being ignored
*/
public canSkipScopeValidationForFile(file: BrsFile): boolean {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed name to make function use more clear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant