Skip to content

Commit 079d073

Browse files
committed
lint
1 parent 74e4f23 commit 079d073

7 files changed

Lines changed: 16 additions & 18 deletions

File tree

packages/addons/src/bpmn-elements.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ const allBpmnElementKinds: BpmnElementKind[] = [...Object.values(ShapeBpmnElemen
2323
/**
2424
* Options to deduplicate elements when several names match.
2525
*/
26-
export type DeduplicateNamesOptions = {
26+
export interface DeduplicateNamesOptions {
2727
/** If not set, use all `BpmnElementKind` values. */
2828
kinds?: BpmnElementKind[];
2929
/** Apply custom function to filter duplicates. */
3030
filter?: (bpmnSemantic: BpmnSemantic) => boolean;
31-
};
31+
}
3232

3333
// eslint-disable-next-line @typescript-eslint/no-unused-vars
3434
const acceptAll = (_bpmnSemantic: BpmnSemantic): boolean => true;

packages/addons/src/paths.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,17 @@ export class CasePathResolver {
8888
}
8989
}
9090

91-
export type CasePathResolverInput = {
91+
export interface CasePathResolverInput {
9292
/**
9393
* The IDs of elements (flowNodes/shapes and flows/edges) that are already completed. Non-existing ids will be silently ignored.
9494
*
9595
* `Completed` means that the element has been fully executed or definitively cancelled (for BPM engines that support this and allow cancelled elements to be continued).
9696
* No further user action or automation will update the element.
9797
*/
9898
completedIds: string[];
99-
};
99+
}
100100

101-
export type CasePathResolverOutput = {
101+
export interface CasePathResolverOutput {
102102
/**
103103
* The `BpmnSemantic` objects retrieved from the model that relate to the ids passed in {@link CasePathResolverInput}.
104104
*/
@@ -114,4 +114,4 @@ export type CasePathResolverOutput = {
114114
edges: EdgeBpmnSemantic[];
115115
};
116116
};
117-
};
117+
}

packages/addons/src/plugins-support.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ export interface Plugin {
5151
*
5252
* If you don't extend `GlobalOptions`, use {@link GlobalOptions} directly.
5353
*/
54-
export type PluginOptionExtension = {
54+
export interface PluginOptionExtension {
5555
plugins?: PluginConstructor[];
56-
};
56+
}
5757

5858
export type GlobalOptions = BaseGlobalOptions & PluginOptionExtension;
5959

@@ -69,7 +69,7 @@ export type DefaultPlugins = 'css' | 'elements' | 'overlays' | 'style' | 'style-
6969
export type PluginIds = DefaultPlugins | (string & Record<never, never>);
7070

7171
export class BpmnVisualization extends BaseBpmnVisualization {
72-
private readonly plugins: Map<string, Plugin> = new Map();
72+
private readonly plugins = new Map<string, Plugin>();
7373

7474
constructor(options: GlobalOptions) {
7575
super(options);

packages/addons/src/plugins/style.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export class StyleByNamePlugin implements Plugin, StyleRegistryByName {
100100
}
101101

102102
updateStyle(bpmnElementNames: string | string[], styleUpdate: StyleUpdate): void {
103-
const bpmnElements = this.searcher.getElementsByNames(bpmnElementNames as Array<string>);
103+
const bpmnElements = this.searcher.getElementsByNames(bpmnElementNames as string[]);
104104
this.styleRegistry.updateStyle(
105105
bpmnElements.map(bpmnElement => bpmnElement.id),
106106
styleUpdate,
@@ -112,7 +112,7 @@ export class StyleByNamePlugin implements Plugin, StyleRegistryByName {
112112
this.styleRegistry.resetStyle();
113113
return;
114114
}
115-
const bpmnElements = this.searcher.getElementsByNames(bpmnElementNames as Array<string>);
115+
const bpmnElements = this.searcher.getElementsByNames(bpmnElementNames as string[]);
116116
this.styleRegistry.resetStyle(bpmnElements.map(bpmnElement => bpmnElement.id));
117117
}
118118
}

packages/addons/test/spec/plugins/overlays.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ class OverlaysExpectation {
183183
this.model = bpmnVisualization.graph.model;
184184
}
185185

186-
/* eslint-disable jest/no-standalone-expect -- util code, including expect calls */
187186
expectNoOverlay(bpmnId: string): void {
188187
expect(this.getOverlays(bpmnId)).toHaveLength(0);
189188
}
@@ -200,15 +199,14 @@ class OverlaysExpectation {
200199
expect(overlays).toHaveLength(labels.length);
201200
expect(overlays.map(overlay => overlay.label)).toEqual(labels);
202201
}
203-
/* eslint-enable jest/no-standalone-expect */
204202
}
205203

206204
// The real type is "class MxGraphCustomOverlay extends mxgraph.mxCellOverlay" but it is not part of the API so create a convenient matching type here
207205
// class BpmnVisualizationOverlay extends mxCellOverlay {}
208206
// In tests in this file, we are only checking the label, so use a simple type matching the label property of the actual type.
209-
type BpmnVisualizationOverlay = {
207+
interface BpmnVisualizationOverlay {
210208
label: string;
211-
};
209+
}
212210

213211
function createOverlay(label: string): Overlay {
214212
return { label, position: 'top-center' };

packages/demo/src/plugins-by-name.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function clearAllStyles(): void {
4545
styleRegistryByName.resetStyle();
4646
}
4747

48-
function pickRandomElement<T>(array: Array<T>): T {
48+
function pickRandomElement<T>(array: T[]): T {
4949
return array[Math.floor(Math.random() * array.length)];
5050
}
5151

packages/demo/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ function findFiles(relativePathToSourceDirectory: string): string[] {
2828
}
2929
// =====================================================================================================================
3030

31-
function generateInput(): { [p: string]: string } {
31+
function generateInput(): Record<string, string> {
3232
const pages = findFiles('pages');
33-
const input: { [p: string]: string } = {
33+
const input: Record<string, string> = {
3434
index: path.resolve(path.dirname(fileURLToPath(import.meta.url)), 'index.html'),
3535
};
3636
for (const page of pages) {

0 commit comments

Comments
 (0)