Repository: symfony/ux
Pull request #2428 (2024-12-05 13:53:31)

[Meta] Drop format, lint, check-format and check-lint commands, replace them with check and ci commands
| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Issues        | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT


Following https://github.com/symfony/ux/pull/2423#issuecomment-2520352394.

When I've migrated from ESLint and Prettier to Biome.js, I kept commands `yarn lint`, `yarn format` (and `yarn check-`) for historical and simplicity reasons, because it was two separate tools.

_Now_ that we use a single tool, we can use its two dedicated commands:
- [`biome check`](https://biomejs.dev/reference/cli/#biome-check), like `biome format + biome lint + imports sorting`
- [`biome ci`](https://biomejs.dev/reference/cli/#biome-ci), for the CI (it does not write files)

<img width="1116" alt="image" src="https://github.com/user-attachments/assets/ea3481f8-308a-4a8a-a47f-53692c0a3488">


cc @chadyred 

chadyred: Re, you are quicker than me I will make a PR, really coooooll, a little thing about the "--write", it sounds as a low level of details, I found the "--fix" shorter and it is more humanized...but the "--write" is the first accepted option and "--fix" is an alias...(My :brain: swims too much with cs-fixer, maybe :D)
Kocal: > A little thing about the "--write", it sounds as a low level of details, I found the "--fix" shorter and it is more humanized...but the "--write" is the first accepted option and "--fix" is an alias...(My 🧠 swims too much with cs-fixer, maybe :D)

I understand your point, but I believe it can be the same scenario with `--apply` alias which was... deprecated some versions ago (I was not really happy to open https://github.com/Kocal/BiomeJsBundle/pull/9 because of https://github.com/biomejs/biome/blob/main/CHANGELOG.md#180-2024-06-04, only one month after creating the bundle 😅)

Let's keep `--write`

Patch:
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 3a301907..1cfe2f9e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -81,14 +81,14 @@ To help you with assets, you can run the following commands in a specific packag
   - `yarn run build`: build (compile) assets from the package,
   - `yarn run watch`: watch for modifications and rebuild assets from the package,
   - `yarn run test`: run the tests from the package,
-  - `yarn run lint`: lint assets from the package,
-  - `yarn run format`: format assets from the package.
+  - `yarn run check`: run the formatter, linter, and sort imports, and fails if any modifications 
+  - `yarn run check --write`: run the formatter, linter, imports sorting, and write modifications 
 
 Thanks to [Yarn Workspaces](https://yarnpkg.com/features/workspaces), you can also run these commands from the root directory of the project:
   - `yarn run build`: build (compile) assets from **all** packages,
   - `yarn run test`: run the tests from **all** packages,
-  - `yarn run lint`: lint assets from **all** packages,
-  - `yarn run format`: format assets from **all** packages,
+  - `yarn run check`: run the formatter, linter, and sort imports for **all** packages, and fails if any modifications
+  - `yarn run check --write`: run the formatter, linter, imports sorting for **all** packages, and write modifications
 
 ## Useful Git commands
 
diff --git a/package.json b/package.json
index 0952bdd9..e48cff66 100644
--- a/package.json
+++ b/package.json
@@ -8,10 +8,8 @@
     "scripts": {
         "build": "yarn workspaces foreach -Apt run build",
         "test": "yarn workspaces foreach -Apt run test",
-        "lint": "biome lint --write",
-        "format": "biome format --write",
-        "check-lint": "biome lint",
-        "check-format": "biome format"
+        "check": "biome check",
+        "ci": "biome ci"
     },
     "devDependencies": {
         "@babel/core": "^7.25.2",
diff --git a/src/Autocomplete/assets/package.json b/src/Autocomplete/assets/package.json
index a7a238c5..2e992455 100644
--- a/src/Autocomplete/assets/package.json
+++ b/src/Autocomplete/assets/package.json
@@ -9,10 +9,8 @@
         "build": "node ../../../bin/build_package.js .",
         "watch": "node ../../../bin/build_package.js . --watch",
         "test": "../../../bin/test_package.sh .",
-        "lint": "biome lint --write",
-        "format": "biome format --write",
-        "check-lint": "biome lint",
-        "check-format": "biome format"
+        "check": "biome check",
+        "ci": "biome ci"
     },
     "symfony": {
         "controllers": {
diff --git a/src/Chartjs/assets/package.json b/src/Chartjs/assets/package.json
index bfbab3f8..82960890 100644
--- a/src/Chartjs/assets/package.json
+++ b/src/Chartjs/assets/package.json
@@ -10,10 +10,8 @@
         "build": "node ../../../bin/build_package.js .",
         "watch": "node ../../../bin/build_package.js . --watch",
         "test": "../../../bin/test_package.sh .",
-        "lint": "biome lint --write",
-        "format": "biome format --write",
-        "check-lint": "biome lint",
-        "check-format": "biome format"
+        "check": "biome check",
+        "ci": "biome ci"
     },
     "symfony": {
         "controllers": {
diff --git a/src/Cropperjs/assets/package.json b/src/Cropperjs/assets/package.json
index ee4b4e29..34b6421f 100644
--- a/src/Cropperjs/assets/package.json
+++ b/src/Cropperjs/assets/package.json
@@ -12,10 +12,8 @@
         "build": "node ../../../bin/build_package.js .",
         "watch": "node ../../../bin/build_package.js . --watch",
         "test": "../../../bin/test_package.sh .",
-        "lint": "biome lint --write",
-        "format": "biome format --write",
-        "check-lint": "biome lint",
-        "check-format": "biome format"
+        "check": "biome check",
+        "ci": "biome ci"
     },
     "symfony": {
         "controllers": {
diff --git a/src/Dropzone/assets/package.json b/src/Dropzone/assets/package.json
index 03c23dca..2c157d75 100644
--- a/src/Dropzone/assets/package.json
+++ b/src/Dropzone/assets/package.json
@@ -12,10 +12,8 @@
         "build": "node ../../../bin/build_package.js .",
         "watch": "node ../../../bin/build_package.js . --watch",
         "test": "../../../bin/test_package.sh .",
-        "lint": "biome lint --write",
-        "format": "biome format --write",
-        "check-lint": "biome lint",
-        "check-format": "biome format"
+        "check": "biome check",
+        "ci": "biome ci"
     },
     "symfony": {
         "controllers": {
diff --git a/src/LazyImage/assets/package.json b/src/LazyImage/assets/package.json
index 7f2c8d85..019448d1 100644
--- a/src/LazyImage/assets/package.json
+++ b/src/LazyImage/assets/package.json
@@ -9,10 +9,8 @@
         "build": "node ../../../bin/build_package.js .",
         "watch": "node ../../../bin/build_package.js . --watch",
         "test": "../../../bin/test_package.sh .",
-        "lint": "biome lint --write",
-        "format": "biome format --write",
-        "check-lint": "biome lint",
-        "check-format": "biome format"
+        "check": "biome check",
+        "ci": "biome ci"
     },
     "symfony": {
         "controllers": {
diff --git a/src/LiveComponent/assets/package.json b/src/LiveComponent/assets/package.json
index 8e5ece78..166d566e 100644
--- a/src/LiveComponent/assets/package.json
+++ b/src/LiveComponent/assets/package.json
@@ -12,10 +12,8 @@
         "build": "node ../../../bin/build_package.js .",
         "watch": "node ../../../bin/build_package.js . --watch",
         "test": "../../../bin/test_package.sh .",
-        "lint": "biome lint --write",
-        "format": "biome format --write",
-        "check-lint": "biome lint",
-        "check-format": "biome format"
+        "check": "biome check",
+        "ci": "biome ci"
     },
     "symfony": {
         "controllers": {
diff --git a/src/Map/assets/package.json b/src/Map/assets/package.json
index 69ebc71b..fd06d0b8 100644
--- a/src/Map/assets/package.json
+++ b/src/Map/assets/package.json
@@ -10,10 +10,8 @@
         "build": "node ../../../bin/build_package.js .",
         "watch": "node ../../../bin/build_package.js . --watch",
         "test": "../../../bin/test_package.sh .",
-        "lint": "biome lint --write",
-        "format": "biome format --write",
-        "check-lint": "biome lint",
-        "check-format": "biome format"
+        "check": "biome check",
+        "ci": "biome ci"
     },
     "symfony": {
         "importmap": {
diff --git a/src/Map/src/Bridge/Google/assets/package.json b/src/Map/src/Bridge/Google/assets/package.json
index 17322cf9..300a21fd 100644
--- a/src/Map/src/Bridge/Google/assets/package.json
+++ b/src/Map/src/Bridge/Google/assets/package.json
@@ -10,10 +10,8 @@
         "build": "node ../../../../../../bin/build_package.js .",
         "watch": "node ../../../../../../bin/build_package.js . --watch",
         "test": "../../../../../../bin/test_package.sh .",
-        "lint": "biome lint --write",
-        "format": "biome format --write",
-        "check-lint": "biome lint",
-        "check-format": "biome format"
+        "check": "biome check",
+        "ci": "biome ci"
     },
     "symfony": {
         "controllers": {
diff --git a/src/Map/src/Bridge/Leaflet/assets/package.json b/src/Map/src/Bridge/Leaflet/assets/package.json
index 1ac16b1d..8145f0fb 100644
--- a/src/Map/src/Bridge/Leaflet/assets/package.json
+++ b/src/Map/src/Bridge/Leaflet/assets/package.json
@@ -10,10 +10,8 @@
         "build": "node ../../../../../../bin/build_package.js .",
         "watch": "node ../../../../../../bin/build_package.js . --watch",
         "test": "../../../../../../bin/test_package.sh .",
-        "lint": "biome lint --write",
-        "format": "biome format --write",
-        "check-lint": "biome lint",
-        "check-format": "biome format"
+        "check": "biome check",
+        "ci": "biome ci"
     },
     "symfony": {
         "controllers": {
diff --git a/src/Notify/assets/package.json b/src/Notify/assets/package.json
index 37c98d79..9eeaff57 100644
--- a/src/Notify/assets/package.json
+++ b/src/Notify/assets/package.json
@@ -9,10 +9,8 @@
         "build": "node ../../../bin/build_package.js .",
         "watch": "node ../../../bin/build_package.js . --watch",
         "test": "../../../bin/test_package.sh .",
-        "lint": "biome lint --write",
-        "format": "biome format --write",
-        "check-lint": "biome lint",
-        "check-format": "biome format"
+        "check": "biome check",
+        "ci": "biome ci"
     },
     "symfony": {
         "controllers": {
diff --git a/src/React/assets/package.json b/src/React/assets/package.json
index 8f1b3d50..c6964a52 100644
--- a/src/React/assets/package.json
+++ b/src/React/assets/package.json
@@ -9,10 +9,8 @@
         "build": "node ../../../bin/build_package.js .",
         "watch": "node ../../../bin/build_package.js . --watch",
         "test": "../../../bin/test_package.sh .",
-        "lint": "biome lint --write",
-        "format": "biome format --write",
-        "check-lint": "biome lint",
-        "check-format": "biome format"
+        "check": "biome check",
+        "ci": "biome ci"
     },
     "symfony": {
         "controllers": {
diff --git a/src/StimulusBundle/assets/package.json b/src/StimulusBundle/assets/package.json
index 4d0d2b40..426a2492 100644
--- a/src/StimulusBundle/assets/package.json
+++ b/src/StimulusBundle/assets/package.json
@@ -8,10 +8,8 @@
         "build": "node ../../../bin/build_package.js .",
         "watch": "node ../../../bin/build_package.js . --watch",
         "test": "../../../bin/test_package.sh .",
-        "lint": "biome lint --write",
-        "format": "biome format --write",
-        "check-lint": "biome lint",
-        "check-format": "biome format"
+        "check": "biome check",
+        "ci": "biome ci"
     },
     "symfony": {
         "needsPackageAsADependency": false,
diff --git a/src/Svelte/assets/package.json b/src/Svelte/assets/package.json
index 7b80877f..38ab7b75 100644
--- a/src/Svelte/assets/package.json
+++ b/src/Svelte/assets/package.json
@@ -8,10 +8,8 @@
         "build": "node ../../../bin/build_package.js .",
         "watch": "node ../../../bin/build_package.js . --watch",
         "test": "../../../bin/test_package.sh .",
-        "lint": "biome lint --write",
-        "format": "biome format --write",
-        "check-lint": "biome lint",
-        "check-format": "biome format"
+        "check": "biome check",
+        "ci": "biome ci"
     },
     "symfony": {
         "controllers": {
diff --git a/src/Swup/assets/package.json b/src/Swup/assets/package.json
index 1cabd23f..42c86d05 100644
--- a/src/Swup/assets/package.json
+++ b/src/Swup/assets/package.json
@@ -9,10 +9,8 @@
         "build": "node ../../../bin/build_package.js .",
         "watch": "node ../../../bin/build_package.js . --watch",
         "test": "../../../bin/test_package.sh .",
-        "lint": "biome lint --write",
-        "format": "biome format --write",
-        "check-lint": "biome lint",
-        "check-format": "biome format"
+        "check": "biome check",
+        "ci": "biome ci"
     },
     "symfony": {
         "controllers": {
diff --git a/src/TogglePassword/assets/package.json b/src/TogglePassword/assets/package.json
index 2e27fec2..86a39696 100644
--- a/src/TogglePassword/assets/package.json
+++ b/src/TogglePassword/assets/package.json
@@ -12,10 +12,8 @@
         "build": "node ../../../bin/build_package.js .",
         "watch": "node ../../../bin/build_package.js . --watch",
         "test": "../../../bin/test_package.sh .",
-        "lint": "biome lint --write",
-        "format": "biome format --write",
-        "check-lint": "biome lint",
-        "check-format": "biome format"
+        "check": "biome check",
+        "ci": "biome ci"
     },
     "symfony": {
         "controllers": {
diff --git a/src/Translator/assets/package.json b/src/Translator/assets/package.json
index 6fd84918..8fa31558 100644
--- a/src/Translator/assets/package.json
+++ b/src/Translator/assets/package.json
@@ -9,10 +9,8 @@
         "build": "node ../../../bin/build_package.js .",
         "watch": "node ../../../bin/build_package.js . --watch",
         "test": "../../../bin/test_package.sh .",
-        "lint": "biome lint --write",
-        "format": "biome format --write",
-        "check-lint": "biome lint",
-        "check-format": "biome format"
+        "check": "biome check",
+        "ci": "biome ci"
     },
     "symfony": {
         "importmap": {
diff --git a/src/Turbo/assets/package.json b/src/Turbo/assets/package.json
index bf086784..931be09d 100644
--- a/src/Turbo/assets/package.json
+++ b/src/Turbo/assets/package.json
@@ -10,10 +10,8 @@
         "build": "node ../../../bin/build_package.js .",
         "watch": "node ../../../bin/build_package.js . --watch",
         "test": "../../../bin/test_package.sh .",
-        "lint": "biome lint --write",
-        "format": "biome format --write",
-        "check-lint": "biome lint",
-        "check-format": "biome format"
+        "check": "biome check",
+        "ci": "biome ci"
     },
     "symfony": {
         "controllers": {
diff --git a/src/Typed/assets/package.json b/src/Typed/assets/package.json
index d146fb63..e63ba5aa 100644
--- a/src/Typed/assets/package.json
+++ b/src/Typed/assets/package.json
@@ -9,10 +9,8 @@
         "build": "node ../../../bin/build_package.js .",
         "watch": "node ../../../bin/build_package.js . --watch",
         "test": "../../../bin/test_package.sh .",
-        "lint": "biome lint --write",
-        "format": "biome format --write",
-        "check-lint": "biome lint",
-        "check-format": "biome format"
+        "check": "biome check",
+        "ci": "biome ci"
     },
     "symfony": {
         "controllers": {
diff --git a/src/Vue/assets/package.json b/src/Vue/assets/package.json
index 9b20a09f..a3b046ac 100644
--- a/src/Vue/assets/package.json
+++ b/src/Vue/assets/package.json
@@ -9,10 +9,8 @@
         "build": "node ../../../bin/build_package.js .",
         "watch": "node ../../../bin/build_package.js . --watch",
         "test": "../../../bin/test_package.sh .",
-        "lint": "biome lint --write",
-        "format": "biome format --write",
-        "check-lint": "biome lint",
-        "check-format": "biome format"
+        "check": "biome check",
+        "ci": "biome ci"
     },
     "symfony": {
         "controllers": {


Test patch:
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index ae6a7495..24dd1d62 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -28,8 +28,7 @@ jobs:
                   restore-keys: |
                       ${{ runner.os }}-yarn-
             - run: yarn --immutable
-            - run: yarn check-lint
-            - run: yarn check-format
+            - run: yarn ci
 
     js-dist-current:
         name: Check for UnBuilt JS Dist Files