chore: Enable more lint rules, disable some that trigger a lot. Will clean up later.

This commit is contained in:
cpojer
2026-01-31 16:03:28 +09:00
parent 481f696a87
commit 15792b153f
292 changed files with 643 additions and 699 deletions

View File

@@ -53,7 +53,7 @@ function mapStyle(style: MarkdownStyle): SignalTextStyle | null {
}
function mergeStyles(styles: SignalTextStyleRange[]): SignalTextStyleRange[] {
const sorted = [...styles].sort((a, b) => {
const sorted = [...styles].toSorted((a, b) => {
if (a.start !== b.start) return a.start - b.start;
if (a.length !== b.length) return a.length - b.length;
return a.style.localeCompare(b.style);
@@ -90,7 +90,7 @@ function applyInsertionsToStyles(
insertions: Insertion[],
): SignalStyleSpan[] {
if (insertions.length === 0) return spans;
const sortedInsertions = [...insertions].sort((a, b) => a.pos - b.pos);
const sortedInsertions = [...insertions].toSorted((a, b) => a.pos - b.pos);
let updated = spans;
for (const insertion of sortedInsertions) {
@@ -137,7 +137,7 @@ function renderSignalText(ir: MarkdownIR): SignalFormattedText {
const text = ir.text ?? "";
if (!text) return { text: "", styles: [] };
const sortedLinks = [...ir.links].sort((a, b) => a.start - b.start);
const sortedLinks = [...ir.links].toSorted((a, b) => a.start - b.start);
let out = "";
let cursor = 0;
const insertions: Insertion[] = [];