Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claude I don't want to replace eslint and prettier; biome is just another supported tool

- [x] Typescript

## Install
Expand Down Expand Up @@ -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
Expand Down
86 changes: 86 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": 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,
"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"
}
}
}
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -16,6 +17,11 @@
"keywords": [
"prettier",
"prettier-config",
"biome",
"biome-config",
"eslint",
"linter",
"formatter",
"config",
"style",
"typescript",
Expand Down