diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d86cc4682..e03d3b6e0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: npm run build - name: Run lint run: | - npm run lint + npm run lint:ci - name: Run typecheck run: | npm run typecheck diff --git a/eslint.config.js b/eslint.config.js index 6be26120e..d67c9e55f 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -20,6 +20,7 @@ const antfuLint = { } export default tseslint.config( + { ignores: [".*/**", "dist/**", "scripts/**"] }, { files: ["**/*.{js,mjs,ts,mts}"] }, eslint.configs.recommended, ...tseslint.configs.recommendedTypeChecked, @@ -131,10 +132,6 @@ export default tseslint.config( "error", { consistent: true, multiline: true }, ], - "@stylistic/object-curly-newline": [ - "error", - { consistent: true, multiline: true }, - ], // "@stylistic/object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }], // "@stylistic/object-property-newline": "error", "@stylistic/one-var-declaration-per-line": "error", @@ -226,6 +223,7 @@ export default tseslint.config( { rules: { "antfu/consistent-chaining": "error", + "antfu/consistent-list-newline": "error", }, }, diff --git a/package.json b/package.json index af4e67508..f49a4bc92 100644 --- a/package.json +++ b/package.json @@ -27,8 +27,9 @@ "watch": "vite build --watch", "release": "node scripts/release.js", "test": "vitest", - "lint": "eslint src", - "lint:fix": "eslint src --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", + "lint:ci": "eslint src", "format": "prettier --check './src/*.{js,ts,tsx,vue,mts}'", "format:fix": "prettier --write './src/*.{js,ts,tsx,vue,mts}'" }, diff --git a/test/ConfigureGraph.test.ts b/test/ConfigureGraph.test.ts index c2c3e3487..74f39c2fe 100644 --- a/test/ConfigureGraph.test.ts +++ b/test/ConfigureGraph.test.ts @@ -1,5 +1,7 @@ import { describe } from "vitest" + import { LGraph } from "@/litegraph" + import { dirtyTest } from "./testExtensions" describe("LGraph configure()", () => { diff --git a/test/LGraph.test.ts b/test/LGraph.test.ts index a490784c7..dd393f300 100644 --- a/test/LGraph.test.ts +++ b/test/LGraph.test.ts @@ -1,5 +1,7 @@ import { describe } from "vitest" + import { LGraph, LiteGraph } from "@/litegraph" + import { test } from "./testExtensions" describe("LGraph", () => { diff --git a/test/LGraphGroup.test.ts b/test/LGraphGroup.test.ts index d98240b6a..3a1c3202a 100644 --- a/test/LGraphGroup.test.ts +++ b/test/LGraphGroup.test.ts @@ -1,5 +1,7 @@ import { describe, expect } from "vitest" + import { LGraphGroup } from "@/litegraph" + import { test } from "./testExtensions" describe("LGraphGroup", () => { diff --git a/test/LGraphNode.test.ts b/test/LGraphNode.test.ts index ec94aa16b..4c4859372 100644 --- a/test/LGraphNode.test.ts +++ b/test/LGraphNode.test.ts @@ -1,6 +1,8 @@ import { describe, expect } from "vitest" + import { LGraphNode } from "@/litegraph" import { NodeInputSlot, NodeOutputSlot } from "@/NodeSlot" + import { test } from "./testExtensions" describe("LGraphNode", () => { diff --git a/test/LGraph_constructor.test.ts b/test/LGraph_constructor.test.ts index a5195ef8e..f9df1bdc0 100644 --- a/test/LGraph_constructor.test.ts +++ b/test/LGraph_constructor.test.ts @@ -1,5 +1,7 @@ import { describe } from "vitest" + import { LGraph } from "@/litegraph" + import { dirtyTest } from "./testExtensions" describe("LGraph (constructor only)", () => { diff --git a/test/LLink.test.ts b/test/LLink.test.ts index cc0633c5f..120dfe9d8 100644 --- a/test/LLink.test.ts +++ b/test/LLink.test.ts @@ -1,5 +1,7 @@ import { describe, expect } from "vitest" + import { LLink } from "@/litegraph" + import { test } from "./testExtensions" describe("LLink", () => { diff --git a/test/NodeSlot.test.ts b/test/NodeSlot.test.ts index bfdf2e224..b3bbaa56c 100644 --- a/test/NodeSlot.test.ts +++ b/test/NodeSlot.test.ts @@ -1,6 +1,7 @@ -import { describe, it, expect } from "vitest" -import { serializeSlot } from "@/NodeSlot" +import { describe, expect, it } from "vitest" + import { INodeInputSlot, INodeOutputSlot } from "@/interfaces" +import { serializeSlot } from "@/NodeSlot" describe("NodeSlot", () => { describe("serializeSlot", () => { diff --git a/test/litegraph.test.ts b/test/litegraph.test.ts index b5c00a4b9..2f271d288 100644 --- a/test/litegraph.test.ts +++ b/test/litegraph.test.ts @@ -1,6 +1,8 @@ import { describe, expect } from "vitest" + import { clamp, LGraphCanvas, LiteGraph } from "@/litegraph" import { LiteGraphGlobal } from "@/LiteGraphGlobal" + import { test } from "./testExtensions" describe.concurrent("Litegraph module", () => { diff --git a/test/serialise.test.ts b/test/serialise.test.ts index e75845c9b..6c4c9e9ee 100644 --- a/test/serialise.test.ts +++ b/test/serialise.test.ts @@ -1,8 +1,11 @@ -import { describe } from "vitest" -import { LGraph, LGraphGroup, LGraphNode } from "@/litegraph" -import { test } from "./testExtensions" import type { ISerialisedGraph } from "@/types/serialisation" +import { describe } from "vitest" + +import { LGraph, LGraphGroup, LGraphNode } from "@/litegraph" + +import { test } from "./testExtensions" + describe("LGraph Serialisation", () => { test("can (de)serialise node / group titles", ({ expect, minimalGraph }) => { const nodeTitle = "Test Node" diff --git a/test/testExtensions.ts b/test/testExtensions.ts index 2cb6f8371..21784f913 100644 --- a/test/testExtensions.ts +++ b/test/testExtensions.ts @@ -1,9 +1,12 @@ -import { test as baseTest } from "vitest" import type { ISerialisedGraph, SerialisableGraph } from "../src/types/serialisation" + +import { test as baseTest } from "vitest" + import { LGraph } from "@/LGraph" -import { basicSerialisableGraph, minimalSerialisableGraph, oldSchemaGraph } from "./assets/testGraphs" import { LiteGraph } from "@/litegraph" +import { basicSerialisableGraph, minimalSerialisableGraph, oldSchemaGraph } from "./assets/testGraphs" + interface LitegraphFixtures { minimalGraph: LGraph minimalSerialisableGraph: SerialisableGraph diff --git a/test/utils/spaceDistribution.test.ts b/test/utils/spaceDistribution.test.ts index b7b09a6bc..312b63fbf 100644 --- a/test/utils/spaceDistribution.test.ts +++ b/test/utils/spaceDistribution.test.ts @@ -1,5 +1,6 @@ import { describe, expect, it } from "vitest" -import { type SpaceRequest, distributeSpace } from "@/utils/spaceDistribution" + +import { distributeSpace, type SpaceRequest } from "@/utils/spaceDistribution" describe("distributeSpace", () => { it("should distribute space according to minimum sizes when space is limited", () => { diff --git a/vite.config.mts b/vite.config.mts index f031f5a9d..40a3e71c2 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -1,6 +1,6 @@ /// -import { defineConfig } from "vite" import path from "path" +import { defineConfig } from "vite" import dts from "vite-plugin-dts" export default defineConfig({