Fix all biome linter errors (#541)

This commit is contained in:
Jared Palmer 2024-11-15 12:18:17 -05:00 committed by GitHub
parent f23c73f6a5
commit e5d654bf41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
46 changed files with 317 additions and 275 deletions

View file

@ -248,18 +248,16 @@ export const patchTextNodes = (schema, oldNode, newNode) => {
});
// Map diffs to nodes
const res = diffs
.map(([type, sentences]) => {
return sentences.map((sentence) => {
const node = createTextNode(
schema,
sentence,
type !== DiffType.Unchanged ? [createDiffMark(schema, type)] : []
);
return node;
});
})
.flat();
const res = diffs.flatMap(([type, sentences]) => {
return sentences.map((sentence) => {
const node = createTextNode(
schema,
sentence,
type !== DiffType.Unchanged ? [createDiffMark(schema, type)] : []
);
return node;
});
});
return res;
};
@ -278,28 +276,26 @@ const sentencesToChars = (oldSentences, newSentences) => {
const chars1 = oldSentences
.map((sentence) => {
const line = sentence;
if (lineHash.hasOwnProperty(line)) {
return String.fromCharCode(lineHash[line]);
} else {
lineHash[line] = lineStart;
lineArray[lineStart] = line;
lineStart++;
if (line in lineHash) {
return String.fromCharCode(lineHash[line]);
}
lineHash[line] = lineStart;
lineArray[lineStart] = line;
lineStart++;
return String.fromCharCode(lineHash[line]);
})
.join('');
const chars2 = newSentences
.map((sentence) => {
const line = sentence;
if (lineHash.hasOwnProperty(line)) {
return String.fromCharCode(lineHash[line]);
} else {
lineHash[line] = lineStart;
lineArray[lineStart] = line;
lineStart++;
if (line in lineHash) {
return String.fromCharCode(lineHash[line]);
}
lineHash[line] = lineStart;
lineArray[lineStart] = line;
lineStart++;
return String.fromCharCode(lineHash[line]);
})
.join('');