chore: re-add eslint-plugin-import-x

This commit is contained in:
Simon Chan 2024-05-20 15:57:17 +08:00
parent 493683b80c
commit fdf0a863d9
No known key found for this signature in database
GPG key ID: A8B69F750B9BCEDD
35 changed files with 668 additions and 619 deletions

View file

@ -38,15 +38,15 @@
"@yume-chan/adb-server-node-tcp": "workspace:^0.0.23", "@yume-chan/adb-server-node-tcp": "workspace:^0.0.23",
"@yume-chan/android-bin": "workspace:^0.0.23", "@yume-chan/android-bin": "workspace:^0.0.23",
"@yume-chan/stream-extra": "workspace:^0.0.23", "@yume-chan/stream-extra": "workspace:^0.0.23",
"commander": "^12.0.0", "commander": "^12.1.0",
"source-map-support": "^0.5.21", "source-map-support": "^0.5.21",
"tslib": "^2.6.2" "tslib": "^2.6.2"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^20.12.8", "@types/node": "^20.12.12",
"@yume-chan/eslint-config": "workspace:^1.0.0", "@yume-chan/eslint-config": "workspace:^1.0.0",
"@yume-chan/tsconfig": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0",
"jest": "^30.0.0-alpha.3", "jest": "^30.0.0-alpha.4",
"prettier": "^3.2.5", "prettier": "^3.2.5",
"typescript": "^5.4.5" "typescript": "^5.4.5"
} }

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
{ {
"pnpmShrinkwrapHash": "ca7743cb8480b533789651d98878a7900c9455fa", "pnpmShrinkwrapHash": "ab66fdfb3a225f67f9a6328586015487b6aa4d04",
"preferredVersionsHash": "bf21a9e8fbc5a3846fb05b4fa0859e0917b2202f" "preferredVersionsHash": "bf21a9e8fbc5a3846fb05b4fa0859e0917b2202f"
} }

View file

@ -40,11 +40,11 @@
"@yume-chan/struct": "workspace:^0.0.23" "@yume-chan/struct": "workspace:^0.0.23"
}, },
"devDependencies": { "devDependencies": {
"@jest/globals": "^30.0.0-alpha.3", "@jest/globals": "^30.0.0-alpha.4",
"@yume-chan/eslint-config": "workspace:^1.0.0", "@yume-chan/eslint-config": "workspace:^1.0.0",
"@yume-chan/tsconfig": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"jest": "^30.0.0-alpha.3", "jest": "^30.0.0-alpha.4",
"prettier": "^3.2.5", "prettier": "^3.2.5",
"ts-jest": "^29.1.2", "ts-jest": "^29.1.2",
"typescript": "^5.4.5" "typescript": "^5.4.5"

View file

@ -37,10 +37,10 @@
"@yume-chan/struct": "workspace:^0.0.23" "@yume-chan/struct": "workspace:^0.0.23"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^20.12.8", "@types/node": "^20.12.12",
"@yume-chan/eslint-config": "workspace:^1.0.0", "@yume-chan/eslint-config": "workspace:^1.0.0",
"@yume-chan/tsconfig": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0",
"jest": "^30.0.0-alpha.3", "jest": "^30.0.0-alpha.4",
"prettier": "^3.2.5", "prettier": "^3.2.5",
"typescript": "^5.4.5" "typescript": "^5.4.5"
} }

View file

@ -39,12 +39,12 @@
"@yume-chan/struct": "workspace:^0.0.23" "@yume-chan/struct": "workspace:^0.0.23"
}, },
"devDependencies": { "devDependencies": {
"@jest/globals": "^30.0.0-alpha.3", "@jest/globals": "^30.0.0-alpha.4",
"@types/node": "^20.12.8", "@types/node": "^20.12.12",
"@yume-chan/eslint-config": "workspace:^1.0.0", "@yume-chan/eslint-config": "workspace:^1.0.0",
"@yume-chan/tsconfig": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"jest": "^30.0.0-alpha.3", "jest": "^30.0.0-alpha.4",
"prettier": "^3.2.5", "prettier": "^3.2.5",
"ts-jest": "^29.1.2", "ts-jest": "^29.1.2",
"typescript": "^5.4.5" "typescript": "^5.4.5"

View file

@ -40,11 +40,13 @@ export class AdbPower extends AdbCommandBase {
} }
powerButton(longPress = false) { powerButton(longPress = false) {
return this.adb.subprocess.spawnAndWaitLegacy([ const args = ["input", "keyevent"];
"input", if (longPress) {
"keyevent", args.push("--longpress");
longPress ? "--longpress POWER" : "POWER", }
]); args.push("POWER");
return this.adb.subprocess.spawnAndWaitLegacy(args);
} }
/** /**

View file

@ -1,12 +1,14 @@
import { PromiseResolver } from "@yume-chan/async"; import { PromiseResolver } from "@yume-chan/async";
import type {
PushReadableStreamController,
ReadableStream,
WritableStreamDefaultWriter,
} from "@yume-chan/stream-extra";
import { import {
MaybeConsumable, MaybeConsumable,
PushReadableStream, PushReadableStream,
StructDeserializeStream, StructDeserializeStream,
WritableStream, WritableStream,
type PushReadableStreamController,
type ReadableStream,
type WritableStreamDefaultWriter,
} from "@yume-chan/stream-extra"; } from "@yume-chan/stream-extra";
import type { StructValueType } from "@yume-chan/struct"; import type { StructValueType } from "@yume-chan/struct";
import Struct, { placeholder } from "@yume-chan/struct"; import Struct, { placeholder } from "@yume-chan/struct";

View file

@ -1,8 +1,8 @@
import type { ReadableStream } from "@yume-chan/stream-extra";
import { import {
AbortController, AbortController,
DistributionStream, DistributionStream,
MaybeConsumable, MaybeConsumable,
type ReadableStream,
} from "@yume-chan/stream-extra"; } from "@yume-chan/stream-extra";
import Struct, { placeholder } from "@yume-chan/struct"; import Struct, { placeholder } from "@yume-chan/struct";

View file

@ -2,6 +2,7 @@ import { describe, expect, it } from "@jest/globals";
import { EMPTY_UINT8_ARRAY, encodeUtf8 } from "@yume-chan/struct"; import { EMPTY_UINT8_ARRAY, encodeUtf8 } from "@yume-chan/struct";
import { decodeBase64 } from "../utils/base64.js"; import { decodeBase64 } from "../utils/base64.js";
import type { AdbCredentialStore } from "./auth.js"; import type { AdbCredentialStore } from "./auth.js";
import { AdbAuthType, AdbPublicKeyAuthenticator } from "./auth.js"; import { AdbAuthType, AdbPublicKeyAuthenticator } from "./auth.js";
import type { AdbPacketData } from "./packet.js"; import type { AdbPacketData } from "./packet.js";

View file

@ -1,5 +1,7 @@
import { describe, expect, it } from "@jest/globals"; import { describe, expect, it } from "@jest/globals";
import { decodeBase64 } from "../utils/base64.js"; import { decodeBase64 } from "../utils/base64.js";
import { adbGeneratePublicKey, modInverse } from "./crypto.js"; import { adbGeneratePublicKey, modInverse } from "./crypto.js";
describe("modInverse", () => { describe("modInverse", () => {

View file

@ -7,12 +7,14 @@ import {
getUint32LittleEndian, getUint32LittleEndian,
setUint32LittleEndian, setUint32LittleEndian,
} from "@yume-chan/no-data-view"; } from "@yume-chan/no-data-view";
import type {
ReadableWritablePair,
WritableStreamDefaultWriter,
} from "@yume-chan/stream-extra";
import { import {
AbortController, AbortController,
Consumable, Consumable,
WritableStream, WritableStream,
type ReadableWritablePair,
type WritableStreamDefaultWriter,
} from "@yume-chan/stream-extra"; } from "@yume-chan/stream-extra";
import { EMPTY_UINT8_ARRAY } from "@yume-chan/struct"; import { EMPTY_UINT8_ARRAY } from "@yume-chan/struct";

View file

@ -1,14 +1,13 @@
import { PromiseResolver } from "@yume-chan/async"; import { PromiseResolver } from "@yume-chan/async";
import type { Disposable } from "@yume-chan/event"; import type { Disposable } from "@yume-chan/event";
import { import type {
MaybeConsumable, AbortSignal,
PushReadableStream, PushReadableStreamController,
type AbortSignal, ReadableStream,
type PushReadableStreamController, WritableStream,
type ReadableStream, WritableStreamDefaultController,
type WritableStream,
type WritableStreamDefaultController,
} from "@yume-chan/stream-extra"; } from "@yume-chan/stream-extra";
import { MaybeConsumable, PushReadableStream } from "@yume-chan/stream-extra";
import { EMPTY_UINT8_ARRAY } from "@yume-chan/struct"; import { EMPTY_UINT8_ARRAY } from "@yume-chan/struct";
import type { AdbSocket } from "../adb.js"; import type { AdbSocket } from "../adb.js";

View file

@ -1,9 +1,9 @@
import { PromiseResolver } from "@yume-chan/async"; import { PromiseResolver } from "@yume-chan/async";
import type { ReadableWritablePair } from "@yume-chan/stream-extra";
import { import {
AbortController, AbortController,
Consumable, Consumable,
WritableStream, WritableStream,
type ReadableWritablePair,
} from "@yume-chan/stream-extra"; } from "@yume-chan/stream-extra";
import type { ValueOrPromise } from "@yume-chan/struct"; import type { ValueOrPromise } from "@yume-chan/struct";
import { decodeUtf8, encodeUtf8 } from "@yume-chan/struct"; import { decodeUtf8, encodeUtf8 } from "@yume-chan/struct";

View file

@ -37,11 +37,11 @@
"@yume-chan/struct": "workspace:^0.0.23" "@yume-chan/struct": "workspace:^0.0.23"
}, },
"devDependencies": { "devDependencies": {
"@jest/globals": "^30.0.0-alpha.3", "@jest/globals": "^30.0.0-alpha.4",
"@yume-chan/eslint-config": "workspace:^1.0.0", "@yume-chan/eslint-config": "workspace:^1.0.0",
"@yume-chan/tsconfig": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"jest": "^30.0.0-alpha.3", "jest": "^30.0.0-alpha.4",
"prettier": "^3.2.5", "prettier": "^3.2.5",
"ts-jest": "^29.1.2", "ts-jest": "^29.1.2",
"typescript": "^5.4.5" "typescript": "^5.4.5"

View file

@ -36,11 +36,11 @@
"@yume-chan/async": "^2.2.0" "@yume-chan/async": "^2.2.0"
}, },
"devDependencies": { "devDependencies": {
"@jest/globals": "^30.0.0-alpha.3", "@jest/globals": "^30.0.0-alpha.4",
"@yume-chan/eslint-config": "workspace:^1.0.0", "@yume-chan/eslint-config": "workspace:^1.0.0",
"@yume-chan/tsconfig": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"jest": "^30.0.0-alpha.3", "jest": "^30.0.0-alpha.4",
"prettier": "^3.2.5", "prettier": "^3.2.5",
"ts-jest": "^29.1.2", "ts-jest": "^29.1.2",
"typescript": "^5.4.5" "typescript": "^5.4.5"

View file

@ -30,6 +30,6 @@
"gh-release-fetch": "^4.0.3" "gh-release-fetch": "^4.0.3"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^20.12.8" "@types/node": "^20.12.12"
} }
} }

View file

@ -30,12 +30,12 @@
"prepublishOnly": "npm run build" "prepublishOnly": "npm run build"
}, },
"devDependencies": { "devDependencies": {
"@jest/globals": "^30.0.0-alpha.3", "@jest/globals": "^30.0.0-alpha.4",
"@types/node": "^20.12.8", "@types/node": "^20.12.12",
"@yume-chan/eslint-config": "workspace:^1.0.0", "@yume-chan/eslint-config": "workspace:^1.0.0",
"@yume-chan/tsconfig": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"jest": "^30.0.0-alpha.3", "jest": "^30.0.0-alpha.4",
"prettier": "^3.2.5", "prettier": "^3.2.5",
"tinybench": "^2.8.0", "tinybench": "^2.8.0",
"ts-jest": "^29.1.2", "ts-jest": "^29.1.2",

View file

@ -1,4 +1,5 @@
import { describe, expect, it } from "@jest/globals"; import { describe, expect, it } from "@jest/globals";
import { getInt8 } from "./int8.js"; import { getInt8 } from "./int8.js";
describe("getInt8", () => { describe("getInt8", () => {

View file

@ -30,12 +30,12 @@
"prepublishOnly": "npm run build" "prepublishOnly": "npm run build"
}, },
"devDependencies": { "devDependencies": {
"@jest/globals": "^30.0.0-alpha.3", "@jest/globals": "^30.0.0-alpha.4",
"@types/audioworklet": "^0.0.55", "@types/audioworklet": "^0.0.55",
"@yume-chan/eslint-config": "workspace:^1.0.0", "@yume-chan/eslint-config": "workspace:^1.0.0",
"@yume-chan/tsconfig": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"jest": "^30.0.0-alpha.3", "jest": "^30.0.0-alpha.4",
"prettier": "^3.2.5", "prettier": "^3.2.5",
"ts-jest": "^29.1.2", "ts-jest": "^29.1.2",
"typescript": "^5.4.5" "typescript": "^5.4.5"

View file

@ -43,11 +43,11 @@
"yuv-canvas": "^1.2.11" "yuv-canvas": "^1.2.11"
}, },
"devDependencies": { "devDependencies": {
"@jest/globals": "^30.0.0-alpha.3", "@jest/globals": "^30.0.0-alpha.4",
"@yume-chan/eslint-config": "workspace:^1.0.0", "@yume-chan/eslint-config": "workspace:^1.0.0",
"@yume-chan/tsconfig": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"jest": "^30.0.0-alpha.3", "jest": "^30.0.0-alpha.4",
"prettier": "^3.2.5", "prettier": "^3.2.5",
"ts-jest": "^29.1.2", "ts-jest": "^29.1.2",
"typescript": "^5.4.5" "typescript": "^5.4.5"

View file

@ -40,11 +40,11 @@
"@yume-chan/stream-extra": "workspace:^0.0.23" "@yume-chan/stream-extra": "workspace:^0.0.23"
}, },
"devDependencies": { "devDependencies": {
"@jest/globals": "^30.0.0-alpha.3", "@jest/globals": "^30.0.0-alpha.4",
"@yume-chan/eslint-config": "workspace:^1.0.0", "@yume-chan/eslint-config": "workspace:^1.0.0",
"@yume-chan/tsconfig": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"jest": "^30.0.0-alpha.3", "jest": "^30.0.0-alpha.4",
"prettier": "^3.2.5", "prettier": "^3.2.5",
"ts-jest": "^29.1.2", "ts-jest": "^29.1.2",
"typescript": "^5.4.5" "typescript": "^5.4.5"

View file

@ -1,21 +1,21 @@
import { EventEmitter } from "@yume-chan/event"; import { EventEmitter } from "@yume-chan/event";
import { getUint32LittleEndian } from "@yume-chan/no-data-view"; import { getUint32LittleEndian } from "@yume-chan/no-data-view";
import type {
ScrcpyMediaStreamDataPacket,
ScrcpyMediaStreamPacket,
} from "@yume-chan/scrcpy";
import { import {
Av1, Av1,
ScrcpyVideoCodecId, ScrcpyVideoCodecId,
h264ParseConfiguration, h264ParseConfiguration,
h265ParseConfiguration, h265ParseConfiguration,
type ScrcpyMediaStreamDataPacket,
type ScrcpyMediaStreamPacket,
} from "@yume-chan/scrcpy"; } from "@yume-chan/scrcpy";
import type { import type {
ScrcpyVideoDecoder, ScrcpyVideoDecoder,
ScrcpyVideoDecoderCapability, ScrcpyVideoDecoderCapability,
} from "@yume-chan/scrcpy-decoder-tinyh264"; } from "@yume-chan/scrcpy-decoder-tinyh264";
import { import type { WritableStreamDefaultController } from "@yume-chan/stream-extra";
WritableStream, import { WritableStream } from "@yume-chan/stream-extra";
type WritableStreamDefaultController,
} from "@yume-chan/stream-extra";
import { BitmapFrameRenderer } from "./bitmap.js"; import { BitmapFrameRenderer } from "./bitmap.js";
import type { FrameRenderer } from "./renderer.js"; import type { FrameRenderer } from "./renderer.js";

View file

@ -40,11 +40,11 @@
"tslib": "^2.6.2" "tslib": "^2.6.2"
}, },
"devDependencies": { "devDependencies": {
"@jest/globals": "^30.0.0-alpha.3", "@jest/globals": "^30.0.0-alpha.4",
"@yume-chan/eslint-config": "workspace:^1.0.0", "@yume-chan/eslint-config": "workspace:^1.0.0",
"@yume-chan/tsconfig": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"jest": "^30.0.0-alpha.3", "jest": "^30.0.0-alpha.4",
"prettier": "^3.2.5", "prettier": "^3.2.5",
"ts-jest": "^29.1.2", "ts-jest": "^29.1.2",
"typescript": "^5.4.5" "typescript": "^5.4.5"

View file

@ -1,7 +1,5 @@
import { import type { WritableStreamDefaultWriter } from "@yume-chan/stream-extra";
Consumable, import { Consumable } from "@yume-chan/stream-extra";
type WritableStreamDefaultWriter,
} from "@yume-chan/stream-extra";
import type { ScrcpyOptions } from "../options/index.js"; import type { ScrcpyOptions } from "../options/index.js";

View file

@ -1,10 +1,8 @@
// cspell: ignore autosync // cspell: ignore autosync
import { PromiseResolver } from "@yume-chan/async"; import { PromiseResolver } from "@yume-chan/async";
import Struct, { import type { AsyncExactReadable } from "@yume-chan/struct";
placeholder, import Struct, { placeholder } from "@yume-chan/struct";
type AsyncExactReadable,
} from "@yume-chan/struct";
import type { ScrcpySetClipboardControlMessage } from "../control/index.js"; import type { ScrcpySetClipboardControlMessage } from "../control/index.js";

View file

@ -1,10 +1,13 @@
import type { ReadableStream } from "@yume-chan/stream-extra"; import type { ReadableStream } from "@yume-chan/stream-extra";
import type { ValueOrPromise } from "@yume-chan/struct";
import { ScrcpyOptions1_21 } from "./1_21.js"; import { ScrcpyOptions1_21 } from "./1_21.js";
import { ScrcpyOptions2_0, omit } from "./2_0.js"; import { ScrcpyOptions2_0, omit } from "./2_0.js";
import { ScrcpyOptions2_2, type ScrcpyOptionsInit2_2 } from "./2_2.js"; import type { ScrcpyOptionsInit2_2 } from "./2_2.js";
import { ScrcpyOptions2_2 } from "./2_2.js";
import type { ScrcpyAudioStreamMetadata } from "./codec.js";
import { ScrcpyAudioCodec } from "./codec.js";
import { ScrcpyOptionsBase } from "./types.js"; import { ScrcpyOptionsBase } from "./types.js";
import type { ValueOrPromise } from "@yume-chan/struct";
import { ScrcpyAudioCodec, type ScrcpyAudioStreamMetadata } from "./codec.js";
export interface ScrcpyOptionsInit2_3 export interface ScrcpyOptionsInit2_3
extends Omit<ScrcpyOptionsInit2_2, "audioCodec"> { extends Omit<ScrcpyOptionsInit2_2, "audioCodec"> {

View file

@ -36,11 +36,11 @@
"@yume-chan/struct": "workspace:^0.0.23" "@yume-chan/struct": "workspace:^0.0.23"
}, },
"devDependencies": { "devDependencies": {
"@jest/globals": "^30.0.0-alpha.3", "@jest/globals": "^30.0.0-alpha.4",
"@yume-chan/eslint-config": "workspace:^1.0.0", "@yume-chan/eslint-config": "workspace:^1.0.0",
"@yume-chan/tsconfig": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"jest": "^30.0.0-alpha.3", "jest": "^30.0.0-alpha.4",
"prettier": "^3.2.5", "prettier": "^3.2.5",
"ts-jest": "^29.1.2", "ts-jest": "^29.1.2",
"typescript": "^5.4.5" "typescript": "^5.4.5"

View file

@ -6,10 +6,11 @@ import type {
WritableStreamDefaultWriter, WritableStreamDefaultWriter,
} from "./stream.js"; } from "./stream.js";
import { import {
WritableStream as NativeWritableStream,
ReadableStream as NativeReadableStream, ReadableStream as NativeReadableStream,
WritableStream as NativeWritableStream,
} from "./stream.js"; } from "./stream.js";
import { createTask, type Task } from "./task.js"; import type { Task } from "./task.js";
import { createTask } from "./task.js";
function isPromiseLike(value: unknown): value is PromiseLike<unknown> { function isPromiseLike(value: unknown): value is PromiseLike<unknown> {
return typeof value === "object" && value !== null && "then" in value; return typeof value === "object" && value !== null && "then" in value;

View file

@ -1,9 +1,11 @@
import { Consumable } from "./consumable.js"; import { Consumable } from "./consumable.js";
import type { WritableStreamDefaultController } from "./stream.js"; import type {
QueuingStrategy,
WritableStreamDefaultController,
} from "./stream.js";
import { import {
WritableStream as NativeWritableStream, WritableStream as NativeWritableStream,
TransformStream, TransformStream,
type QueuingStrategy,
} from "./stream.js"; } from "./stream.js";
export type MaybeConsumable<T> = T | Consumable<T>; export type MaybeConsumable<T> = T | Consumable<T>;

View file

@ -37,11 +37,11 @@
"@yume-chan/no-data-view": "workspace:^0.0.23" "@yume-chan/no-data-view": "workspace:^0.0.23"
}, },
"devDependencies": { "devDependencies": {
"@jest/globals": "^30.0.0-alpha.3", "@jest/globals": "^30.0.0-alpha.4",
"@yume-chan/eslint-config": "workspace:^1.0.0", "@yume-chan/eslint-config": "workspace:^1.0.0",
"@yume-chan/tsconfig": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"jest": "^30.0.0-alpha.3", "jest": "^30.0.0-alpha.4",
"prettier": "^3.2.5", "prettier": "^3.2.5",
"ts-jest": "^29.1.2", "ts-jest": "^29.1.2",
"typescript": "^5.4.5" "typescript": "^5.4.5"

View file

@ -4,6 +4,7 @@ import {
setInt64, setInt64,
setUint64, setUint64,
} from "@yume-chan/no-data-view"; } from "@yume-chan/no-data-view";
import type { import type {
AsyncExactReadable, AsyncExactReadable,
ExactReadable, ExactReadable,

View file

@ -15,11 +15,11 @@ import {
EMPTY_UINT8_ARRAY, EMPTY_UINT8_ARRAY,
Uint8ArrayBufferFieldConverter, Uint8ArrayBufferFieldConverter,
} from "./base.js"; } from "./base.js";
import type { VariableLengthBufferLikeFieldOptions } from "./variable-length.js";
import { import {
VariableLengthBufferLikeFieldDefinition, VariableLengthBufferLikeFieldDefinition,
VariableLengthBufferLikeFieldLengthValue, VariableLengthBufferLikeFieldLengthValue,
VariableLengthBufferLikeStructFieldValue, VariableLengthBufferLikeStructFieldValue,
type VariableLengthBufferLikeFieldOptions,
} from "./variable-length.js"; } from "./variable-length.js";
class MockLengthFieldValue extends StructFieldValue<any> { class MockLengthFieldValue extends StructFieldValue<any> {

View file

@ -1,6 +1,7 @@
/// <reference types="node" /> /// <reference types="node" />
import eslint from "@eslint/js"; import eslint from "@eslint/js";
import eslintImportX from "eslint-plugin-import-x";
import { dirname, resolve } from "path"; import { dirname, resolve } from "path";
import tslint from "typescript-eslint"; import tslint from "typescript-eslint";
import { fileURLToPath } from "url"; import { fileURLToPath } from "url";
@ -8,11 +9,25 @@ import { fileURLToPath } from "url";
const root = resolve(dirname(fileURLToPath(import.meta.url)), "..", ".."); const root = resolve(dirname(fileURLToPath(import.meta.url)), "..", "..");
export default tslint.config( export default tslint.config(
eslint.configs.recommended,
...tslint.configs.recommendedTypeChecked,
{ {
ignores: ["**/*.js", "**/*.d.ts"], ignores: ["**/*.js", "**/*.d.ts"],
}, },
eslint.configs.recommended,
{
rules: {
"no-constant-condition": ["error", { checkLoops: false }],
"no-plusplus": "error",
"no-multiple-empty-lines": [
"error",
{
max: 1,
maxEOF: 1,
maxBOF: 0,
},
],
},
},
...tslint.configs.recommendedTypeChecked,
{ {
languageOptions: { languageOptions: {
parserOptions: { parserOptions: {
@ -25,41 +40,6 @@ export default tslint.config(
}, },
}, },
rules: { rules: {
"no-constant-condition": ["error", { checkLoops: false }],
"no-plusplus": "error",
"no-multiple-empty-lines": [
"error",
{
max: 1,
maxEOF: 1,
maxBOF: 0,
},
],
// "import/consistent-type-specifier-style": [
// "error",
// "prefer-top-level",
// ],
// "import/no-cycle": "error",
// "import/no-duplicates": ["error", { "prefer-inline": false }],
// "import/order": [
// "error",
// {
// groups: [
// "builtin",
// "external",
// "internal",
// "parent",
// "sibling",
// "index",
// ],
// "newlines-between": "always",
// alphabetize: {
// order: "asc",
// },
// },
// ],
"@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unsafe-enum-comparison": "off", "@typescript-eslint/no-unsafe-enum-comparison": "off",
"@typescript-eslint/no-namespace": "off", "@typescript-eslint/no-namespace": "off",
@ -69,8 +49,35 @@ export default tslint.config(
"@typescript-eslint/consistent-indexed-object-style": "error", "@typescript-eslint/consistent-indexed-object-style": "error",
"@typescript-eslint/no-this-alias": "error", "@typescript-eslint/no-this-alias": "error",
"@typescript-eslint/consistent-type-imports": "error", "@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-import-type-side-effects": "error", "@typescript-eslint/no-import-type-side-effects": "error",
}, },
}, },
{
plugins: { "import-x": eslintImportX },
rules: {
"import-x/consistent-type-specifier-style": [
"error",
"prefer-top-level",
],
"import-x/no-cycle": "error",
"import-x/no-duplicates": ["error", { "prefer-inline": false }],
"import-x/order": [
"error",
{
groups: [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
],
"newlines-between": "always",
alphabetize: {
order: "asc",
},
},
],
},
},
); );

View file

@ -7,11 +7,12 @@
"run-eslint": "run-eslint.js" "run-eslint": "run-eslint.js"
}, },
"dependencies": { "dependencies": {
"@eslint/js": "^9.2.0", "@eslint/js": "^9.3.0",
"@types/node": "^20.12.8", "@types/node": "^20.12.12",
"eslint": "^9.2.0", "eslint": "^9.3.0",
"eslint-plugin-import-x": "^0.5.0",
"typescript": "^5.4.5", "typescript": "^5.4.5",
"typescript-eslint": "^7.8.0" "typescript-eslint": "^7.9.0"
}, },
"devDependencies": { "devDependencies": {
"prettier": "^3.2.5" "prettier": "^3.2.5"