Skip to content

Commit a0142f7

Browse files
committed
style: set Prettier printWidth to 120
- Format all files accordingly
1 parent 7377bc0 commit a0142f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+307
-1099
lines changed

.eslintrc.cjs

+2-10
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ module.exports = {
44
es2017: true,
55
node: true,
66
},
7-
extends: [
8-
'eslint:recommended',
9-
'plugin:@typescript-eslint/recommended',
10-
'prettier',
11-
],
7+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
128
ignorePatterns: ['*.cjs'],
139
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
1410
parser: '@typescript-eslint/parser',
@@ -22,11 +18,7 @@ module.exports = {
2218
'@typescript-eslint/no-explicit-any': 'off',
2319
'@typescript-eslint/no-inferrable-types': 'off',
2420
'no-undef': 'off',
25-
'sort-keys': [
26-
'error',
27-
'asc',
28-
{ caseSensitive: true, natural: false, minKeys: 2 },
29-
],
21+
'sort-keys': ['error', 'asc', { caseSensitive: true, natural: false, minKeys: 2 }],
3022
},
3123
settings: {
3224
'svelte3/typescript': () => require('typescript'),

.prettierrc

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"arrowParens": "avoid",
3+
"printWidth": 120,
34
"semi": true,
45
"singleQuote": true,
56
"trailingComma": "all"

playwright.config.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
const config = {
33
reporter: [
44
[process.env.CI ? 'github' : 'list'],
5-
[
6-
'html',
7-
{ open: 'never', outputFile: 'index.html', outputFolder: 'test-results' },
8-
],
5+
['html', { open: 'never', outputFile: 'index.html', outputFolder: 'test-results' }],
96
['json', { outputFile: 'test-results/json-results.json' }],
107
['junit', { outputFile: 'test-results/junit-results.xml' }],
118
],

scripts/version.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,7 @@ function main() {
3131
name: `${packageName}-${packageVersion}`,
3232
};
3333

34-
writeFileSync(
35-
'static/version.json',
36-
`${JSON.stringify(version, null, 2)}\n`,
37-
{ encoding: 'utf8' },
38-
);
34+
writeFileSync('static/version.json', `${JSON.stringify(version, null, 2)}\n`, { encoding: 'utf8' });
3935
}
4036

4137
main();

src/app.d.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ declare namespace App {
2323
declare type DndEvent = import('svelte-dnd-action').DndEvent;
2424
declare namespace svelte.JSX {
2525
interface HTMLAttributes<T> {
26-
onconsider?: (
27-
event: CustomEvent<DndEvent> & { target: EventTarget & T },
28-
) => void;
29-
onfinalize?: (
30-
event: CustomEvent<DndEvent> & { target: EventTarget & T },
31-
) => void;
26+
onconsider?: (event: CustomEvent<DndEvent> & { target: EventTarget & T }) => void;
27+
onfinalize?: (event: CustomEvent<DndEvent> & { target: EventTarget & T }) => void;
3228
}
3329
}

src/components/activity/ActivityDictionary.svelte

+4-14
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,8 @@
1313
let activityTypes: ActivityType[] = $plan.model.activityTypes;
1414
let filterText: string = '';
1515
16-
$: filteredActivityTypes = activityTypes.filter(({ name }) =>
17-
name.toLowerCase().includes(filterText.toLowerCase()),
18-
);
19-
$: sortedActivityTypes = filteredActivityTypes.sort((a, b) =>
20-
compare(a.name, b.name),
21-
);
16+
$: filteredActivityTypes = activityTypes.filter(({ name }) => name.toLowerCase().includes(filterText.toLowerCase()));
17+
$: sortedActivityTypes = filteredActivityTypes.sort((a, b) => compare(a.name, b.name));
2218
2319
function onDragEnd(): void {
2420
document.getElementById('list-item-drag-image').remove();
@@ -46,12 +42,7 @@
4642
<fieldset class="w-100 m-0 p-0 pb-2">
4743
<Input>
4844
<i class="bi bi-search" slot="left" />
49-
<input
50-
bind:value={filterText}
51-
class="st-input w-100"
52-
name="search"
53-
placeholder="Filter activity types"
54-
/>
45+
<input bind:value={filterText} class="st-input w-100" name="search" placeholder="Filter activity types" />
5546
</Input>
5647
</fieldset>
5748

@@ -67,8 +58,7 @@
6758
<span slot="suffix">
6859
<button
6960
class="st-button icon fs-6"
70-
on:click={() =>
71-
activityActions.createActivityAtPlanStart(activityType)}
61+
on:click={() => activityActions.createActivityAtPlanStart(activityType)}
7262
use:tooltip={{ content: 'Create Activity', placement: 'left' }}
7363
>
7464
<i class="bi bi-plus" />

src/components/activity/ActivityForm.svelte

+8-42
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,7 @@
6565
req
6666
.getEffectiveActivityArguments(model.id, activityType.name, argumentsMap)
6767
.then(({ arguments: defaultArgumentsMap }) => {
68-
formParameters = getFormParameters(
69-
activityType.parameters,
70-
argumentsMap,
71-
defaultArgumentsMap,
72-
);
68+
formParameters = getFormParameters(activityType.parameters, argumentsMap, defaultArgumentsMap);
7369
});
7470
}
7571
$: validateArguments(argumentsMap);
@@ -86,15 +82,9 @@
8682
}
8783
}
8884
89-
async function validateArguments(
90-
newArguments: ArgumentsMap | null,
91-
): Promise<void> {
85+
async function validateArguments(newArguments: ArgumentsMap | null): Promise<void> {
9286
if (newArguments) {
93-
const { errors, success } = await req.validateActivityArguments(
94-
type,
95-
model.id,
96-
newArguments,
97-
);
87+
const { errors, success } = await req.validateActivityArguments(type, model.id, newArguments);
9888
9989
// TODO: Update to account for errors returned for individual arguments.
10090
if (!success) {
@@ -133,50 +123,30 @@
133123
<fieldset>
134124
<label for="activity-type">Activity Type</label>
135125
<Input>
136-
<input
137-
bind:value={type}
138-
class="st-input w-100"
139-
disabled
140-
name="activity-type"
141-
/>
126+
<input bind:value={type} class="st-input w-100" disabled name="activity-type" />
142127
<i class="bi bi-lock-fill" slot="right" />
143128
</Input>
144129
</fieldset>
145130

146131
<fieldset>
147132
<label for="parent-id">Parent ID</label>
148133
<Input>
149-
<input
150-
bind:value={parentId}
151-
class="st-input w-100"
152-
disabled
153-
name="parent-id"
154-
/>
134+
<input bind:value={parentId} class="st-input w-100" disabled name="parent-id" />
155135
<i class="bi bi-lock-fill" slot="right" />
156136
</Input>
157137
</fieldset>
158138

159139
<fieldset>
160140
<label for="duration">Duration</label>
161141
<Input>
162-
<input
163-
bind:value={duration}
164-
class="st-input w-100"
165-
disabled
166-
name="duration"
167-
/>
142+
<input bind:value={duration} class="st-input w-100" disabled name="duration" />
168143
<i class="bi bi-lock-fill" slot="right" />
169144
</Input>
170145
</fieldset>
171146

172147
<Field field={startTimeField} on:valid={onUpdateStartTime}>
173148
<label for="start-time" slot="label">Start Time</label>
174-
<input
175-
autocomplete="off"
176-
class="st-input w-100"
177-
disabled={isChild}
178-
name="start-time"
179-
/>
149+
<input autocomplete="off" class="st-input w-100" disabled={isChild} name="start-time" />
180150
</Field>
181151

182152
<fieldset>
@@ -190,11 +160,7 @@
190160
</span>
191161
</summary>
192162
<div class="mt-2">
193-
<Parameters
194-
disabled={isChild}
195-
{formParameters}
196-
on:change={onChangeFormParameters}
197-
/>
163+
<Parameters disabled={isChild} {formParameters} on:change={onChangeFormParameters} />
198164
</div>
199165
</details>
200166
</fieldset>

src/components/constraint/ConstraintEditor.svelte

+9-48
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
import MonacoEditor from '../ui/MonacoEditor.svelte';
77
import Panel from '../ui/Panel.svelte';
88
import req from '../../utilities/requests';
9-
import {
10-
constraintActions,
11-
selectedConstraint,
12-
} from '../../stores/constraints';
9+
import { constraintActions, selectedConstraint } from '../../stores/constraints';
1310
1411
let constraintType: ConstraintType = 'model';
1512
let debounce: NodeJS.Timeout;
@@ -24,11 +21,7 @@
2421
onMount(() => {
2522
if ($selectedConstraint) {
2623
constraintType = $selectedConstraint.model_id ? 'model' : 'plan';
27-
definition = JSON.stringify(
28-
JSON.parse($selectedConstraint.definition),
29-
null,
30-
2,
31-
);
24+
definition = JSON.stringify(JSON.parse($selectedConstraint.definition), null, 2);
3225
description = $selectedConstraint.description;
3326
name = $selectedConstraint.name;
3427
summary = $selectedConstraint.summary;
@@ -41,9 +34,7 @@
4134
}
4235
});
4336
44-
async function onDidChangeModelContent(
45-
event: CustomEvent<{ value: string }>,
46-
) {
37+
async function onDidChangeModelContent(event: CustomEvent<{ value: string }>) {
4738
const { detail } = event;
4839
const { value } = detail;
4940
@@ -75,25 +66,15 @@
7566
summary,
7667
);
7768
} else {
78-
constraintActions.createConstraint(
79-
constraintType,
80-
definition,
81-
description,
82-
name,
83-
summary,
84-
);
69+
constraintActions.createConstraint(constraintType, definition, description, name, summary);
8570
}
8671
}
8772
</script>
8873

8974
<Panel>
9075
<svelte:fragment slot="header">
9176
<Chip>Constraint Editor</Chip>
92-
<button
93-
class="st-button secondary ellipsis"
94-
disabled={!valid}
95-
on:click={() => saveConstraint()}
96-
>
77+
<button class="st-button secondary ellipsis" disabled={!valid} on:click={() => saveConstraint()}>
9778
<i class="bi bi-save" style="font-size: 0.8rem" />
9879
Save Constraint
9980
</button>
@@ -105,45 +86,25 @@
10586
<div class="p-1">
10687
<fieldset>
10788
<label for="type">Type</label>
108-
<select
109-
bind:value={constraintType}
110-
class="st-select w-100"
111-
name="type"
112-
>
89+
<select bind:value={constraintType} class="st-select w-100" name="type">
11390
<option value="model">Model</option>
11491
<option value="plan">Plan</option>
11592
</select>
11693
</fieldset>
11794

11895
<fieldset>
11996
<label for="name">Name</label>
120-
<input
121-
bind:value={name}
122-
autocomplete="off"
123-
class="st-input w-100"
124-
name="name"
125-
required
126-
/>
97+
<input bind:value={name} autocomplete="off" class="st-input w-100" name="name" required />
12798
</fieldset>
12899

129100
<fieldset>
130101
<label for="description">Description</label>
131-
<input
132-
bind:value={description}
133-
autocomplete="off"
134-
class="st-input w-100"
135-
name="description"
136-
/>
102+
<input bind:value={description} autocomplete="off" class="st-input w-100" name="description" />
137103
</fieldset>
138104

139105
<fieldset>
140106
<label for="summary">Summary</label>
141-
<input
142-
bind:value={summary}
143-
autocomplete="off"
144-
class="st-input w-100"
145-
name="summary"
146-
/>
107+
<input bind:value={summary} autocomplete="off" class="st-input w-100" name="summary" />
147108
</fieldset>
148109
</div>
149110
</details>

src/components/constraint/ConstraintList.svelte

+6-15
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@
66
import Panel from '../ui/Panel.svelte';
77
import ConfirmModal from '../modals/ConfirmModal.svelte';
88
import type Modal from '../modals/Modal.svelte';
9-
import {
10-
constraintActions,
11-
modelConstraints,
12-
planConstraints,
13-
} from '../../stores/constraints';
9+
import { constraintActions, modelConstraints, planConstraints } from '../../stores/constraints';
1410
import { tooltip } from '../../utilities/tooltip';
1511
1612
let confirmDeleteConstraintModal: Modal;
@@ -32,8 +28,7 @@
3228
<span slot="suffix">
3329
<button
3430
class="st-button icon"
35-
on:click|stopPropagation={() =>
36-
constraintActions.editConstraint(constraint)}
31+
on:click|stopPropagation={() => constraintActions.editConstraint(constraint)}
3732
use:tooltip={{
3833
content: 'Edit Constraint',
3934
placement: 'left',
@@ -43,8 +38,7 @@
4338
</button>
4439
<button
4540
class="st-button icon"
46-
on:click|stopPropagation={() =>
47-
confirmDeleteConstraintModal.show(constraint)}
41+
on:click|stopPropagation={() => confirmDeleteConstraintModal.show(constraint)}
4842
use:tooltip={{
4943
content: 'Delete Constraint',
5044
placement: 'left',
@@ -71,8 +65,7 @@
7165
<span slot="suffix">
7266
<button
7367
class="st-button icon"
74-
on:click|stopPropagation={() =>
75-
constraintActions.editConstraint(constraint)}
68+
on:click|stopPropagation={() => constraintActions.editConstraint(constraint)}
7669
use:tooltip={{
7770
content: 'Edit Constraint',
7871
placement: 'left',
@@ -82,8 +75,7 @@
8275
</button>
8376
<button
8477
class="st-button icon"
85-
on:click|stopPropagation={() =>
86-
confirmDeleteConstraintModal.show(constraint)}
78+
on:click|stopPropagation={() => confirmDeleteConstraintModal.show(constraint)}
8779
use:tooltip={{
8880
content: 'Delete Constraint',
8981
placement: 'left',
@@ -107,6 +99,5 @@
10799
confirmText="Delete"
108100
message="Are you sure you want to delete this constraint?"
109101
title="Delete Constraint"
110-
on:confirm={({ detail: constraint }) =>
111-
constraintActions.deleteConstraint(constraint.id)}
102+
on:confirm={({ detail: constraint }) => constraintActions.deleteConstraint(constraint.id)}
112103
/>

src/components/constraint/ConstraintViolations.svelte

+1-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@
1515
<svelte:fragment slot="body">
1616
{#if $violations.length}
1717
{#each $violations as violation}
18-
<ListItem
19-
style="cursor: pointer"
20-
on:click={() => constraintActions.zoomToViolation(violation)}
21-
>
18+
<ListItem style="cursor: pointer" on:click={() => constraintActions.zoomToViolation(violation)}>
2219
{violation.constraint.name}
2320
<span slot="suffix">
2421
<i class="bi bi-exclamation-triangle" />

0 commit comments

Comments
 (0)