Skip to content

Commit

Permalink
Merge branch 'release-0.66.0' into typing-phase2
Browse files Browse the repository at this point in the history
  • Loading branch information
markwpearce committed Jul 14, 2023
2 parents 5ecdf8e + daa42eb commit e6a9794
Show file tree
Hide file tree
Showing 17 changed files with 368 additions and 1,269 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -542,12 +542,6 @@ Type: `boolean`
Allow BrighterScript features (classes, interfaces, etc...) to be included in BrightScript (`.brs`) files, and force those files to be transpiled.
#### `enableTypeValidation`
Type: `boolean`
Performs additional validation on all declared and inferred types, such as checking member accesses in Classes and Interfaces, verifying that Namespace members exist when accessed, etc.
## Ignore errors and warnings on a per-line basis
In addition to disabling an entire class of errors in `bsconfig.json` by using `ignoreErrorCodes`, you may also disable errors for a subset of the complier rules within a file with the following comment flags:
- `bs:disable-next-line`
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ let options = yargs
})
.option('config', {
type: 'string',
description: 'add additional BsConfig settings as JSON - eg. \'{"enableTypeValidation":true}\'',
description: 'add additional BsConfig settings as JSON - eg. \'{"removeParameterTypes":true}\'',
default: '{}'
})
.strict()
Expand Down
1 change: 0 additions & 1 deletion benchmarks/targets/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module.exports = async (options: TargetOptions) => {
cwd: projectPath,
createPackage: false,
copyToStaging: false,
enableTypeValidation: false,
//disable diagnostic reporting (they still get collected)
diagnosticFilters: ['**/*'],
logLevel: 'error',
Expand Down
2 changes: 1 addition & 1 deletion docs/union-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ end function

## Validation

When the `enableTypeValidation` option flag is enabled, a diagnostic error will be raised when a member is accessed that is not a member of ALL of the types of a union.
A diagnostic error will be raised when a member is accessed that is not a member of ALL of the types of a union.

In the example above, accessing `response.status` is fine, because it is in all of the types of the union. Accessing `response.data` would raise an error, because it's not in the `Error` interface.

Expand Down
6 changes: 0 additions & 6 deletions src/BsConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,4 @@ export interface BsConfig {
* @default false
*/
allowBrighterScriptInBrightScript?: boolean;

/**
* Do full type checking & validation based on declared and inferred types.
* @default false
*/
enableTypeValidation?: boolean;
}
Loading

0 comments on commit e6a9794

Please sign in to comment.