Skip to content

Commit 4bd7dfe

Browse files
authored
Merge pull request #3226 from github/henrymercer/prefer-optional-chaining
Linting: Prefer optional chaining
2 parents 0c5185d + e5f165b commit 4bd7dfe

14 files changed

+30
-32
lines changed

‎eslint.config.mjs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ export default [
131131
"no-sequences": "error",
132132
"no-shadow": "off",
133133
"@typescript-eslint/no-shadow": "error",
134+
"@typescript-eslint/prefer-optional-chain": "error",
134135
"one-var": ["error", "never"],
135136
},
136137
},

‎lib/analyze-action.js‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/init-action-post.js‎

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/init-action.js‎

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/setup-codeql-action.js‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/start-proxy-action-post.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/upload-lib.js‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/upload-sarif-action.js‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/config-utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ async function getRemoteConfig(
943943
);
944944
const pieces = format.exec(configFile);
945945
// 5 = 4 groups + the whole expression
946-
if (pieces === null || pieces.groups === undefined || pieces.length < 5) {
946+
if (pieces?.groups === undefined || pieces.length < 5) {
947947
throw new ConfigurationError(
948948
errorMessages.getConfigFileRepoFormatInvalidMessage(configFile),
949949
);

‎src/config/db-config.ts‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,10 +380,7 @@ function combineQueries(
380380
const result: QuerySpec[] = [];
381381

382382
// Query settings obtained from the repository properties have the highest precedence.
383-
if (
384-
augmentationProperties.repoPropertyQueries &&
385-
augmentationProperties.repoPropertyQueries.input
386-
) {
383+
if (augmentationProperties.repoPropertyQueries?.input) {
387384
logger.info(
388385
`Found query configuration in the repository properties (${RepositoryPropertyName.EXTRA_QUERIES}): ` +
389386
`${augmentationProperties.repoPropertyQueries.input.map((q) => q.uses).join(", ")}`,

0 commit comments

Comments
 (0)