Skip to content

Commit e2b98cd

Browse files
committed
Add copilot customizations and harden Auth.ts validation
- Add architecture overview and inline-cast convention to copilot-instructions.md - Consolidate repo memory files into copilot-instructions.md as single source of truth - Add fix-all and server-change skills for automated CI and server-change checklists - Add reviewer (read-only) and test-writer custom agents - Fix unsafe type assertions in Auth.ts: validate JWT payload and scrypt options at runtime - Add ESLint padding-line-between-statements rule to enforce blank lines after blocks - Auto-fix 88 blank-line violations across codebase Signed-off-by: Mike Lischke <mike@lischke-online.de>
1 parent 94806bc commit e2b98cd

44 files changed

Lines changed: 131 additions & 10 deletions

Some content is hidden

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

.github/copilot-instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ Always put a blank line after blocks (`if`/`for`/`while`/`switch`/`case`/anonymo
138138
- Use `undefined` instead of `null` everywhere.
139139
- Use `field?: Type` syntax instead of `field: Type | undefined` for optional fields.
140140
- Interface names always start with a capital `I` (e.g., `ISoundStyleMeta`, `IMeasureStep`).
141+
- Inline type casts (`as { ... }`) are acceptable for one-off use. If the same anonymous shape appears more than once, extract it to a named interface.
141142
- No section-divider comments (e.g. `// ---------- api ----------`). Let method ordering speak for itself.
142143

143144
### Security

eslint.config.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,16 @@ export default tseslint.config(
200200
prev: "*",
201201
next: "return",
202202
},
203+
{
204+
blankLine: "always",
205+
prev: "block-like",
206+
next: "*",
207+
},
208+
{
209+
blankLine: "any",
210+
prev: "case",
211+
next: "case",
212+
},
203213
],
204214
"@stylistic/quotes": [
205215
"error",

src/App.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,9 @@ export class App extends UIComponent<{}, IAppState> {
13821382
}
13831383

13841384
default:
1385-
};
1385+
}
1386+
1387+
;
13861388

13871389
return true;
13881390
};
@@ -1516,6 +1518,7 @@ export class App extends UIComponent<{}, IAppState> {
15161518
this.undoManager?.undo();
15171519
} // With ctrl, this doesn't even trigger on Mac. Seems harmless to include it anyway.
15181520
}
1521+
15191522
break;
15201523
}
15211524

src/components/ui/Arrangement/ArrangementEditControls.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ export class ArrangementEditControls
217217

218218
services.modeManager.deletePolyrhythmMode = false;
219219
}
220+
220221
this.setState({ arePolyrhythms });
221222

222223
return Promise.resolve(true);
@@ -261,6 +262,7 @@ export class ArrangementEditControls
261262
Overlay.toggleOverlay("delete_polyrhythms", "hide");
262263
services.modeManager.deletePolyrhythmMode = false;
263264
}
265+
264266
this.setState({ arePolyrhythms });
265267

266268
return Promise.resolve(true);

src/components/ui/Arrangement/UndoRedoControls.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export class UndoRedoControls extends UIComponent<IUndoRedoProps, IUndoRedoState
4545
canRedo: undoManager.canRedo
4646
});
4747
}
48+
4849
this.prepareSubscriptions();
4950
}
5051

src/components/ui/Bar/Grid/GridMeasureRow.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export class GridMeasureRow extends UIComponent<IGridMeasureRowProperties> {
7070
/>,
7171
);
7272
}
73+
7374
cumulative += groupSize;
7475
}
7576

@@ -120,6 +121,7 @@ export class GridMeasureRow extends UIComponent<IGridMeasureRowProperties> {
120121
if (i < steps.length) {
121122
items.push({ type: "step", step: steps[i] });
122123
}
124+
123125
i++;
124126
}
125127
}

src/components/ui/Note/StaffNoteViewer.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ export class StaffNoteViewer extends UIComponent<IStaffNoteViewerProperties> {
428428
target.delete(pending.negativeKey);
429429
}
430430
}
431+
431432
pendingSubdivisionBeams.length = 0;
432433

433434
run = [];
@@ -597,6 +598,7 @@ export class StaffNoteViewer extends UIComponent<IStaffNoteViewerProperties> {
597598
segments.push({ level, kind: "partial-left" });
598599
}
599600
}
601+
600602
if (segments.length > 0) {
601603
const overwriteLevels = new Set(segments.map((segment) => {
602604
return segment.level;
@@ -772,6 +774,7 @@ export class StaffNoteViewer extends UIComponent<IStaffNoteViewerProperties> {
772774
if (Number.isInteger(dottedSteps) && dottedSteps >= 2 && dottedSteps <= stepsPerBar) {
773775
candidates.push({ steps: dottedSteps, alignmentSteps: base.steps, icon: base.icon, dotted: true });
774776
}
777+
775778
if (Number.isInteger(base.steps) && base.steps >= 1 && base.steps <= stepsPerBar) {
776779
candidates.push({ steps: base.steps, alignmentSteps: base.steps, icon: base.icon, dotted: false });
777780
}
@@ -854,6 +857,7 @@ export class StaffNoteViewer extends UIComponent<IStaffNoteViewerProperties> {
854857
flushRun(currentRun);
855858
currentRun = [];
856859
}
860+
857861
basePos++;
858862
}
859863
}

src/components/ui/Print/PrintView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ export class PrintView extends UIComponent<IPrintViewProps> {
178178
for (let j = 0; j < perLine && (i + j) <= totalBars; j++) {
179179
block.push(i + j);
180180
}
181+
181182
blocks.push(block);
182183
}
183184

src/components/ui/Statusbar/Statusbar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ export class Statusbar extends UIComponent<ICommonUIProperties, IStatusBarState>
218218
iconClass += "codicon-modifier-spin ";
219219
icon = icon.slice(0, -5);
220220
}
221+
221222
iconClass += `codicon codicon-${icon}`;
222223

223224
elements.push(<span key={`icon-${index}-${i}`} className={iconClass} />);

src/components/ui/composites/WaveformPlayer.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ export class WaveformPlayer extends UIComponent<IWaveformPlayerProps, IWaveformP
106106
let mediaElement: HTMLMediaElement | undefined;
107107
if (media) {
108108
mediaElement = document.getElementById(media) as HTMLMediaElement;
109-
};
109+
}
110+
111+
;
110112

111113
const ws = WaveSurfer.create({
112114
container: this.containerRef.current,

0 commit comments

Comments
 (0)