Add compilerOptions group to bsconfig.json#1750
Open
markwpearce wants to merge 1 commit into
Open
Conversation
Introduces a dedicated `compilerOptions` object (similar to TypeScript's) for options that control how BrighterScript interprets, validates, and compiles code, as opposed to top-level options that control project structure, file discovery, and tooling. - 17 options move into `compilerOptions`: allowBrighterScriptInBrightScript, autoImportComponentScript, bslibDestinationDir, emitDefinitions, emitFullPaths, legacyCallfuncHandling, manifest, minFirmwareVersion, pruneEmptyCodeFiles, relativeSourceMaps, removeParameterTypes, resolveSourceRoot, sourceMap, sourceRoot, strict, strictCallFunc, strictNodeMembers. - Legacy top-level locations still work; `compilerOptions` wins if both are set. - Using a deprecated top-level option loaded from an actual bsconfig.json file (including via `extends`) emits a `deprecated-bsconfig-option` warning diagnostic. Options passed programmatically to Program/ProgramBuilder are not flagged, since that isn't bsconfig.json authoring. - `compilerOptions` deep-merges across an `extends` chain, unlike other bsconfig keys. Closes rokucommunity#1734 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Collaborator
Author
|
FYI for reviewers: I checked how much of the existing test suite uses the legacy flat bsconfig option names (
Not blocking — just flagging for context/possible follow-up. |
Collaborator
Author
|
Building using this change shows warnings like this: |
markwpearce
marked this pull request as ready for review
July 16, 2026 18:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces a dedicated
compilerOptionsobject inbsconfig.jsonfor options that control how BrighterScript interprets, validates, and compiles code — similar to TypeScript'scompilerOptions— as opposed to top-level options that control project structure, file discovery, and tooling/reporting behavior.Closes #1734
compilerOptions:allowBrighterScriptInBrightScript,autoImportComponentScript,bslibDestinationDir,emitDefinitions,emitFullPaths,legacyCallfuncHandling,manifest,minFirmwareVersion,pruneEmptyCodeFiles,relativeSourceMaps,removeParameterTypes,resolveSourceRoot,sourceMap,sourceRoot,strict,strictCallFunc,strictNodeMembers.compilerOptions, thecompilerOptionsvalue wins.extendschain) now emits adeprecated-bsconfig-optionwarning diagnostic pointing at thecompilerOptionsequivalent. This is deliberately scoped to file-based config — options passed programmatically toProgram/ProgramBuilderare not flagged, since that's direct API usage rather than bsconfig.json authoring.compilerOptionsdeep-merges across anextendschain (matching TypeScript's behavior), unlike every other bsconfig key, where a child's value fully replaces the parent's.bsconfig.schema.json,docs/bsconfig.md, and theREADME.mdexample accordingly.This is a first pass at the field list — the set of options that belongs in
compilerOptionsvs. top-level is intentionally open to discussion, per the linked issue.Test plan
npm run buildnpm run lintnpm run test:nocover(4271 passing)extends, deprecation warning scoped to file-loaded config only (not programmatic API usage), and end-to-end diagnostic surfacing throughProgramBuilderNote
This PR was mostly written by Claude (Anthropic's Claude Code), working from a design discussion with @markwpearce. Flagging for reviewer awareness — please review as you would any other contribution.
🤖 Generated with Claude Code