From 86125440193cfc601807642bc2106734e5559f9f Mon Sep 17 00:00:00 2001 From: Lucas Alves Costa <50385918+luckasnix@users.noreply.github.com> Date: Wed, 25 Dec 2024 11:03:14 -0300 Subject: [PATCH] chore: organize imports with Biome (#64) --- .github/workflows/standard.yml | 6 ++---- .vscode/settings.json | 3 +++ biome.json | 2 +- package.json | 6 ++++-- tests/object-graph.test.ts | 7 +++---- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/standard.yml b/.github/workflows/standard.yml index e47ac62..2659a8b 100644 --- a/.github/workflows/standard.yml +++ b/.github/workflows/standard.yml @@ -24,10 +24,8 @@ jobs: run: npm ci - name: Check types run: npm run type:check - - name: Check format - run: npm run format:check - - name: Check lint - run: npm run lint:check + - name: Check format, lint and imports + run: npm run check - name: Test run: npm run test - name: Build diff --git a/.vscode/settings.json b/.vscode/settings.json index 02f9e4d..3c300d5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,6 +3,9 @@ "[json][typescript]": { "editor.defaultFormatter": "biomejs.biome" }, + "editor.codeActionsOnSave": { + "source.organizeImports.biome": "explicit" + }, "files.associations": { ".releaserc": "json", "LICENSE": "plaintext" diff --git a/biome.json b/biome.json index 915d766..7d1ed26 100644 --- a/biome.json +++ b/biome.json @@ -4,7 +4,7 @@ "ignore": [".husky/**", "dist/**", "node_modules/**"] }, "organizeImports": { - "enabled": false + "enabled": true }, "linter": { "enabled": true, diff --git a/package.json b/package.json index e624d7e..07d3da3 100644 --- a/package.json +++ b/package.json @@ -32,9 +32,11 @@ "test": "vitest", "test:watch": "vitest watch", "type:check": "tsc -p ./tsconfig.json --noEmit", - "format:check": "biome format .", + "check": "biome check .", + "check:write": "biome check --write .", + "format": "biome format --write .", "format:write": "biome format --write .", - "lint:check": "biome lint .", + "lint": "biome lint .", "lint:write": "biome lint --write .", "prepare": "husky" }, diff --git a/tests/object-graph.test.ts b/tests/object-graph.test.ts index 7dddf3f..73d073b 100644 --- a/tests/object-graph.test.ts +++ b/tests/object-graph.test.ts @@ -1,13 +1,12 @@ import { describe, expect, expectTypeOf, test, vi } from "vitest"; - -import { ObjectGraph } from "../src/object-graph"; import { type Color, - type Size, type Shirt, - shirtsMock, + type Size, extraShirtsMock, + shirtsMock, } from "../mocks/object-graph.mock"; +import { ObjectGraph } from "../src/object-graph"; describe("length", () => { test("gets the length of the object graph", () => {