From 157fb8406eba1b60ca5f59ee0251bfd29700c6c5 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Jan 2026 09:14:39 +0000 Subject: [PATCH 1/4] feat: add Biome configuration for formatting and linting Add shareable Biome config that provides: - Formatting rules matching the existing Prettier config - Recommended linting rules (ESLint equivalent) - Import organization support This allows projects to use Biome as a faster alternative to the Prettier + ESLint combination. --- README.md | 39 ++++++++++++++++++++++++++++++- biome.json | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 8 ++++++- 3 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 biome.json diff --git a/README.md b/README.md index 5b8763c..5a3af35 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ I use this config in all my projects. No need to copy/paste anymore 😄 ## Supported tools - [x] Prettier -- [ ] ESLint +- [x] Biome (replaces ESLint + Prettier) - [x] Typescript ## Install @@ -47,6 +47,43 @@ npx prettier -c ./ # Check if there is some files to update npx prettier -w ./ # Update files ``` +### Biome + +[Biome](https://biomejs.dev/) is a fast formatter and linter that can replace both Prettier and ESLint. + +```json5 +// biome.json +{ + "extends": ["@decampsrenan/config/biome"] + // Override with your custom needs here +} +``` + +Or if you need more control on the settings: + +```json5 +// biome.json +{ + "extends": ["@decampsrenan/config/biome"], + "linter": { + "rules": { + "suspicious": { + "noConsoleLog": "off" // Example: disable console.log warnings + } + } + } +} +``` + +Then run the following commands: + +```sh +npx @biomejs/biome check ./ # Check formatting and linting +npx @biomejs/biome check --write ./ # Fix issues automatically +npx @biomejs/biome lint ./ # Lint only +npx @biomejs/biome format ./ # Format only +``` + ### TSConfig ```json5 diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..ebf71a0 --- /dev/null +++ b/biome.json @@ -0,0 +1,65 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "vcs": { + "enabled": true, + "clientKind": "git", + "useIgnoreFile": true + }, + "organizeImports": { + "enabled": true + }, + "formatter": { + "enabled": true, + "formatWithErrors": false, + "indentStyle": "space", + "indentWidth": 2, + "lineWidth": 100, + "lineEnding": "lf", + "attributePosition": "auto" + }, + "javascript": { + "formatter": { + "semicolons": "always", + "quoteStyle": "single", + "jsxQuoteStyle": "double", + "quoteProperties": "asNeeded", + "trailingCommas": "all", + "bracketSpacing": true, + "bracketSameLine": false, + "arrowParentheses": "always", + "attributePosition": "auto" + } + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "correctness": { + "noUnusedImports": "error", + "noUnusedVariables": "error", + "useExhaustiveDependencies": "warn", + "useHookAtTopLevel": "error" + }, + "style": { + "noNonNullAssertion": "warn", + "useConst": "error", + "useImportType": "error", + "useNodejsImportProtocol": "error" + }, + "suspicious": { + "noExplicitAny": "warn", + "noConsoleLog": "warn" + }, + "complexity": { + "noForEach": "off", + "useLiteralKeys": "off" + } + } + }, + "json": { + "formatter": { + "indentStyle": "tab", + "trailingCommas": "none" + } + } +} diff --git a/package.json b/package.json index 66ac8ab..66d8639 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "exports": { "./prettier-default": "./prettier-default.mjs", "./prettier-astro": "./prettier-astro.mjs", - "./tsconfig": "./tsconfig.json" + "./tsconfig": "./tsconfig.json", + "./biome": "./biome.json" }, "scripts": { "test": "true", @@ -16,6 +17,11 @@ "keywords": [ "prettier", "prettier-config", + "biome", + "biome-config", + "eslint", + "linter", + "formatter", "config", "style", "typescript", From cf5ce416653e6bc3c2e93481cb7749190115d01b Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Jan 2026 09:17:26 +0000 Subject: [PATCH 2/4] chore: update Biome schema to v2.0.0 Update to the latest Biome 2.x schema for better compatibility with modern Biome features. --- biome.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biome.json b/biome.json index ebf71a0..928132d 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "$schema": "https://biomejs.dev/schemas/2.0.0/schema.json", "vcs": { "enabled": true, "clientKind": "git", From 179c573e1ed07c8efc3b28e7586504b1ffda002a Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Jan 2026 11:27:08 +0000 Subject: [PATCH 3/4] chore: update Biome schema to v2.3.11 Use the latest Biome schema version for full feature support. --- biome.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biome.json b/biome.json index 928132d..8457bbc 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.0.0/schema.json", + "$schema": "https://biomejs.dev/schemas/2.3.11/schema.json", "vcs": { "enabled": true, "clientKind": "git", From 09b08d44d4b01c51f4fc737c68d890d46bebbae3 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Jan 2026 11:30:08 +0000 Subject: [PATCH 4/4] feat: add custom import sorting groups to match Prettier config Configure import organization to match the existing Prettier import order using Biome 2.0's groups feature: 1. React packages 2. Plasmo packages 3. Third-party packages 4. Aliases (@/, ~) 5. Protocol imports (raw:, data-text:, etc.) 6. Relative paths Each group is separated by a blank line. --- biome.json | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/biome.json b/biome.json index 8457bbc..20befee 100644 --- a/biome.json +++ b/biome.json @@ -5,8 +5,29 @@ "clientKind": "git", "useIgnoreFile": true }, - "organizeImports": { - "enabled": true + "assist": { + "actions": { + "source": { + "organizeImports": { + "level": "on", + "options": { + "groups": [ + ["react", "react-dom", "react-dom/**", "react-*", "react-*/**"], + ":BLANK_LINE:", + ["@plasmohq/*", "@plasmohq/**"], + ":BLANK_LINE:", + ":PACKAGE:", + ":BLANK_LINE:", + ":ALIAS:", + ":BLANK_LINE:", + ":PACKAGE_WITH_PROTOCOL:", + ":BLANK_LINE:", + ":PATH:" + ] + } + } + } + } }, "formatter": { "enabled": true,