jsii 5.9.29-dev.0 → 5.9.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -2
- package/lib/assembler.js +0 -4
- package/lib/assembler.js.map +1 -1
- package/lib/compiler.js +4 -1
- package/lib/compiler.js.map +1 -1
- package/lib/directives.d.ts +2 -0
- package/lib/directives.js +13 -1
- package/lib/directives.js.map +1 -1
- package/lib/jsii-diagnostic.d.ts +8 -0
- package/lib/jsii-diagnostic.js +17 -0
- package/lib/jsii-diagnostic.js.map +1 -1
- package/lib/literate.js +1 -1
- package/lib/literate.js.map +1 -1
- package/lib/main.js +6 -5
- package/lib/main.js.map +1 -1
- package/lib/utils.d.ts +4 -0
- package/lib/utils.js +42 -4
- package/lib/utils.js.map +1 -1
- package/lib/validator.js +19 -13
- package/lib/validator.js.map +1 -1
- package/lib/version.d.ts +2 -2
- package/lib/version.js +2 -2
- package/lib/version.js.map +1 -1
- package/lib/warnings.d.ts +16 -5
- package/lib/warnings.js +86 -6
- package/lib/warnings.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,8 +65,59 @@ The current status of `jsii` compiler releases is:
|
|
|
65
65
|
| Release | Status | EOS | Comment |
|
|
66
66
|
| ------- | ----------- | ---------- | --------------------------------------------------------------------------------------- |
|
|
67
67
|
| `5.9.x` | Current | TBD |  |
|
|
68
|
-
| `5.8.x` |
|
|
69
|
-
|
|
68
|
+
| `5.8.x` | Unsupported | 2026-02-15 |  |
|
|
69
|
+
|
|
70
|
+
## :mute: Silencing Warnings
|
|
71
|
+
|
|
72
|
+
The `--silence-warnings` option allows you to suppress specific warnings from the compiler output. Silenced warnings
|
|
73
|
+
are still emitted internally (e.g. they are still part of the assembly), but are not printed to the console. When
|
|
74
|
+
`--fail-on-warnings` (`--Werr`) is set, silenced warnings are not treated as errors.
|
|
75
|
+
|
|
76
|
+
Warnings can be identified by JSII code, number, or diagnostic name:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
# By full JSII code
|
|
80
|
+
jsii --silence-warnings JSII5018
|
|
81
|
+
|
|
82
|
+
# By number only
|
|
83
|
+
jsii --silence-warnings 5018
|
|
84
|
+
|
|
85
|
+
# By specific diagnostic name (the part after the slash)
|
|
86
|
+
jsii --silence-warnings reserved-word
|
|
87
|
+
|
|
88
|
+
# By full diagnostic name
|
|
89
|
+
jsii --silence-warnings language-compatibility/reserved-word
|
|
90
|
+
|
|
91
|
+
# By category (silences ALL warnings in that category)
|
|
92
|
+
jsii --silence-warnings language-compatibility
|
|
93
|
+
|
|
94
|
+
# Multiple warnings
|
|
95
|
+
jsii --silence-warnings reserved-word JSII5019
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Inline Suppression
|
|
99
|
+
|
|
100
|
+
Individual warnings can be suppressed directly in source code using the `@jsii suppress` directive. This is useful
|
|
101
|
+
when you want `--fail-on-warnings` enabled globally but need to allow specific instances of a warning.
|
|
102
|
+
|
|
103
|
+
Each directive accepts a single warning identifier using the same formats as `--silence-warnings`. An optional text after
|
|
104
|
+
the identifier is treated as an explanation comment. Use multiple directives to suppress multiple warnings:
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
export class MyClass {
|
|
108
|
+
/**
|
|
109
|
+
* @jsii suppress JSII5019 this name is intentional
|
|
110
|
+
* @jsii suppress reserved-word
|
|
111
|
+
*/
|
|
112
|
+
public myClass(): void { }
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The suppression applies to the annotated declaration and all of its members. For example, a `@jsii suppress`
|
|
117
|
+
directive on a class will suppress matching warnings on all methods and properties within that class.
|
|
118
|
+
|
|
119
|
+
Only warnings that reference a source code location can be suppressed inline. Warnings not tied to a specific node
|
|
120
|
+
(e.g. `JSII0003` for a missing README) are not affected.
|
|
70
121
|
|
|
71
122
|
## :balance_scale: License
|
|
72
123
|
|
package/lib/assembler.js
CHANGED
|
@@ -30,7 +30,6 @@ const type_visitor_1 = require("./type-visitor");
|
|
|
30
30
|
const utils_2 = require("./utils");
|
|
31
31
|
const validator_1 = require("./validator");
|
|
32
32
|
const version_1 = require("./version");
|
|
33
|
-
const warnings_1 = require("./warnings");
|
|
34
33
|
// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports
|
|
35
34
|
const sortJson = require('sort-json');
|
|
36
35
|
const LOG = log4js.getLogger('jsii/assembler');
|
|
@@ -1488,9 +1487,6 @@ class Assembler {
|
|
|
1488
1487
|
type.methods.push(method);
|
|
1489
1488
|
}
|
|
1490
1489
|
_warnAboutReservedWords(symbol) {
|
|
1491
|
-
if (!warnings_1.enabledWarnings['reserved-word']) {
|
|
1492
|
-
return;
|
|
1493
|
-
}
|
|
1494
1490
|
const reservingLanguages = (0, reserved_words_1.isReservedName)(symbol.name);
|
|
1495
1491
|
if (reservingLanguages) {
|
|
1496
1492
|
this._diagnostics.push(jsii_diagnostic_1.JsiiDiagnostic.JSII_5018_RESERVED_WORD.create(_nameOrDeclarationNode(symbol), symbol.name, reservingLanguages));
|