mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-22 12:32:00 +08:00
chore: bump oxlint & enable more supported rules (#14769)
This commit is contained in:
@@ -58,8 +58,7 @@
|
||||
"@preact/signals-core": "^1.8.0",
|
||||
"lib0": "^0.2.114",
|
||||
"lit": "^3.2.0",
|
||||
"rxjs": "^7.8.2",
|
||||
"zod": "^3.25.76"
|
||||
"rxjs": "^7.8.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vitest": "^4.0.18"
|
||||
|
||||
@@ -553,7 +553,7 @@ export class Vec {
|
||||
*/
|
||||
static clamp(n: number, min: number): number;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/unified-signatures
|
||||
// oxlint-disable-next-line @typescript-eslint/unified-signatures
|
||||
static clamp(n: number, min: number, max: number): number;
|
||||
|
||||
static clamp(n: number, min: number, max?: number): number {
|
||||
@@ -569,7 +569,7 @@ export class Vec {
|
||||
|
||||
static clampV(A: number[], min: number): number[];
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/unified-signatures
|
||||
// oxlint-disable-next-line @typescript-eslint/unified-signatures
|
||||
static clampV(A: number[], min: number, max: number): number[];
|
||||
|
||||
static clampV(A: number[], min: number, max?: number): number[] {
|
||||
|
||||
@@ -110,7 +110,7 @@ export class RangeControl {
|
||||
if (current === start) {
|
||||
startRecorded = true;
|
||||
}
|
||||
// eslint-disable-next-line sonarjs/no-collapsible-if
|
||||
// oxlint-disable-next-line sonarjs/no-collapsible-if
|
||||
if (startRecorded) {
|
||||
if (
|
||||
current.nodeType === Node.TEXT_NODE ||
|
||||
|
||||
@@ -123,7 +123,7 @@ export class DeltaService<TextAttributes extends BaseTextAttributes> {
|
||||
const deltas = this.editor.embedDeltas;
|
||||
const result: Result[] = [];
|
||||
|
||||
// eslint-disable-next-line sonarjs/no-ignored-return
|
||||
// oxlint-disable-next-line sonarjs/no-ignored-return
|
||||
deltas.reduce((rangeIndex, delta, deltaIndex) => {
|
||||
const length = delta.insert.length;
|
||||
const from = inlineRange.index - length;
|
||||
|
||||
@@ -260,7 +260,7 @@ export function inlineRangeToDomRange(
|
||||
let focusOffset = 0;
|
||||
let index = 0;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
||||
// oxlint-disable-next-line @typescript-eslint/prefer-for-of
|
||||
for (let i = 0; i < lineElements.length; i++) {
|
||||
if (startText && endText) {
|
||||
break;
|
||||
|
||||
@@ -248,7 +248,7 @@ export function toGfxBlockComponent<
|
||||
return GfxBlockComponent.prototype.getCSSTransform.call(this);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line sonarjs/no-identical-functions
|
||||
// oxlint-disable-next-line sonarjs/no-identical-functions
|
||||
getRenderingRect(): {
|
||||
x: number;
|
||||
y: number;
|
||||
@@ -290,7 +290,7 @@ export function toGfxBlockComponent<
|
||||
return super.renderBlock();
|
||||
}
|
||||
|
||||
// eslint-disable-next-line sonarjs/no-identical-functions
|
||||
// oxlint-disable-next-line sonarjs/no-identical-functions
|
||||
override async scheduleUpdate() {
|
||||
const parent = this.parentElement;
|
||||
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
"@types/lodash.ismatch": "^4.4.9",
|
||||
"file-type": "^21.0.0",
|
||||
"lib0": "^0.2.114",
|
||||
"lodash.clonedeep": "^4.5.0",
|
||||
"lodash.ismatch": "^4.4.0",
|
||||
"lodash.merge": "^4.6.2",
|
||||
"minimatch": "^10.2.2",
|
||||
"nanoid": "^5.1.6",
|
||||
"rxjs": "^7.8.2",
|
||||
@@ -27,8 +25,6 @@
|
||||
"zod": "^3.25.76"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/lodash.clonedeep": "^4.5.9",
|
||||
"@types/lodash.merge": "^4.6.9",
|
||||
"vitest": "^4.0.18"
|
||||
},
|
||||
"exports": {
|
||||
|
||||
@@ -382,7 +382,7 @@ describe('addBlock', () => {
|
||||
|
||||
const doc0 = collection.createDoc('doc:home');
|
||||
const doc1 = collection.createDoc('space:doc1');
|
||||
// eslint-disable-next-line @typescript-eslint/await-thenable
|
||||
// oxlint-disable-next-line @typescript-eslint/await-thenable
|
||||
await Promise.all([doc0.load(), doc1.load()]);
|
||||
assert.equal(collection.docs.size, 2);
|
||||
const store0 = doc0.getStore({
|
||||
|
||||
@@ -325,7 +325,7 @@ export class ReactiveYMap extends BaseReactiveYData<UnRecord, YMap<unknown>> {
|
||||
|
||||
protected readonly _proxy: UnRecord;
|
||||
|
||||
// eslint-disable-next-line sonarjs/no-identical-functions
|
||||
// oxlint-disable-next-line sonarjs/no-identical-functions
|
||||
constructor(
|
||||
protected readonly _source: UnRecord,
|
||||
protected readonly _ySource: YMap<unknown>,
|
||||
@@ -337,7 +337,7 @@ export class ReactiveYMap extends BaseReactiveYData<UnRecord, YMap<unknown>> {
|
||||
_ySource.observe(this._observer);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line sonarjs/no-identical-functions
|
||||
// oxlint-disable-next-line sonarjs/no-identical-functions
|
||||
pop(prop: string) {
|
||||
const value = this._source[prop];
|
||||
this._stashed.delete(prop);
|
||||
|
||||
@@ -331,7 +331,7 @@ export class Text<
|
||||
|
||||
if (delta && delta instanceof Array) {
|
||||
let charNum = 0;
|
||||
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
||||
// oxlint-disable-next-line @typescript-eslint/prefer-for-of
|
||||
for (let i = 0; i < delta.length; i++) {
|
||||
const content = delta[i];
|
||||
let contentText: string = content.insert || '';
|
||||
|
||||
Reference in New Issue
Block a user