Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
196 changes: 99 additions & 97 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,25 @@
"@types/archiver": "^7.0.0",
"@types/follow-redirects": "^1.14.4",
"@types/js-yaml": "^4.0.9",
"@types/node": "^20.19.9",
"@types/node": "^20.19.39",
"@types/node-forge": "^1.3.14",
"@types/sarif": "^2.1.7",
"@types/semver": "^7.7.1",
"@types/sinon": "^21.0.1",
"ava": "^7.0.0",
"esbuild": "^0.28.0",
"eslint": "^9.39.2",
"eslint": "^9.39.4",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-github": "^6.0.0",
"eslint-plugin-import-x": "^4.16.2",
"eslint-plugin-jsdoc": "^62.9.0",
"eslint-plugin-no-async-foreach": "^0.1.1",
"glob": "^11.1.0",
"globals": "^17.5.0",
"nock": "^14.0.12",
"nock": "^14.0.13",
"sinon": "^21.1.2",
"typescript": "^6.0.2",
"typescript-eslint": "^8.58.2"
"typescript": "^6.0.3",
"typescript-eslint": "^8.59.0"
},
"overrides": {
"@actions/tool-cache": {
Expand Down
2 changes: 1 addition & 1 deletion pr-checks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"yaml": "^2.8.3"
},
"devDependencies": {
"@types/node": "^20.19.9",
"@types/node": "^20.19.39",
"tsx": "^4.21.0"
}
}
20 changes: 10 additions & 10 deletions src/config-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ test.serial(
features: [Feature.OverlayAnalysis, Feature.OverlayAnalysisJavascript],
codeScanningConfig: {
packs: ["some-custom-pack@1.0.0"],
} as UserConfig,
},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that the intention with these type casts was to ensure that the objects satisfy the UserConfig interface and so should have been e.g. satisfies UserConfig. It's probably better for us to fix this (by changing as to satisfies) rather than removing this entirely.

isDefaultBranch: true,
},
{
Expand Down Expand Up @@ -1464,7 +1464,7 @@ test.serial(
],
codeScanningConfig: {
"disable-default-queries": true,
} as UserConfig,
},
isDefaultBranch: true,
},
{
Expand All @@ -1483,7 +1483,7 @@ test.serial(
],
codeScanningConfig: {
packs: ["some-custom-pack@1.0.0"],
} as UserConfig,
},
isDefaultBranch: true,
},
{
Expand All @@ -1502,7 +1502,7 @@ test.serial(
],
codeScanningConfig: {
queries: [{ uses: "some-query.ql" }],
} as UserConfig,
},
isDefaultBranch: true,
},
{
Expand All @@ -1521,7 +1521,7 @@ test.serial(
],
codeScanningConfig: {
"query-filters": [{ include: { "security-severity": "high" } }],
} as UserConfig,
},
isDefaultBranch: true,
},
{
Expand Down Expand Up @@ -1590,7 +1590,7 @@ test.serial(
features: [Feature.OverlayAnalysis, Feature.OverlayAnalysisJavascript],
codeScanningConfig: {
packs: ["some-custom-pack@1.0.0"],
} as UserConfig,
},
isPullRequest: true,
},
{
Expand Down Expand Up @@ -1741,7 +1741,7 @@ test.serial(
],
codeScanningConfig: {
"disable-default-queries": true,
} as UserConfig,
},
isPullRequest: true,
},
{
Expand All @@ -1760,7 +1760,7 @@ test.serial(
],
codeScanningConfig: {
packs: ["some-custom-pack@1.0.0"],
} as UserConfig,
},
isPullRequest: true,
},
{
Expand All @@ -1779,7 +1779,7 @@ test.serial(
],
codeScanningConfig: {
queries: [{ uses: "some-query.ql" }],
} as UserConfig,
},
isPullRequest: true,
},
{
Expand All @@ -1798,7 +1798,7 @@ test.serial(
],
codeScanningConfig: {
"query-filters": [{ include: { "security-severity": "high" } }],
} as UserConfig,
},
isPullRequest: true,
},
{
Expand Down
4 changes: 2 additions & 2 deletions src/config-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ async function getRawLanguagesInRepo(
});

logger.debug(`Languages API response: ${JSON.stringify(response)}`);
const result = Object.keys(response.data as Record<string, number>).map(
(language) => language.trim().toLowerCase(),
const result = Object.keys(response.data).map((language) =>
language.trim().toLowerCase(),
);

if (hasActionsWorkflows(sourceRoot)) {
Expand Down
2 changes: 1 addition & 1 deletion src/debug-artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export function getArtifactSuffix(matrix: string | undefined): string {
try {
const matrixObject = JSON.parse(matrix);
if (json.isObject(matrixObject)) {
for (const matrixKey of Object.keys(matrixObject as object).sort())
for (const matrixKey of Object.keys(matrixObject).sort())
suffix += `-${matrixObject[matrixKey]}`;
} else {
core.warning("User-specified `matrix` input is not an object.");
Expand Down
2 changes: 1 addition & 1 deletion src/feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ class OfflineFeatures implements FeatureEnablement {
getFeatureConfig(feature: Feature): FeatureConfig {
// Narrow the type to FeatureConfig to avoid type errors. To avoid unsafe use of `as`, we
// check that the required properties exist using `satisfies`.
Comment on lines 387 to 388
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this comment be changed now?

return featureConfig[feature] satisfies FeatureConfig as FeatureConfig;
return featureConfig[feature] satisfies FeatureConfig;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/init-action-post-helper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ async function testFailedSarifUpload(
uploadFiles.resolves({
sarifID: "42",
statusReport: { raw_upload_size_bytes: 20, zipped_upload_size_bytes: 10 },
} as uploadLib.UploadResult);
});
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This correctly checks the type without as or satisfies, so removing this is OK.

const waitForProcessing = sinon.stub(uploadLib, "waitForProcessing");

const features = [] as Feature[];
Expand Down
2 changes: 1 addition & 1 deletion src/testing-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function wrapOutput(context: TestContext) {
}

export function setupTests(test: TestFn<any>) {
const typedTest = test as TestFn<TestContext>;
const typedTest: TestFn<TestContext> = test;

typedTest.beforeEach((t) => {
// Set an empty CodeQL object so that all method calls will fail
Expand Down
2 changes: 1 addition & 1 deletion src/upload-sarif.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const postProcessAndUploadSarifMacro = test.macro({
const analysisConfig = getAnalysisConfig(analysisKind);
uploadPostProcessedFiles
.withArgs(logger, sinon.match.any, analysisConfig, sinon.match.any)
.resolves(expectedResult[analysisKind as AnalysisKind]?.uploadResult);
.resolves(expectedResult[analysisKind]?.uploadResult);
}

const fullSarifPaths = sarifFiles.map(toFullPath);
Expand Down
2 changes: 1 addition & 1 deletion src/workflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ async function testLanguageAliases(
],
},
},
} as Workflow,
},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also fine.

codeql,
);

Expand Down
Loading