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 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 | ![npm](https://img.shields.io/npm/v/jsii/v5.9-latest?label=jsii%40v5.9-latest&logo=npm) |
68
- | `5.8.x` | Maintenance | 2026-02-15 | ![npm](https://img.shields.io/npm/v/jsii/v5.8-latest?label=jsii%40v5.8-latest&logo=npm) |
69
- | `5.7.x` | Maintenance | 2025-09-15 | ![npm](https://img.shields.io/npm/v/jsii/v5.7-latest?label=jsii%40v5.7-latest&logo=npm) |
68
+ | `5.8.x` | Unsupported | 2026-02-15 | ![npm](https://img.shields.io/npm/v/jsii/v5.8-latest?label=jsii%40v5.8-latest&logo=npm) |
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));