Enable tseslint strict rules

This commit is contained in:
Henry Mercer
2026-02-23 18:49:38 +00:00
parent 48094d2b6e
commit fba33f686a
15 changed files with 5 additions and 58 deletions

View File

@@ -27,6 +27,7 @@ export default [
js.configs.recommended,
// Type-checked rules from typescript-eslint
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.strict,
// eslint-plugin-github recommended config
githubFlatConfigs.recommended,
// eslint-plugin-github typescript config
@@ -127,6 +128,8 @@ export default [
"no-async-foreach/no-async-foreach": "error",
"no-sequences": "error",
"no-shadow": "off",
// This is overly restrictive with unsetting `EnvVar`s
"@typescript-eslint/no-dynamic-delete": "off",
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"one-var": ["error", "never"],

View File

@@ -160719,9 +160719,6 @@ function getRequiredEnvParam(paramName) {
return value;
}
var ConfigurationError = class extends Error {
constructor(message) {
super(message);
}
};
var cachedCodeQlVersion = void 0;
function cacheCodeQlVersion(version) {

6
lib/analyze-action.js generated
View File

@@ -106067,9 +106067,6 @@ var HTTPError = class extends Error {
}
};
var ConfigurationError = class extends Error {
constructor(message) {
super(message);
}
};
function asHTTPError(arg) {
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
@@ -112805,9 +112802,6 @@ function sanitize(str2) {
return (str2 ?? "_").replace(/[^a-zA-Z0-9_]/g, "_").toLocaleUpperCase();
}
var InvalidSarifUploadError = class extends Error {
constructor(message) {
super(message);
}
};
function filterAlertsByDiffRange(logger, sarif) {
const diffRanges = readDiffRangesJsonFile(logger);

View File

@@ -102977,9 +102977,6 @@ var HTTPError = class extends Error {
}
};
var ConfigurationError = class extends Error {
constructor(message) {
super(message);
}
};
function asHTTPError(arg) {
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {

View File

@@ -163645,9 +163645,6 @@ var HTTPError = class extends Error {
}
};
var ConfigurationError = class extends Error {
constructor(message) {
super(message);
}
};
function asHTTPError(arg) {
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
@@ -169444,9 +169441,6 @@ function sanitize(str2) {
return (str2 ?? "_").replace(/[^a-zA-Z0-9_]/g, "_").toLocaleUpperCase();
}
var InvalidSarifUploadError = class extends Error {
constructor(message) {
super(message);
}
};
function filterAlertsByDiffRange(logger, sarif) {
const diffRanges = readDiffRangesJsonFile(logger);

3
lib/init-action.js generated
View File

@@ -103402,9 +103402,6 @@ var HTTPError = class extends Error {
}
};
var ConfigurationError = class extends Error {
constructor(message) {
super(message);
}
};
function asHTTPError(arg) {
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {

View File

@@ -102970,9 +102970,6 @@ var HTTPError = class extends Error {
}
};
var ConfigurationError = class extends Error {
constructor(message) {
super(message);
}
};
function asHTTPError(arg) {
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {

View File

@@ -103043,9 +103043,6 @@ var HTTPError = class extends Error {
}
};
var ConfigurationError = class extends Error {
constructor(message) {
super(message);
}
};
function asHTTPError(arg) {
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {

View File

@@ -160697,9 +160697,6 @@ function getRequiredEnvParam(paramName) {
return value;
}
var ConfigurationError = class extends Error {
constructor(message) {
super(message);
}
};
function isInTestMode() {
return process.env["CODEQL_ACTION_TEST_MODE" /* TEST_MODE */] === "true";

View File

@@ -120145,9 +120145,6 @@ var HTTPError = class extends Error {
}
};
var ConfigurationError = class extends Error {
constructor(message) {
super(message);
}
};
function asHTTPError(arg) {
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {

6
lib/upload-lib.js generated
View File

@@ -105883,9 +105883,6 @@ var HTTPError = class extends Error {
}
};
var ConfigurationError = class extends Error {
constructor(message) {
super(message);
}
};
function asHTTPError(arg) {
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
@@ -110783,9 +110780,6 @@ function sanitize(str2) {
return (str2 ?? "_").replace(/[^a-zA-Z0-9_]/g, "_").toLocaleUpperCase();
}
var InvalidSarifUploadError = class extends Error {
constructor(message) {
super(message);
}
};
function filterAlertsByDiffRange(logger, sarif) {
const diffRanges = readDiffRangesJsonFile(logger);

View File

@@ -160697,9 +160697,6 @@ function getRequiredEnvParam(paramName) {
return value;
}
var ConfigurationError = class extends Error {
constructor(message) {
super(message);
}
};
function isInTestMode() {
return process.env["CODEQL_ACTION_TEST_MODE" /* TEST_MODE */] === "true";

View File

@@ -105864,9 +105864,6 @@ var HTTPError = class extends Error {
}
};
var ConfigurationError = class extends Error {
constructor(message) {
super(message);
}
};
function asHTTPError(arg) {
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
@@ -111287,9 +111284,6 @@ function sanitize(str2) {
return (str2 ?? "_").replace(/[^a-zA-Z0-9_]/g, "_").toLocaleUpperCase();
}
var InvalidSarifUploadError = class extends Error {
constructor(message) {
super(message);
}
};
function filterAlertsByDiffRange(logger, sarif) {
const diffRanges = readDiffRangesJsonFile(logger);

View File

@@ -1130,11 +1130,7 @@ function sanitize(str?: string) {
/**
* An error that occurred due to an invalid SARIF upload request.
*/
export class InvalidSarifUploadError extends Error {
constructor(message: string) {
super(message);
}
}
export class InvalidSarifUploadError extends Error {}
function filterAlertsByDiffRange(logger: Logger, sarif: SarifFile): SarifFile {
const diffRanges = readDiffRangesJsonFile(logger);

View File

@@ -690,11 +690,7 @@ export class HTTPError extends Error {
* An Error class that indicates an error that occurred due to
* a misconfiguration of the action or the CodeQL CLI.
*/
export class ConfigurationError extends Error {
constructor(message: string) {
super(message);
}
}
export class ConfigurationError extends Error {}
export function asHTTPError(arg: any): HTTPError | undefined {
if (