Added lint rule to enforce importing with extensions (#831)

* fix: added lint rule to enforce importing with extentions

* fix test import path

* added import file extentions
This commit is contained in:
Dan Ditomaso
2025-09-03 17:07:00 -04:00
committed by GitHub
parent d66f10e715
commit d0f4939a4d
9 changed files with 15 additions and 14 deletions

View File

@@ -34,7 +34,8 @@
},
"correctness": {
"noUnusedVariables": "error",
"noUnusedImports": "error"
"noUnusedImports": "error",
"useImportExtensions": "error"
}
}
},

View File

@@ -7,8 +7,8 @@ import {
type MockInstance,
vi,
} from "vitest";
import { runTransportContract } from "../../../tests/utils/transportContract";
import { TransportHTTP } from "./transport";
import { runTransportContract } from "../../../tests/utils/transportContract.ts";
import { TransportHTTP } from "./transport.ts";
let abortTimeoutSpy: MockInstance | undefined;
beforeEach(() => {

View File

@@ -2,8 +2,8 @@ import { Duplex } from "node:stream";
import { Types, Utils } from "@meshtastic/core";
import type { SerialPort } from "serialport";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { runTransportContract } from "../../../tests/utils/transportContract";
import { TransportNodeSerial } from "./transport";
import { runTransportContract } from "../../../tests/utils/transportContract.ts";
import { TransportNodeSerial } from "./transport.ts";
function isStatusEvent(
output: Types.DeviceOutput | undefined,

View File

@@ -2,8 +2,8 @@ import type { Socket } from "node:net";
import { Duplex } from "node:stream";
import { Types, Utils } from "@meshtastic/core";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { runTransportContract } from "../../../tests/utils/transportContract";
import { TransportNode } from "./transport";
import { runTransportContract } from "../../../tests/utils/transportContract.ts";
import { TransportNode } from "./transport.ts";
function isStatusEvent(
out: Types.DeviceOutput | undefined,

View File

@@ -1,6 +1,6 @@
import { describe, expect, vi } from "vitest";
import { runTransportContract } from "../../../tests/utils/transportContract";
import { TransportWebBluetooth } from "./transport";
import { runTransportContract } from "../../../tests/utils/transportContract.ts";
import { TransportWebBluetooth } from "./transport.ts";
class MiniEmitter {
private listeners = new Map<string, Set<(e: Event) => void>>();

View File

@@ -1,7 +1,7 @@
import { Types, Utils } from "@meshtastic/core";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { runTransportContract } from "../../../tests/utils/transportContract";
import { TransportWebSerial } from "./transport";
import { runTransportContract } from "../../../tests/utils/transportContract.ts";
import { TransportWebSerial } from "./transport.ts";
function stubCoreTransforms() {
const toDevice = new TransformStream<Uint8Array, Uint8Array>({

View File

@@ -5,7 +5,7 @@ import { Protobuf, type Types } from "@meshtastic/core";
import { produce } from "immer";
import { create as createStore, type StateCreator } from "zustand";
import { type PersistOptions, persist } from "zustand/middleware";
import type { NodeError, NodeErrorType, ProcessPacketParams } from "./types";
import type { NodeError, NodeErrorType, ProcessPacketParams } from "./types.ts";
const CURRENT_STORE_VERSION = 0;
const NODEDB_RETENTION_NUM = 10;

View File

@@ -16,7 +16,7 @@ vi.mock("idb-keyval", () => ({
// import a fresh copy of the store module (because the store is created at import time)
async function freshStore() {
vi.resetModules();
const mod = await import("../nodeDBStore");
const mod = await import("./index.ts");
return mod;
}

View File

@@ -1,6 +1,6 @@
import * as idb from "idb-keyval";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createStorage } from "./indexDB";
import { createStorage } from "./indexDB.ts";
type PersistStorage<T> = ReturnType<typeof createStorage<T>>;