Skip to content

Commit 1cd7d54

Browse files
committed
fix: update format & fix diff editor update
1 parent eab0cc0 commit 1cd7d54

19 files changed

Lines changed: 3266 additions & 1964 deletions

eslint.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
import globals from "globals";
22
import pluginJs from "@eslint/js";
33
import tseslint from "typescript-eslint";
4+
import { includeIgnoreFile } from "@eslint/compat";
5+
import { fileURLToPath } from "node:url";
6+
import path from "node:path";
7+
8+
const __filename = fileURLToPath(import.meta.url);
9+
const __dirname = path.dirname(__filename);
10+
const gitignorePath = path.resolve(__dirname, ".gitignore");
411

512
/** @type {import('eslint').Linter.Config[]} */
613
export default [
14+
includeIgnoreFile(gitignorePath),
715
{ files: ["**/*.{js,mjs,cjs,ts}"] },
816
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
917
pluginJs.configs.recommended,

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"license": "MIT",
1919
"devDependencies": {
2020
"@changesets/cli": "^2.27.12",
21+
"@eslint/compat": "^1.2.6",
2122
"@eslint/js": "^9.19.0",
2223
"@types/node": "^22.10.2",
2324
"@typescript-eslint/eslint-plugin": "^8.19.0",
@@ -30,4 +31,4 @@
3031
"typescript-eslint": "^8.22.0",
3132
"vitest": "^3.0.5"
3233
}
33-
}
34+
}

packages/codiff/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
"devDependencies": {
2626
"vitest": "^3.0.5"
2727
}
28-
}
28+
}

packages/codiff/src/common/arraysFind.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class MonotonousArray<T> {
2222
for (const item of this._array) {
2323
if (this._prevFindLastPredicate(item) && !predicate(item)) {
2424
throw new Error(
25-
"MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate."
25+
"MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.",
2626
);
2727
}
2828
}
@@ -33,7 +33,7 @@ export class MonotonousArray<T> {
3333
const idx = findLastIdxMonotonous(
3434
this._array,
3535
predicate,
36-
this._findLastMonotonousLastIdx
36+
this._findLastMonotonousLastIdx,
3737
);
3838
this._findLastMonotonousLastIdx = idx + 1;
3939
return idx === -1 ? undefined : this._array[idx];
@@ -48,7 +48,7 @@ export class MonotonousArray<T> {
4848
*/
4949
export function findLastMonotonous<T>(
5050
array: readonly T[],
51-
predicate: (item: T) => boolean
51+
predicate: (item: T) => boolean,
5252
): T | undefined {
5353
const idx = findLastIdxMonotonous(array, predicate);
5454
return idx === -1 ? undefined : array[idx];
@@ -64,7 +64,7 @@ export function findLastIdxMonotonous<T>(
6464
array: readonly T[],
6565
predicate: (item: T) => boolean,
6666
startIdx = 0,
67-
endIdxEx = array.length
67+
endIdxEx = array.length,
6868
): number {
6969
let i = startIdx;
7070
let j = endIdxEx;
@@ -89,7 +89,7 @@ export function findFirstIdxMonotonousOrArrLen<T>(
8989
array: readonly T[],
9090
predicate: (item: T) => boolean,
9191
startIdx = 0,
92-
endIdxEx = array.length
92+
endIdxEx = array.length,
9393
): number {
9494
let i = startIdx;
9595
let j = endIdxEx;
@@ -112,7 +112,7 @@ export function findFirstIdxMonotonousOrArrLen<T>(
112112
*/
113113
export function findFirstMonotonous<T>(
114114
array: readonly T[],
115-
predicate: (item: T) => boolean
115+
predicate: (item: T) => boolean,
116116
): T | undefined {
117117
const idx = findFirstIdxMonotonousOrArrLen(array, predicate);
118118
return idx === array.length ? undefined : array[idx];

0 commit comments

Comments
 (0)