Skip to content

Commit

Permalink
refactor(versioning): Enable strict null checks (#14053)
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov committed Feb 7, 2022
1 parent 968e29f commit c966eb1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
13 changes: 4 additions & 9 deletions lib/versioning/index.ts
Expand Up @@ -19,16 +19,11 @@ export function get(versioning: string): VersioningApi {
logger.trace('Missing versioning, using semver as fallback.');
return versionings.get('semver') as VersioningApi;
}
let versioningName: string;
let versioningConfig: string;
const [versioningName, ...versioningRest] = versioning.split(':');
const versioningConfig = versioningRest.length
? versioningRest.join(':')
: undefined;

if (versioning.includes(':')) {
const versionSplit = versioning.split(':');
versioningName = versionSplit.shift();
versioningConfig = versionSplit.join(':');
} else {
versioningName = versioning;
}
const theVersioning = versionings.get(versioningName);
if (!theVersioning) {
logger.info({ versioning }, 'Unknown versioning - defaulting to semver');
Expand Down
5 changes: 0 additions & 5 deletions tsconfig.strict.json
Expand Up @@ -381,11 +381,6 @@
"lib/util/ignore.ts",
"lib/util/merge-confidence/index.ts",
"lib/util/package-rules.ts",
"lib/versioning/api.ts",
"lib/versioning/common.ts",
"lib/versioning/helm/index.ts",
"lib/versioning/index.ts",
"lib/versioning/types.ts",
"lib/workers/branch/artifacts.ts",
"lib/workers/branch/auto-replace.ts",
"lib/workers/branch/automerge.ts",
Expand Down

0 comments on commit c966eb1

Please sign in to comment.