Skip to content

Commit

Permalink
Add exactOptionalPropertyTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
wycats committed May 4, 2023
1 parent a81c716 commit 95edfd1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions build/broccoli/write-smoke-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class TypesSmokeTestWriter extends Plugin {
noUnusedLocals: true,
noUnusedParameters: true,
noImplicitReturns: true,
useDefineForClassFields: true,
exactOptionalPropertyTypes: true,

newLine: 'LF',
noEmit: true,
Expand Down
7 changes: 5 additions & 2 deletions packages/@glimmer/syntax/lib/traversal/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface TraversalError extends Error {
key: string;
node: ASTv1.Node;
parent: Option<ASTv1.Node>;
stack: string | undefined;
stack?: string;
}

export interface TraversalErrorConstructor {
Expand All @@ -32,7 +32,10 @@ const TraversalError: TraversalErrorConstructor = (function () {
this.message = message;
this.node = node;
this.parent = parent;
this.stack = error.stack ?? '';

if (error.stack) {
this.stack = error.stack;
}
}

return TraversalError as unknown as TraversalErrorConstructor;
Expand Down
2 changes: 2 additions & 0 deletions packages/@glimmer/vm/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"useDefineForClassFields": true,
"exactOptionalPropertyTypes": true,

"newLine": "LF",
"noEmit": true,
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
// Compilation Configuration
"target": "es2020",
"lib": ["ES2020", "DOM"],
"lib": ["ES2020", "ES2022.Error", "DOM"],
"inlineSources": true,
"inlineSourceMap": true,
"declaration": true,
Expand All @@ -22,7 +22,7 @@
"noUnusedParameters": true,
"noImplicitReturns": true,
"useDefineForClassFields": true,
// "exactOptionalPropertyTypes": true,
"exactOptionalPropertyTypes": true,
// "noImplicitOverride": true,
// "noPropertyAccessFromIndexSignature": true,
// "noUncheckedIndexedAccess": true,
Expand Down

0 comments on commit 95edfd1

Please sign in to comment.