From 0c83865ea95115a105bfa4a67e9e299b25ab13c5 Mon Sep 17 00:00:00 2001 From: Romuald Brillout Date: Sat, 30 Mar 2024 22:03:25 +0100 Subject: [PATCH] use biome --- biome.json | 25 ++++++++++++++ package.json | 6 +++- pnpm-lock.yaml | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 biome.json diff --git a/biome.json b/biome.json new file mode 100644 index 00000000..2067bef8 --- /dev/null +++ b/biome.json @@ -0,0 +1,25 @@ +{ + "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", + "files": { + "ignore": ["dist/", "package.json"] + }, + "formatter": { + "indentWidth": 2, + "indentStyle": "space" + }, + "javascript": { + "formatter": { + "semicolons": "asNeeded", + "lineWidth": 120, + "quoteStyle": "single", + "trailingComma": "none" + } + }, + "linter": { + "enabled": false + }, + "vcs": { + "enabled": true, + "clientKind": "git" + } +} diff --git a/package.json b/package.json index 683b76c2..4965a6f9 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,10 @@ "clean": "git clean -Xdf", "reset": "pnpm run clean && pnpm install && pnpm run build", "========= Formatting": "", - "prettier": "git ls-files | egrep '\\.(json|js|jsx|css|ts|tsx|vue|mjs|cjs)$' | grep --invert-match package.json | xargs pnpm exec prettier --write", + "format": "pnpm run format:biome", + "format:prettier": "git ls-files | egrep '\\.(json|js|jsx|css|ts|tsx|vue|mjs|cjs)$' | grep --invert-match package.json | xargs pnpm exec prettier --write", + "format:biome": "biome format --write .", + "format:check": "biome format . || (echo 'Fix formatting by running `$ pnpm run -w format`.' && exit 1)", "========= Only allow pnpm; forbid yarn & npm": "", "preinstall": "npx only-allow pnpm" }, @@ -25,6 +28,7 @@ }, "packageManager": "pnpm@8.6.12", "devDependencies": { + "@biomejs/biome": "^1.5.3", "prettier": "^3.2.5" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 18ef0df0..255e0b01 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,6 +12,9 @@ importers: .: devDependencies: + '@biomejs/biome': + specifier: ^1.5.3 + version: 1.6.3 prettier: specifier: ^3.2.5 version: 3.2.5 @@ -488,6 +491,94 @@ packages: to-fast-properties: 2.0.0 dev: false + /@biomejs/biome@1.6.3: + resolution: {integrity: sha512-Xnp/TIpIcTnRA4LwerJuoGYQJEqwXtn5AL0U0OPXll/QGbAKmcUAfizU880xTwZRD4f53iceqODLDaD3wxYlIw==} + engines: {node: '>=14.*'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@biomejs/cli-darwin-arm64': 1.6.3 + '@biomejs/cli-darwin-x64': 1.6.3 + '@biomejs/cli-linux-arm64': 1.6.3 + '@biomejs/cli-linux-arm64-musl': 1.6.3 + '@biomejs/cli-linux-x64': 1.6.3 + '@biomejs/cli-linux-x64-musl': 1.6.3 + '@biomejs/cli-win32-arm64': 1.6.3 + '@biomejs/cli-win32-x64': 1.6.3 + dev: true + + /@biomejs/cli-darwin-arm64@1.6.3: + resolution: {integrity: sha512-0E8PGu3/8HSkBJdtjno+niJE1ANS/12D7sPK65vw5lTBYmmaYwJdfclDp6XO0IAX7uVd3/YtXlsEua0SVrNt3Q==} + engines: {node: '>=14.*'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-darwin-x64@1.6.3: + resolution: {integrity: sha512-UWu0We/aIRtWXgJKe6ygWt2xR0yXs64BwWqtZbfxBojRn3jgW8UdFAkV5yiUOX3TQlsV6BZH1EQaUAVsccUeeA==} + engines: {node: '>=14.*'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-arm64-musl@1.6.3: + resolution: {integrity: sha512-AntGCSfLN1nPcQj4VOk3X2JgnDw07DaPC8BuBmRcsRmn+7GPSWLllVN5awIKlRPZEbGJtSnLkTiDc5Bxw8OiuA==} + engines: {node: '>=14.*'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-arm64@1.6.3: + resolution: {integrity: sha512-wFVkQw38kOssfnkbpSh6ums5TaElw3RAt5i/VZwHmgR2nQgE0fHXLO7HwIE9VBkOEdbiIFq+2PxvFIHuJF3z3Q==} + engines: {node: '>=14.*'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-x64-musl@1.6.3: + resolution: {integrity: sha512-GelAvGsUwbxfFpKLG+7+dvDmbrfkGqn08sL8CMQrGnhjE1krAqHWiXQsjfmi0UMFdMsk7hbc4oSAP+1+mrXcHQ==} + engines: {node: '>=14.*'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-x64@1.6.3: + resolution: {integrity: sha512-vyn8TQaTZg617hjqFitwGmb1St5XXvq6I3vmxU/QFalM74BryMSvYCrYWb2Yw/TkykdEwZTMGYp+SWHRb04fTg==} + engines: {node: '>=14.*'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-win32-arm64@1.6.3: + resolution: {integrity: sha512-Gx8N2Tixke6pAI1BniteCVZgUUmaFEDYosdWxoaCus15BZI/7RcBxhsRM0ZL/lC66StSQ8vHl8JBrrld1k570Q==} + engines: {node: '>=14.*'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-win32-x64@1.6.3: + resolution: {integrity: sha512-meungPJw64SqoR7LXY1wG7GC4+4wgpyThdFUMGXa6PCe0BLFOIOcZ9VMj9PstuczMPdgmt/BUMPsj25dK1VO8A==} + engines: {node: '>=14.*'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@brillout/import@0.2.3: resolution: {integrity: sha512-1T8WlD75eeFSMrptGy8jiLHmfHgMmSjWvLOIUvHmSVZt+6k0eQqYUoK4KbmE4T9pVLIfxvZSOm2D68VEqKRHRw==}