@@ -40,6 +40,13 @@ export const enum EnvironmentVariableNames {
4040 */
4141 RUSH_ALLOW_UNSUPPORTED_NODEJS = 'RUSH_ALLOW_UNSUPPORTED_NODEJS' ,
4242
43+ /**
44+ * Setting this environment variable overrides the value of `allowWarningsInSuccessfulBuild`
45+ * in the `command-line.json` configuration file. Specify `1` to allow warnings in a successful build,
46+ * or `0` to disallow them. (See the comments in the command-line.json file for more information).
47+ */
48+ RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD = 'RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD' ,
49+
4350 /**
4451 * This variable selects a specific installation variant for Rush to use when installing
4552 * and linking package dependencies.
@@ -156,6 +163,8 @@ export class EnvironmentConfiguration {
156163
157164 private static _allowUnsupportedNodeVersion : boolean = false ;
158165
166+ private static _allowWarningsInSuccessfulBuild : boolean = false ;
167+
159168 private static _pnpmStorePathOverride : string | undefined ;
160169
161170 private static _rushGlobalFolderOverride : string | undefined ;
@@ -197,6 +206,16 @@ export class EnvironmentConfiguration {
197206 return EnvironmentConfiguration . _allowUnsupportedNodeVersion ;
198207 }
199208
209+ /**
210+ * Setting this environment variable overrides the value of `allowWarningsInSuccessfulBuild`
211+ * in the `command-line.json` configuration file. Specify `1` to allow warnings in a successful build,
212+ * or `0` to disallow them. (See the comments in the command-line.json file for more information).
213+ */
214+ public static get allowWarningsInSuccessfulBuild ( ) : boolean {
215+ EnvironmentConfiguration . _ensureInitialized ( ) ;
216+ return EnvironmentConfiguration . _allowWarningsInSuccessfulBuild ;
217+ }
218+
200219 /**
201220 * An override for the PNPM store path, if `pnpmStore` configuration is set to 'path'
202221 * See {@link EnvironmentVariableNames.RUSH_PNPM_STORE_PATH}
@@ -312,6 +331,15 @@ export class EnvironmentConfiguration {
312331 break ;
313332 }
314333
334+ case EnvironmentVariableNames . RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD : {
335+ EnvironmentConfiguration . _allowWarningsInSuccessfulBuild =
336+ EnvironmentConfiguration . parseBooleanEnvironmentVariable (
337+ EnvironmentVariableNames . RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD ,
338+ value
339+ ) ?? false ;
340+ break ;
341+ }
342+
315343 case EnvironmentVariableNames . RUSH_PNPM_STORE_PATH : {
316344 EnvironmentConfiguration . _pnpmStorePathOverride =
317345 value && ! options . doNotNormalizePaths
0 commit comments