Skip to content

Commit

Permalink
fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
davemarco committed Sep 6, 2024
1 parent 54a363f commit 871cdfc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion new-log-viewer/src/services/LogFileManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ class LogFileManager {
this.#firstLogEventNumPerPage.push(1 + firstLogEventOnPageIdx);

// Need to minus one from page size to get correct index into filtered log events.
let lastPageIdx: number = i + this.#pageSize - 1
let lastPageIdx: number = i + this.#pageSize - 1;

// Guard to prevent indexing out of array on last page.
if (lastPageIdx >= this.#numFilteredEvents) {
Expand Down
6 changes: 4 additions & 2 deletions new-log-viewer/src/services/decoders/ClpIrDecoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
} from "../../typings/decoders";
import {LogLevelFilter} from "../../typings/logs";

Check warning on line 8 in new-log-viewer/src/services/decoders/ClpIrDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpIrDecoder.ts#L1-L8

[simple-import-sort/imports] Run autofix to sort these imports!


class ClpIrDecoder implements Decoder {
#streamReader: ClpIrStreamReader;

Expand Down Expand Up @@ -43,9 +44,10 @@ class ClpIrDecoder implements Decoder {
};
}

// eslint-disable-next-line class-methods-use-this no-unused-vars
// eslint-disable-next-line class-methods-use-this
// eslint-disable-next-line no-unused-vars
changeLogLevelFilter (logLevelFilter: LogLevelFilter): boolean {

Check failure on line 49 in new-log-viewer/src/services/decoders/ClpIrDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpIrDecoder.ts#L49

[class-methods-use-this] Expected 'this' to be used by class method 'changeLogLevelFilter'.

Check failure on line 49 in new-log-viewer/src/services/decoders/ClpIrDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpIrDecoder.ts#L49

[@typescript-eslint/no-unused-vars] 'logLevelFilter' is defined but never used.
// TODO: fix this after log level filtering is implemented in clp-ffi-js
// TODO: fix this after log level filtering is implemented in clp-ffi-js

Check warning on line 50 in new-log-viewer/src/services/decoders/ClpIrDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpIrDecoder.ts#L50

[no-warning-comments] Unexpected 'todo' comment: 'TODO: fix this after log level filtering...'.
return true
}

Check failure on line 52 in new-log-viewer/src/services/decoders/ClpIrDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpIrDecoder.ts#L51-L52

[@stylistic/js/semi] Missing semicolon.

Expand Down
31 changes: 16 additions & 15 deletions new-log-viewer/src/services/decoders/JsonlDecoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ import {
import LogbackFormatter from "../formatters/LogbackFormatter";


/**
* Creates an array containing indices as values. Method is used to set the default log level
* filter (i.e. all levels are selected, so the array should include all log indices).
*
* @param length The length of the array

Check warning on line 29 in new-log-viewer/src/services/decoders/JsonlDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/JsonlDecoder.ts#L29

[jsdoc/informative-docs] This tag description only repeats the name it describes.
* @return Array with indices as values (i.e [0, 1, 2, 3, ..., length - 1])
*/
function createIndicesArray (length: number): number[] {
const filteredLogIndices: number[] = Array.from(
{length: length},
(_, index) => index
);

return filteredLogIndices;
}

Check warning on line 39 in new-log-viewer/src/services/decoders/JsonlDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/JsonlDecoder.ts#L32-L39

[func-style] Expected a function expression.

/**
* A decoder for JSONL (JSON lines) files that contain log events. See `JsonlDecodeOptionsType` for
* properties that are specific to log events (compared to generic JSON records).
Expand Down Expand Up @@ -246,19 +262,4 @@ class JsonlDecoder implements Decoder {
}
}

/**
* Creates an array containing indices as values. Method is used to set the default log level
* filter (i.e. all levels are selected, so the array should include all log indices).
*
* @param length The length of the array
* @return Array with indices as values (i.e [0, 1, 2, 3, ..., length - 1])
*/
function createIndicesArray (length: number): number[] {
const filteredLogIndices: number[] = Array.from(
{length: length},
(_, index) => index
);
return filteredLogIndices;
}

export default JsonlDecoder;

0 comments on commit 871cdfc

Please sign in to comment.