biomejs / biome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.
https://biomejs.dev
Apache License 2.0
15.3k stars 475 forks source link

🐛 Biome Check not working (in package.json) #1830

Closed hyoretsu closed 8 months ago

hyoretsu commented 8 months ago

Environment information

CLI:
  Version:                      1.5.3
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.11.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "bun/1.0.26"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

Workspace:
  Open Documents:               0

What happened?

The following package.json doesn't get formatted to 1 tab when I run biome check --apply package.json nor in my lint-staged. However it does get formatted when I manually save using VSCode.

{
  "name": "zaimu",
  "private": true,
  "packageManager": "bun@1.0.26",
  "scripts": {
    "build": "next build",
    "dev": "next dev",
    "export": "next export",
    "migrate": "prisma migrate dev --create-only",
    "migrate:dev": "prisma migrate dev",
    "migrate:deploy": "prisma migrate deploy",
    "prepare": "husky",
    "start": "next start"
  },
  "lint-staged": {
    "**/*.(js|jsx|json|ts|tsx)": ["biome check --apply-unsafe"]
  },
  "prisma": {
    "schema": "src/database/schema.prisma"
  },
  "dependencies": {
    "kysely": "^0.27.2",
    "next": "^14.1.0",
    "pg": "^8.11.3",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-icons": "^5.0.1",
    "sass": "^1.70.0"
  },
  "devDependencies": {
    "@biomejs/biome": "^1.5.3",
    "@next/env": "^14.1.0",
    "@svgr/webpack": "^8.1.0",
    "@tsconfig/next": "^2.0.1",
    "@types/node": "^20.11.17",
    "@types/pg": "^8.11.0",
    "@types/react": "^18.2.55",
    "@types/react-dom": "^18.2.19",
    "husky": "^9.0.10",
    "lint-staged": "^15.2.2",
    "prisma": "^5.9.1",
    "prisma-kysely": "^1.8.0",
    "typescript": "^5.3.3"
  }
}

Expected result

It should get formatted automatically with my Githooks (and using commands).

Code of Conduct

ematipico commented 8 months ago

It will work in version v1.6.0 https://github.com/biomejs/biome/pull/1694