Skip to content
Open
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
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
node_modules/
29 changes: 29 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"no-shadow": "off",
"@typescript-eslint/no-shadow": "off",
"@typescript-eslint/naming-convention": "off",
"no-bitwise": "off",
"max-classes-per-file": "off",
"no-console": "off",
"@typescript-eslint/no-explicit-any": "off",
"no-case-declarations": "off",
"no-useless-escape": "off",
"no-prototype-builtins": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-namespace": "off",
"no-control-regex": "off",
"@typescript-eslint/no-unused-vars": ["error", {
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}]
}
}
2 changes: 1 addition & 1 deletion lib/analyzer/image-inspector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ function isLocalImageSameArchitecture(
return platformArchitecture === inspectResultArchitecture;
}

async function pullIfNotLocal(targetImage: string, options?: DockerOptions) {
async function pullIfNotLocal(targetImage: string, _options?: DockerOptions) {
const docker = new Docker();
try {
await docker.inspectImage(targetImage);
Expand Down
1 change: 0 additions & 1 deletion lib/analyzer/package-managers/apk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ function parseLine(
break;
case "r": // Depends
case "D": // Depends
// tslint:disable-next-line:no-duplicate-variable
for (let name of value.split(" ")) {
if (name.charAt(0) !== "!") {
name = name.split("=")[0];
Expand Down
1 change: 0 additions & 1 deletion lib/dockerfile/instruction-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export {
};

// Naive regex; see tests for cases
// tslint:disable-next-line:max-line-length
const installRegex =
/(rpm\s+-i|rpm\s+--install|apk\s+((--update|-u|--no-cache)\s+)*add(\s+(--update|-u|--no-cache))*|apt-get\s+((--assume-yes|--yes|-y)\s+)*install(\s+(--assume-yes|--yes|-y))*|apt\s+((--assume-yes|--yes|-y)\s+)*install|dnf\s+((--assumeyes|--best|--nodocs|--allowerasing|-y)\s+)*install(\s+(--assumeyes|--best|--nodocs|--allowerasing|-y))*|microdnf\s+((--nodocs|--best|--assumeyes|-y)\s+)*install(\s+(--nodocs|--best|--assumeyes|-y))*|yum\s+install|aptitude\s+install)\s+/;

Expand Down
2 changes: 1 addition & 1 deletion lib/dockerfile/instruction-updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function updateDockerfileBaseImageName(
const argRanges = dockerfile
.getARGs()
.filter((arg) => arg.getProperty()?.getValue() === currentBaseImageName)
.map((arg) => arg.getProperty()?.getValueRange()!);
.map((arg) => arg.getProperty()!.getValueRange()!);

const ranges = fromRanges.concat(argRanges);

Expand Down
2 changes: 1 addition & 1 deletion lib/extractor/decompress-maybe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function decompressMaybe(): Transform {

// Setup zstd decompressor with streaming API
zstdStream = new ZstdDecompress(
(data: Uint8Array, final?: boolean) => {
(data: Uint8Array, _final?: boolean) => {
transform.push(Buffer.from(data));
},
);
Expand Down
2 changes: 1 addition & 1 deletion lib/extractor/oci-archive/layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ async function tryParseJsonMetadata(stream: Readable): Promise<unknown> {
// Keep a no-op error handler to prevent unhandled error events
// when the stream is drained after fast-fail
stream.removeAllListeners("error");
// tslint:disable-next-line:no-empty
// eslint-disable-next-line @typescript-eslint/no-empty-function
stream.on("error", () => {});
};

Expand Down
1 change: 1 addition & 0 deletions lib/go-parser/go-binary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ export function readRawBuildInfo(binary: Elf): RawBuildInfo {
const buildInfoAlign = 16;
const buildInfoSize = 32;

// eslint-disable-next-line no-constant-condition
while (true) {
const i = data.toString("binary").indexOf(buildInfoMagic);
if (i < 0 || data.length - i < buildInfoSize) {
Expand Down
2 changes: 1 addition & 1 deletion lib/inputs/redHat/static.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function getRedHatRepositoriesFromExtractedLayers(
if (!contentManifest || !contentManifest.content_sets) {
continue;
}
repositories.push(...contentManifest?.content_sets);
repositories.push(...contentManifest.content_sets);
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export interface PluginOptions {
* Alias: shaded-jars-depth
* TODO remove shaded-jars-depth
* A shaded JAR is when you unpack all JAR files, then repack them into a single JAR, while
* renaming (i.e., "shading") all packages of all dependencies.
* renaming (i.e., "shading") all packages of all dependencies.
*/
"nested-jars-depth": boolean | string;
"shaded-jars-depth": boolean | string;
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function truncateDataValue(
}

if (Array.isArray(value)) {
return value.map((item, index) => {
return value.map((item, _index) => {
return truncateDataValue(item, factType, `${path}[*]`, truncationTracker);
});
} else if (typeof value === "object" && value !== null) {
Expand Down
Loading
Loading