Skip to content

Commit

Permalink
chore: fix typo in error message - delcaration (#4514)
Browse files Browse the repository at this point in the history
Observed the error below: `The implemented delcaration is here.`

`delcaration` - I kept looking at this because it hurt my eyes until I finally realized it was a typo.

At the very least, this can be closed as won't fix so that at least there will be a record for the next person that searches for an issue or fix for it.

## Observed Error Message

```
[2024-05-15T12:22:12.636] [ERROR] jsii/compiler - Type model errors prevented the JSII assembly from being created
src/myconstruct.ts:191:31 - error JSII5004: "cdkConstruct.MyConstruct#dynamoDBTable" changes the property type to "aws-cdk-lib.aws_dynamodb.Table" when implementing cdkConstruct.IMyConstruct. Change it to "aws-cdk-lib.aws_dynamodb.ITable"

191   public get dynamoDBTable(): dynamodb.Table | undefined {
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~

  src/myconstruct.ts:174:28
    174   readonly dynamoDBTable?: dynamodb.ITable;
                                   ~~~~~~~~~~~~~~~
    The implemented delcaration is here.
👾 Task "build » compile" failed when executing "jsii --silence-warnings=reserved-word" (cwd: packages/cdk)
```


---

By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license].

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
  • Loading branch information
huntharo committed May 16, 2024
1 parent 212676c commit 8e5927f
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion gh-pages/content/specification/2-type-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ Typescript allows grouping declarations together in _namespaces_, which are inte
_Submodules_ names are the fully qualified name of the namespace from the package's root (if a package `foo` defines a
namespace `ns1`, which itself contains `ns2`, the submodule for `ns2` will be named `foo.ns1.ns2`).

_Submodules_ are delcared in the _jsii_ assembly under the `submodules` key. This is also where specific
_Submodules_ are declared in the _jsii_ assembly under the `submodules` key. This is also where specific
[configuration](#submodule-configuration) is registered, if different from the parent submodule or package.

_Submodules_ are hierarchical, and their fully qualified name is representative of the relationship. For example the
Expand Down
2 changes: 1 addition & 1 deletion gh-pages/content/specification/3-kernel-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ Sometimes, the _host_ app will extend a _jsii_ class and implement new _jsii_ in
original type. Such interfaces must be declared by providing their _jsii_ fully qualified name as an entry in the
`interfaces` list.

Providing interfaces in this list that are implicitly present from another delcaration (either because they are already
Providing interfaces in this list that are implicitly present from another declaration (either because they are already
implemented by the class denoted by the `fqn` field, or because another entry in the `interfaces` list extends it) is
valid, but not necessary. The `@jsii/kernel` is responsible for correctly handling redundant declarations.

Expand Down
2 changes: 1 addition & 1 deletion jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function overriddenConfig(overrides) {
]);

// TypeScript appears to choke if we do the "as any" in the same
// expression as the key access, so we delcare surrogate varibales...
// expression as the key access, so we declare surrogate variables...
for (const key of Array.from(allKeys).sort()) {
const originalValue = original[key];
const overrideValue = override[key];
Expand Down
4 changes: 2 additions & 2 deletions packages/jsii-rosetta/lib/languages/go.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ interface GoLanguageContext {
isPtrAssignmentRValue: boolean;

/**
* Whether the current element is a parameter delcaration name.
* Whether the current element is a parameter declaration name.
*/
isParameterName: boolean;

Expand All @@ -46,7 +46,7 @@ interface GoLanguageContext {
isStruct: boolean;

/**
* Whether the context is within an interface delcaration.
* Whether the context is within an interface declaration.
*/
isInterface: boolean;

Expand Down
2 changes: 1 addition & 1 deletion packages/jsii-rosetta/lib/submodule-reference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class SubmoduleReference {

/**
* Determines what symbols are imported by the given TypeScript import
* delcaration, in the context of the specified file, using the provided type
* declaration, in the context of the specified file, using the provided type
* checker.
*
* @param decl an import declaration.
Expand Down
2 changes: 1 addition & 1 deletion packages/jsii/lib/assembler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ export class Assembler implements Emitter {
}
this._submoduleMap.set(symbol, ns);

// If the exported symbol has any declaration, and that delcaration is of
// If the exported symbol has any declaration, and that declaration is of
// an entity that can have nested declarations of interest to jsii
// (classes, interfaces, enums, modules), we need to also associate those
// nested symbols to the submodule (or they won't be named correctly!)
Expand Down
2 changes: 1 addition & 1 deletion packages/jsii/lib/jsii-diagnostic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ export class JsiiDiagnostic implements ts.Diagnostic {
public static readonly JSII_5013_STATIC_INSTANCE_CONFLICT = Code.error({
code: 5013,
formatter: (member: string, type: spec.ClassType) =>
`Member "${member}" of class "${type.fqn}" has both a static and an instance delcaration`,
`Member "${member}" of class "${type.fqn}" has both a static and an instance declaration`,
name: 'language-compatibility/static-instance-conflict',
});

Expand Down
8 changes: 4 additions & 4 deletions packages/jsii/lib/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ function _defaultValidations(): ValidationFunction[] {
mod.kind === ts.SyntaxKind.PublicKeyword ||
mod.kind === ts.SyntaxKind.ProtectedKeyword,
) ?? declarationName(expectedNode),
'The implemented delcaration is here.',
'The implemented declaration is here.',
),
);
}
Expand All @@ -537,7 +537,7 @@ function _defaultValidations(): ValidationFunction[] {
expected.type,
).maybeAddRelatedInformation(
expectedNode?.type ?? declarationName(expectedNode),
'The implemented delcaration is here.',
'The implemented declaration is here.',
),
);
}
Expand All @@ -555,7 +555,7 @@ function _defaultValidations(): ValidationFunction[] {
expectedNode?.modifiers?.find(
(mod) => mod.kind === ts.SyntaxKind.ReadonlyKeyword,
) ?? declarationName(expectedNode),
'The implemented delcaration is here.',
'The implemented declaration is here.',
),
);
}
Expand All @@ -573,7 +573,7 @@ function _defaultValidations(): ValidationFunction[] {
expectedNode?.questionToken ??
expectedNode?.type ??
declarationName(expectedNode),
'The implemented delcaration is here.',
'The implemented declaration is here.',
),
);
}
Expand Down
22 changes: 11 additions & 11 deletions packages/jsii/test/__snapshots__/negatives.test.js.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8e5927f

Please sign in to comment.