Synthèse automatique
Ce skill documente l'installation, la configuration et l'utilisation de Biome pour formater, linter et trier les imports dans les projets JavaScript et TypeScript.
Points forts
- Couvre l'installation, un exemple complet de biome.json, les commandes CLI, la migration depuis ESLint/Prettier et l'intégration CI ou pré-commit.
- Explique les changements de configuration de Biome 2.x, notamment les actions d'assist, files.includes et rules.preset.
- Fournit des commandes concrètes pour le formatage, le lint, les corrections sûres ou non sûres et le contrôle des fichiers indexés.
- Rappelle les limites face aux plugins ESLint et la nécessité d'épingler la version de Biome.
Limites
- La section sur la migration depuis ESLint/Prettier est incomplète : le contenu s'arrête au milieu d'une commande.
- La compatibilité avec les plugins ESLint n'est traitée que brièvement, alors qu'elle peut être bloquante pour certains projets.
- Les noms de règles et le schéma de configuration évoluent entre versions, ce qui exige des migrations régulières.
À utiliser lorsqu'on veut adopter Biome, remplacer ESLint et Prettier, configurer biome.json ou intégrer le lint et le formatage dans une CI ou un hook pré-commit.
À éviter si le projet dépend fortement de plugins ESLint spécifiques ou si l'on a besoin d'un guide de migration complet et détaillé.
Analyse de sécurité
SûrPure documentation/instruction content for a well-known open-source developer tool. It contains CLI commands (npm install, npx biome check/migrate) that are non-destructive, local, and explicitly recommends reviewing diffs for unsafe fixes. No credential handling, network exfiltration, obfuscated payloads, sudo/rm -rf, or attempts to override the agent's instructions. No tools are declared, so nothing is auto-executed beyond what a user asks for.
Aucun point d'attention détecté
Comment cette analyse est faiteExemples
Set up Biome in this TypeScript project, create a biome.json, and replace our ESLint and Prettier scripts with Biome lint and format commands.Migrate our existing .prettierrc and .prettierignore to Biome, then update the config for Biome 2.x import sorting and recommended rules.Add `biome ci` to our GitHub Actions workflow and configure a pre-commit hook that runs `biome check --staged`.name: biome description: >- Biome is a single Rust-based tool that formats code and lints JavaScript, TypeScript, JSX, JSON and CSS, and sorts imports, as a faster replacement for ESLint plus Prettier. Use when a user wants to set up biome.json, replace ESLint or Prettier, migrate their configs, run lint and format in CI or pre-commit, or configure the VS Code extension. license: Apache-2.0 compatibility: 'Node.js 14.21+ with npm, pnpm or yarn; standalone binaries also exist (Biome 2.x)' metadata: author: terminal-skills version: 1.1.0 category: development repository: https://github.com/biomejs/biome tags: "linter, formatter, rust, eslint-alternative, prettier-alternative"
Biome — Fast Linter and Formatter (ESLint + Prettier Replacement)
Overview
Biome (@biomejs/biome, current major version 2.x) formats, lints and organizes imports in one native binary with one config file, biome.json (or biome.jsonc). It covers JavaScript, TypeScript, JSX/TSX, JSON, CSS and more, and it is much faster than ESLint plus Prettier on large repositories. It does not run ESLint plugins, so projects that depend on plugin-specific rules may keep ESLint for those. Version 2 changed the config: import sorting is an "assist" action, files.ignore became files.includes, and rules.recommended became rules.preset.
Instructions
Install and initialize
npm install --save-dev --save-exact @biomejs/biome
npx biome init # writes biome.json with the schema URL of the installed version
Pin the exact version: formatting and lint results can change between releases. After upgrading, run npx biome migrate --write to update the config to the new schema.
Configuration
{
"$schema": "https://biomejs.dev/schemas/2.6.3/schema.json",
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
"files": { "includes": ["src/**", "!**/*.gen.ts"] },
"assist": { "actions": { "source": { "organizeImports": "on" } } },
"linter": {
"enabled": true,
"rules": {
"preset": "recommended",
"complexity": { "noForEach": "warn" },
"correctness": {
"noUnusedVariables": "error",
"noUnusedImports": "error",
"useExhaustiveDependencies": "warn"
},
"suspicious": { "noExplicitAny": "warn", "noConsole": "warn" },
"style": { "noNonNullAssertion": "warn", "useConst": "error" }
}
},
"formatter": { "indentStyle": "space", "indentWidth": 2, "lineWidth": 100, "lineEnding": "lf" },
"javascript": {
"formatter": { "quoteStyle": "single", "semicolons": "asNeeded", "trailingCommas": "all", "arrowParentheses": "always" }
}
}
Set $schema to the installed version (npx biome --version). files.includes takes globs, and a leading ! excludes a path; with vcs.useIgnoreFile Biome also skips files listed in .gitignore. Rule severities are "off", "info", "warn" and "error". Rule names change between versions; npx biome explain <ruleName> prints the docs for one, and an unknown name makes biome check fail with a list of valid keys.
Commands
npx biome format --write . # format only
npx biome lint . # lint only
npx biome check --write . # format + lint safe fixes + organize imports
npx biome check --write --unsafe . # also apply fixes that may change behavior; review the diff
npx biome ci . # CI: same checks, never writes, non-zero exit on problems
npx biome check --staged # only staged files (pre-commit)
npx biome check --changed --since=origin/main # only files changed against a branch
--fix is an alias of --write. Diagnostics print as file:line:col lint/<group>/<rule>; a rule can be silenced on the next line with // biome-ignore lint/suspicious/noConsole: reason (a reason is required).
Migrating from ESLint and Prettier
npx biome migrate prettier --write # imports .prettierrc and .prettierignore
npx biome migrate eslint --write # imports rules from the ESLint config
npx biome check .
migrate eslint maps rules that have a Biome equivalent and skips the rest, including plugin rules, so read what it printed. In a run against an empty biome.json it also set linter.rules.preset to "none"; set it back to "recommended" if you want Biome's default rule set. Afterwards remove eslint, prettier and their configs and plugins from package.json.
Editor
{
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.biome": "explicit",
"source.organizeImports.biome": "explicit"
}
}
Put this in .vscode/settings.json and install the biomejs.biome extension. The extension uses the Biome version in the project's node_modules.
Examples
Request: "Replace ESLint and Prettier in this React project with Biome."
Run npm install -D -E @biomejs/biome, npx biome init, npx biome migrate eslint --write and npx biome migrate prettier --write, then npx biome check --write .. Replace the lint script with "lint": "biome check ." and the CI step with npx biome ci .. The first check prints each remaining diagnostic with its rule name and location.
Request: "Only check the files I'm about to commit."
Add "pre-commit": "biome check --write --staged" to a husky or lefthook hook (or run npx biome check --staged in lint-staged). Staged files that fail unfixable rules abort the commit with the diagnostics.
Guidelines
- Use
biome ciin CI andbiome check --writelocally; do not run both formatters (Biome and Prettier) on the same files. - Biome's formatter is close to Prettier but not identical; expect a one-time diff after migrating and commit it on its own.
- Safe fixes apply with
--write; unsafe fixes need--unsafeand a diff review. - There is no support for custom ESLint plugins; frameworks with their own rules (Vue templates, Svelte, Astro) have partial coverage, so check the language support page before dropping ESLint there.
- With
vcs.useIgnoreFileenabled Biome stops with an error if the folder has no.gitignore; add one or turn the option off.
Du fichier au premier essai
Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.
Consulter la source et ses fichiers annexesCe téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.
1. Télécharger le fichier
Télécharger SKILL.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/biome-fast-linter-and-formatter-mwirmdv3/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.
Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.
mkdir -p '.skill-downloads/biome-fast-linter-and-formatter-mwirmdv3' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/biome-fast-linter-and-formatter-mwirmdv3/download' --output '.skill-downloads/biome-fast-linter-and-formatter-mwirmdv3/SKILL.md.part' && mv '.skill-downloads/biome-fast-linter-and-formatter-mwirmdv3/SKILL.md.part' '.skill-downloads/biome-fast-linter-and-formatter-mwirmdv3/SKILL.md'2. Vérifier les prérequis
Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.
Environnement déclaré par l’auteur : Node.js 14.21+ with npm, pnpm or yarn; standalone binaries also exist (Biome 2.x)
Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.
Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.
3. Charger la skill
Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.
Claude Code
test -f '.skill-downloads/biome-fast-linter-and-formatter-mwirmdv3/SKILL.md' && test -s '.skill-downloads/biome-fast-linter-and-formatter-mwirmdv3/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/biome' && cp -R '.skill-downloads/biome-fast-linter-and-formatter-mwirmdv3' '.claude/skills/biome'Cursor
test -f '.skill-downloads/biome-fast-linter-and-formatter-mwirmdv3/SKILL.md' && test -s '.skill-downloads/biome-fast-linter-and-formatter-mwirmdv3/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/biome' && cp -R '.skill-downloads/biome-fast-linter-and-formatter-mwirmdv3' '.cursor/skills/biome'Codex
test -f '.skill-downloads/biome-fast-linter-and-formatter-mwirmdv3/SKILL.md' && test -s '.skill-downloads/biome-fast-linter-and-formatter-mwirmdv3/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/biome' && cp -R '.skill-downloads/biome-fast-linter-and-formatter-mwirmdv3' '.agents/skills/biome'OpenSkills
OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.
Installation officielle d’OpenSkillsopenskills install './.skill-downloads/biome-fast-linter-and-formatter-mwirmdv3'openskills read 'biome-fast-linter-and-formatter-mwirmdv3'La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.
Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.
openskills syncMode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.
4. Faire un premier essai
Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :
Lis .skill-downloads/biome-fast-linter-and-formatter-mwirmdv3/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.
Bonnes pratiques React Hook Form
Developpement
Maîtrisez React Hook Form : évitez les anti-patterns, gérez les abonnements, et traitez correctement reset, dirty state et entrées contrôlées.
Migration Emotion vers Mantine
Developpement
Migrer les styled-components Emotion vers des composants Mantine avec style props et modules CSS. Pour convertir .styled.tsx ou supprimer les imports @emotion.
Détecteur de dérive de périmètre
Developpement
Analyse les diffs git par rapport à une intention pour détecter la dérive de périmètre, fichiers non liés et PR trop larges, puis suggère de garder, diviser ou justifier.