Skip to content

Commit d1b3c40

Browse files
committed
Resolve new linter errors
1 parent 0030c94 commit d1b3c40

File tree

20 files changed

+88
-54
lines changed

20 files changed

+88
-54
lines changed

apps/interpreter/src/run-options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export function parsePipelineMatcherRegExp(
200200
): RegExp | undefined {
201201
try {
202202
return new RegExp(matcher);
203-
} catch (e: unknown) {
203+
} catch {
204204
logger.logErr(
205205
`Invalid value "${matcher}" for pipeline selection option: -p --pipeline.\n` +
206206
'Must be a valid regular expression.',

libs/execution/src/lib/blocks/block-execution-util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export async function executeBlock(
134134
result = R.err({
135135
message: `An unknown error occurred: ${
136136
unexpectedError instanceof Error
137-
? unexpectedError.stack ?? unexpectedError.message
137+
? (unexpectedError.stack ?? unexpectedError.message)
138138
: JSON.stringify(unexpectedError)
139139
}`,
140140
diagnostic: { node: block, property: 'name' },

libs/execution/src/lib/blocks/block-executor.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ export interface BlockExecutor<
3333
export abstract class AbstractBlockExecutor<I extends IOType, O extends IOType>
3434
implements BlockExecutor<I, O>
3535
{
36-
constructor(public readonly inputType: I, public readonly outputType: O) {}
36+
constructor(
37+
public readonly inputType: I,
38+
public readonly outputType: O,
39+
) {}
3740

3841
async execute(
3942
input: IOTypeImplementation<I>,

libs/execution/src/lib/debugging/debug-log-visitor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ export class DebugLogVisitor implements IoTypeVisitor<void> {
101101
return;
102102
}
103103

104-
this.log(fileSystem.getFile('/')?.toString() ?? '<found no root file>');
104+
const root = fileSystem.getFile('/');
105+
this.log(root != null ? JSON.stringify(root) : '<found no root file>');
105106
}
106107

107108
visitBinaryFile(binaryFile: BinaryFile): void {

libs/execution/src/lib/types/value-types/internal-representation-parsing.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ export function parseValueToInternalRepresentation<
4747
class InternalRepresentationParserVisitor extends ValueTypeVisitor<
4848
InternalValueRepresentation | undefined
4949
> {
50-
constructor(private value: string, private parseOpts: ParseOpts) {
50+
constructor(
51+
private value: string,
52+
private parseOpts: ParseOpts,
53+
) {
5154
super();
5255
}
5356

libs/execution/src/lib/util/implements-static-decorator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
*/
2121
export function implementsStatic<T>() {
2222
return <U extends T>(constructor: U) => {
23+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
2324
constructor;
2425
};
2526
}

libs/execution/src/lib/util/mermaid-util.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ export type NodeShape = '[ ]' | '( )';
3131

3232
export class Node {
3333
private readonly _id: Id = getId();
34-
constructor(public text: string, public shape: NodeShape) {}
34+
constructor(
35+
public text: string,
36+
public shape: NodeShape,
37+
) {}
3538

3639
get id(): Id {
3740
return this._id;
@@ -112,7 +115,10 @@ export class ClassDefinition {
112115
}
113116

114117
export class ClassAssignment {
115-
constructor(public id: string, public className: string) {}
118+
constructor(
119+
public id: string,
120+
public className: string,
121+
) {}
116122

117123
toString(): string {
118124
return `class ${this.id} ${this.className}`;
@@ -126,15 +132,12 @@ export class Graph {
126132
private nodes = new Map<Id, Node>();
127133

128134
private edges = new Map<Id, Edge>();
129-
private edgeAttributes: { id: Id; attributes: string[] }[] = [];
135+
private edgeAttributes: EdgeAttribute[] = [];
130136

131137
private subgraphs = new Map<Id, Graph>();
132138

133-
private classDefinitions: {
134-
class: string;
135-
propertiesAndValues: string[];
136-
}[] = [];
137-
private classAssignments: { id: Id; class: string }[] = [];
139+
private classDefinitions: ClassDefinition[] = [];
140+
private classAssignments: ClassAssignment[] = [];
138141

139142
private blocks = new Map<BlockDefinition, Id>();
140143

libs/extensions/std/exec/src/http-extractor-executor.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@ export class HttpExtractorExecutor extends AbstractBlockExecutor<
151151

152152
// When all data is downloaded, create file
153153
response.on('end', () => {
154-
response.headers;
155-
156154
// Infer Mimetype from HTTP-Header, if not inferrable, then default to application/octet-stream
157155
const mimeType: MimeType | undefined =
158156
inferMimeTypeFromFileExtensionString(

libs/extensions/tabular/exec/src/lib/csv-file-loader-executor.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,13 @@ function toRows(table: Table): Row[] {
8989
}
9090

9191
function transposeArray<T>(array: T[][]): T[][] {
92-
if (array[0] === undefined) {
93-
return [];
94-
}
95-
return array[0]?.map((_, colIndex) =>
96-
array.map((row): T => {
97-
const cell = row[colIndex];
98-
assert(cell !== undefined);
99-
return cell;
100-
}),
92+
return (
93+
array[0]?.map((_, colIndex) =>
94+
array.map((row): T => {
95+
const cell = row[colIndex];
96+
assert(cell !== undefined);
97+
return cell;
98+
}),
99+
) ?? []
101100
);
102101
}

libs/extensions/tabular/exec/src/lib/csv-interpreter-executor.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,20 @@ async function parseAsCSV(
8686
})
8787
.on('error', (error) =>
8888
reject(
89-
`Unexpected error while parsing CSV: ${error.name}: ${error.message}`,
89+
Error(
90+
`Unexpected error while parsing CSV: ${error.name}: ${error.message}`,
91+
),
9092
),
9193
)
9294
.on(
9395
'data-invalid',
9496
(row: Row | null, rowCount: number, reason?: string) =>
9597
reject(
96-
`Invalid row ${rowCount}: ${
97-
reason ?? 'Unknwon reason'
98-
}: ${JSON.stringify(row ?? '')}`,
98+
Error(
99+
`Invalid row ${rowCount}: ${
100+
reason ?? 'Unknwon reason'
101+
}: ${JSON.stringify(row ?? '')}`,
102+
),
99103
),
100104
)
101105
.on('end', () => {

0 commit comments

Comments
 (0)