Skip to content
Snippets Groups Projects
Unverified Commit 04d16125 authored by Sergei Zharinov's avatar Sergei Zharinov Committed by GitHub
Browse files

refactor(config/global): Enable strict null checks (#12867)


* refactor(config/global): Enable strict null checks

* Fix inefficient copying

Co-authored-by: default avatarRhys Arkins <rhys@arkins.net>
parent 0bb5fcb6
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ import type { RenovateConfig, RepoGlobalConfig } from './types'; ...@@ -2,7 +2,7 @@ import type { RenovateConfig, RepoGlobalConfig } from './types';
export class GlobalConfig { export class GlobalConfig {
// TODO: once global config work is complete, add a test to make sure this list includes all options with globalOnly=true (#9603) // TODO: once global config work is complete, add a test to make sure this list includes all options with globalOnly=true (#9603)
private static readonly OPTIONS = [ private static readonly OPTIONS: (keyof RepoGlobalConfig)[] = [
'allowCustomCrateRegistries', 'allowCustomCrateRegistries',
'allowedPostUpgradeCommands', 'allowedPostUpgradeCommands',
'allowPlugins', 'allowPlugins',
...@@ -40,7 +40,7 @@ export class GlobalConfig { ...@@ -40,7 +40,7 @@ export class GlobalConfig {
const result = { ...config }; const result = { ...config };
for (const option of GlobalConfig.OPTIONS) { for (const option of GlobalConfig.OPTIONS) {
GlobalConfig.config[option] = config[option]; GlobalConfig.config[option] = config[option] as never;
delete result[option]; delete result[option];
} }
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
}, },
"files": [ "files": [
"./lib/config/app-strings.ts", "./lib/config/app-strings.ts",
"./lib/config/global.ts",
"./lib/config/migrations/types.ts", "./lib/config/migrations/types.ts",
"./lib/config/presets/common.ts", "./lib/config/presets/common.ts",
"./lib/constants/error-messages.ts", "./lib/constants/error-messages.ts",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment