Linting: Prefer optional chaining

This commit is contained in:
Henry Mercer
2025-10-22 16:55:06 +01:00
parent 0c5185d061
commit e5f165b8f5
14 changed files with 30 additions and 32 deletions

View File

@@ -943,7 +943,7 @@ async function getRemoteConfig(
);
const pieces = format.exec(configFile);
// 5 = 4 groups + the whole expression
if (pieces === null || pieces.groups === undefined || pieces.length < 5) {
if (pieces?.groups === undefined || pieces.length < 5) {
throw new ConfigurationError(
errorMessages.getConfigFileRepoFormatInvalidMessage(configFile),
);