mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Enable tseslint strict rules
This commit is contained in:
@@ -27,6 +27,7 @@ export default [
|
|||||||
js.configs.recommended,
|
js.configs.recommended,
|
||||||
// Type-checked rules from typescript-eslint
|
// Type-checked rules from typescript-eslint
|
||||||
...tseslint.configs.recommendedTypeChecked,
|
...tseslint.configs.recommendedTypeChecked,
|
||||||
|
...tseslint.configs.strict,
|
||||||
// eslint-plugin-github recommended config
|
// eslint-plugin-github recommended config
|
||||||
githubFlatConfigs.recommended,
|
githubFlatConfigs.recommended,
|
||||||
// eslint-plugin-github typescript config
|
// eslint-plugin-github typescript config
|
||||||
@@ -127,6 +128,8 @@ export default [
|
|||||||
"no-async-foreach/no-async-foreach": "error",
|
"no-async-foreach/no-async-foreach": "error",
|
||||||
"no-sequences": "error",
|
"no-sequences": "error",
|
||||||
"no-shadow": "off",
|
"no-shadow": "off",
|
||||||
|
// This is overly restrictive with unsetting `EnvVar`s
|
||||||
|
"@typescript-eslint/no-dynamic-delete": "off",
|
||||||
"@typescript-eslint/no-shadow": "error",
|
"@typescript-eslint/no-shadow": "error",
|
||||||
"@typescript-eslint/prefer-optional-chain": "error",
|
"@typescript-eslint/prefer-optional-chain": "error",
|
||||||
"one-var": ["error", "never"],
|
"one-var": ["error", "never"],
|
||||||
|
|||||||
3
lib/analyze-action-post.js
generated
3
lib/analyze-action-post.js
generated
@@ -160719,9 +160719,6 @@ function getRequiredEnvParam(paramName) {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
var ConfigurationError = class extends Error {
|
var ConfigurationError = class extends Error {
|
||||||
constructor(message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
var cachedCodeQlVersion = void 0;
|
var cachedCodeQlVersion = void 0;
|
||||||
function cacheCodeQlVersion(version) {
|
function cacheCodeQlVersion(version) {
|
||||||
|
|||||||
6
lib/analyze-action.js
generated
6
lib/analyze-action.js
generated
@@ -106067,9 +106067,6 @@ var HTTPError = class extends Error {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
var ConfigurationError = class extends Error {
|
var ConfigurationError = class extends Error {
|
||||||
constructor(message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
function asHTTPError(arg) {
|
function asHTTPError(arg) {
|
||||||
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
|
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();
|
return (str2 ?? "_").replace(/[^a-zA-Z0-9_]/g, "_").toLocaleUpperCase();
|
||||||
}
|
}
|
||||||
var InvalidSarifUploadError = class extends Error {
|
var InvalidSarifUploadError = class extends Error {
|
||||||
constructor(message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
function filterAlertsByDiffRange(logger, sarif) {
|
function filterAlertsByDiffRange(logger, sarif) {
|
||||||
const diffRanges = readDiffRangesJsonFile(logger);
|
const diffRanges = readDiffRangesJsonFile(logger);
|
||||||
|
|||||||
3
lib/autobuild-action.js
generated
3
lib/autobuild-action.js
generated
@@ -102977,9 +102977,6 @@ var HTTPError = class extends Error {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
var ConfigurationError = class extends Error {
|
var ConfigurationError = class extends Error {
|
||||||
constructor(message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
function asHTTPError(arg) {
|
function asHTTPError(arg) {
|
||||||
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
|
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
|
||||||
|
|||||||
6
lib/init-action-post.js
generated
6
lib/init-action-post.js
generated
@@ -163645,9 +163645,6 @@ var HTTPError = class extends Error {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
var ConfigurationError = class extends Error {
|
var ConfigurationError = class extends Error {
|
||||||
constructor(message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
function asHTTPError(arg) {
|
function asHTTPError(arg) {
|
||||||
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
|
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();
|
return (str2 ?? "_").replace(/[^a-zA-Z0-9_]/g, "_").toLocaleUpperCase();
|
||||||
}
|
}
|
||||||
var InvalidSarifUploadError = class extends Error {
|
var InvalidSarifUploadError = class extends Error {
|
||||||
constructor(message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
function filterAlertsByDiffRange(logger, sarif) {
|
function filterAlertsByDiffRange(logger, sarif) {
|
||||||
const diffRanges = readDiffRangesJsonFile(logger);
|
const diffRanges = readDiffRangesJsonFile(logger);
|
||||||
|
|||||||
3
lib/init-action.js
generated
3
lib/init-action.js
generated
@@ -103402,9 +103402,6 @@ var HTTPError = class extends Error {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
var ConfigurationError = class extends Error {
|
var ConfigurationError = class extends Error {
|
||||||
constructor(message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
function asHTTPError(arg) {
|
function asHTTPError(arg) {
|
||||||
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
|
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
|
||||||
|
|||||||
3
lib/resolve-environment-action.js
generated
3
lib/resolve-environment-action.js
generated
@@ -102970,9 +102970,6 @@ var HTTPError = class extends Error {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
var ConfigurationError = class extends Error {
|
var ConfigurationError = class extends Error {
|
||||||
constructor(message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
function asHTTPError(arg) {
|
function asHTTPError(arg) {
|
||||||
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
|
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
|
||||||
|
|||||||
3
lib/setup-codeql-action.js
generated
3
lib/setup-codeql-action.js
generated
@@ -103043,9 +103043,6 @@ var HTTPError = class extends Error {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
var ConfigurationError = class extends Error {
|
var ConfigurationError = class extends Error {
|
||||||
constructor(message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
function asHTTPError(arg) {
|
function asHTTPError(arg) {
|
||||||
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
|
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
|
||||||
|
|||||||
3
lib/start-proxy-action-post.js
generated
3
lib/start-proxy-action-post.js
generated
@@ -160697,9 +160697,6 @@ function getRequiredEnvParam(paramName) {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
var ConfigurationError = class extends Error {
|
var ConfigurationError = class extends Error {
|
||||||
constructor(message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
function isInTestMode() {
|
function isInTestMode() {
|
||||||
return process.env["CODEQL_ACTION_TEST_MODE" /* TEST_MODE */] === "true";
|
return process.env["CODEQL_ACTION_TEST_MODE" /* TEST_MODE */] === "true";
|
||||||
|
|||||||
3
lib/start-proxy-action.js
generated
3
lib/start-proxy-action.js
generated
@@ -120145,9 +120145,6 @@ var HTTPError = class extends Error {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
var ConfigurationError = class extends Error {
|
var ConfigurationError = class extends Error {
|
||||||
constructor(message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
function asHTTPError(arg) {
|
function asHTTPError(arg) {
|
||||||
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
|
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
|
||||||
|
|||||||
6
lib/upload-lib.js
generated
6
lib/upload-lib.js
generated
@@ -105883,9 +105883,6 @@ var HTTPError = class extends Error {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
var ConfigurationError = class extends Error {
|
var ConfigurationError = class extends Error {
|
||||||
constructor(message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
function asHTTPError(arg) {
|
function asHTTPError(arg) {
|
||||||
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
|
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();
|
return (str2 ?? "_").replace(/[^a-zA-Z0-9_]/g, "_").toLocaleUpperCase();
|
||||||
}
|
}
|
||||||
var InvalidSarifUploadError = class extends Error {
|
var InvalidSarifUploadError = class extends Error {
|
||||||
constructor(message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
function filterAlertsByDiffRange(logger, sarif) {
|
function filterAlertsByDiffRange(logger, sarif) {
|
||||||
const diffRanges = readDiffRangesJsonFile(logger);
|
const diffRanges = readDiffRangesJsonFile(logger);
|
||||||
|
|||||||
3
lib/upload-sarif-action-post.js
generated
3
lib/upload-sarif-action-post.js
generated
@@ -160697,9 +160697,6 @@ function getRequiredEnvParam(paramName) {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
var ConfigurationError = class extends Error {
|
var ConfigurationError = class extends Error {
|
||||||
constructor(message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
function isInTestMode() {
|
function isInTestMode() {
|
||||||
return process.env["CODEQL_ACTION_TEST_MODE" /* TEST_MODE */] === "true";
|
return process.env["CODEQL_ACTION_TEST_MODE" /* TEST_MODE */] === "true";
|
||||||
|
|||||||
6
lib/upload-sarif-action.js
generated
6
lib/upload-sarif-action.js
generated
@@ -105864,9 +105864,6 @@ var HTTPError = class extends Error {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
var ConfigurationError = class extends Error {
|
var ConfigurationError = class extends Error {
|
||||||
constructor(message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
function asHTTPError(arg) {
|
function asHTTPError(arg) {
|
||||||
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
|
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();
|
return (str2 ?? "_").replace(/[^a-zA-Z0-9_]/g, "_").toLocaleUpperCase();
|
||||||
}
|
}
|
||||||
var InvalidSarifUploadError = class extends Error {
|
var InvalidSarifUploadError = class extends Error {
|
||||||
constructor(message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
function filterAlertsByDiffRange(logger, sarif) {
|
function filterAlertsByDiffRange(logger, sarif) {
|
||||||
const diffRanges = readDiffRangesJsonFile(logger);
|
const diffRanges = readDiffRangesJsonFile(logger);
|
||||||
|
|||||||
@@ -1130,11 +1130,7 @@ function sanitize(str?: string) {
|
|||||||
/**
|
/**
|
||||||
* An error that occurred due to an invalid SARIF upload request.
|
* An error that occurred due to an invalid SARIF upload request.
|
||||||
*/
|
*/
|
||||||
export class InvalidSarifUploadError extends Error {
|
export class InvalidSarifUploadError extends Error {}
|
||||||
constructor(message: string) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function filterAlertsByDiffRange(logger: Logger, sarif: SarifFile): SarifFile {
|
function filterAlertsByDiffRange(logger: Logger, sarif: SarifFile): SarifFile {
|
||||||
const diffRanges = readDiffRangesJsonFile(logger);
|
const diffRanges = readDiffRangesJsonFile(logger);
|
||||||
|
|||||||
@@ -690,11 +690,7 @@ export class HTTPError extends Error {
|
|||||||
* An Error class that indicates an error that occurred due to
|
* An Error class that indicates an error that occurred due to
|
||||||
* a misconfiguration of the action or the CodeQL CLI.
|
* a misconfiguration of the action or the CodeQL CLI.
|
||||||
*/
|
*/
|
||||||
export class ConfigurationError extends Error {
|
export class ConfigurationError extends Error {}
|
||||||
constructor(message: string) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function asHTTPError(arg: any): HTTPError | undefined {
|
export function asHTTPError(arg: any): HTTPError | undefined {
|
||||||
if (
|
if (
|
||||||
|
|||||||
Reference in New Issue
Block a user