WebUI: enforce sorted imports

Due to `allowSeparatedGroups = true`, the sorting is applied on a group of consecutive imports.
That means a new group of imports can be created by adding a blank line.
This commit is contained in:
Chocobo1
2025-08-25 16:03:44 +08:00
parent 2bd0965906
commit 2be052e9c4
2 changed files with 4 additions and 1 deletions

View File

@@ -3,10 +3,11 @@ import Html from "eslint-plugin-html";
import Js from "@eslint/js"; import Js from "@eslint/js";
import PluginQbtWebUI from "eslint-plugin-qbt-webui"; import PluginQbtWebUI from "eslint-plugin-qbt-webui";
import PreferArrowFunctions from "eslint-plugin-prefer-arrow-functions"; import PreferArrowFunctions from "eslint-plugin-prefer-arrow-functions";
import * as RegexpPlugin from "eslint-plugin-regexp";
import Stylistic from "@stylistic/eslint-plugin"; import Stylistic from "@stylistic/eslint-plugin";
import Unicorn from "eslint-plugin-unicorn"; import Unicorn from "eslint-plugin-unicorn";
import * as RegexpPlugin from "eslint-plugin-regexp";
export default [ export default [
Js.configs.recommended, Js.configs.recommended,
RegexpPlugin.configs["flat/recommended"], RegexpPlugin.configs["flat/recommended"],
@@ -45,6 +46,7 @@ export default [
"prefer-template": "error", "prefer-template": "error",
"radix": "error", "radix": "error",
"require-await": "error", "require-await": "error",
"sort-imports": ["error", { allowSeparatedGroups: true }],
"PluginQbtWebUI/prefix-inc-dec-operators": "error", "PluginQbtWebUI/prefix-inc-dec-operators": "error",
"PreferArrowFunctions/prefer-arrow-functions": "error", "PreferArrowFunctions/prefer-arrow-functions": "error",
"Stylistic/no-extra-semi": "error", "Stylistic/no-extra-semi": "error",

View File

@@ -27,6 +27,7 @@
*/ */
import { expect, test } from "vitest"; import { expect, test } from "vitest";
import "../../private/scripts/misc.js"; import "../../private/scripts/misc.js";
test("Test toFixedPointString()", () => { test("Test toFixedPointString()", () => {