@rm30/biome-config 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +92 -0
  2. package/config.json +101 -0
  3. package/package.json +32 -0
package/README.md ADDED
@@ -0,0 +1,92 @@
1
+ # @rm30/biome-config
2
+
3
+ The shared RM30 [Biome](https://biomejs.dev) configuration — lint **and** format, in one
4
+ tool, replacing ESLint and Prettier.
5
+
6
+ ## Install
7
+
8
+ ```sh
9
+ pnpm add -D @biomejs/biome @rm30/biome-config
10
+ ```
11
+
12
+ Then, at the repo root:
13
+
14
+ ```json
15
+ {
16
+ "$schema": "https://biomejs.dev/schemas/2.5.12/schema.json",
17
+ "extends": ["@rm30/biome-config"]
18
+ }
19
+ ```
20
+
21
+ Replace `lint`, `lint:fix`, `format` and `format:check` with:
22
+
23
+ ```json
24
+ {
25
+ "check": "biome check .",
26
+ "check:fix": "biome check --write ."
27
+ }
28
+ ```
29
+
30
+ ## What it sets
31
+
32
+ **Formatter** — 140 columns, 2 spaces, single quotes, no semicolons, ES5 trailing commas,
33
+ always-parenthesised arrow params, LF line endings.
34
+
35
+ LF is deliberate. Prettier's `endOfLine: "auto"` *preserved* whatever a file already
36
+ had; Biome's `auto` *forces the platform's*, which would rewrite every file to CRLF on a
37
+ Windows checkout and fight CI on the next pass. Git stores LF regardless. JSON formatting is off:
38
+ those files are maintained by hand.
39
+
40
+ **Linter** — Biome's recommended set, plus:
41
+
42
+ | Rule | Level | Why |
43
+ |---|---|---|
44
+ | `noUnusedVariables`, `noUnusedImports`, `noUnusedFunctionParameters` | error | Identifiers prefixed with `_` are ignored, as before. |
45
+ | `noExplicitAny` | warn | |
46
+ | `noEmptyInterface`, `noBannedTypes` | warn | |
47
+ | `noConsole` (allowing `warn`, `error`) | warn | Use a logger. |
48
+
49
+ **Import sorting** is Biome's own organizer, via the assist actions.
50
+
51
+ **Domains** are left to Biome's detection: it enables the `next`, `react`, `reactNative`,
52
+ `drizzle`, `tailwind`, `turborepo` and `test` rule sets per package, from the dependencies
53
+ that package declares. In a monorepo this resolves per `package.json`, so a Next app and
54
+ an Expo app in one repo each get the right rules without configuration.
55
+
56
+ ## The one known gap
57
+
58
+ Tailwind class sorting. Biome's `useSortedClasses` is still nursery and only understands
59
+ the default Tailwind config, while every RM30 project runs v4 with its own custom scales. Standard utilities still sort; custom tokens will not order
60
+ optimally. This is cosmetic, it is the only gap, and it is **accepted** — keeping Prettier
61
+ alive for it alone would forfeit the point of the migration.
62
+
63
+ Solidity is not covered; `solhint` stays separate, as it already was.
64
+
65
+ ## Why Biome and not ESLint
66
+
67
+ typescript-eslint supports `>=4.8.4 <6.1.0`. TypeScript 7 ships without a stable
68
+ programmatic API, and every type-aware typescript-eslint rule is built against that API —
69
+ so staying on ESLint means never adopting TypeScript 7. Biome parses and infers in Rust
70
+ and never loads the TS API.
71
+
72
+ Biome is the precondition for TypeScript 7, not a parallel nice-to-have.
73
+
74
+ ## Overriding
75
+
76
+ Project-specific rules stay in the project, visible:
77
+
78
+ ```json
79
+ {
80
+ "extends": ["@rm30/biome-config"],
81
+ "linter": {
82
+ "rules": {
83
+ "style": {
84
+ "noRestrictedImports": {
85
+ "level": "error",
86
+ "options": { "patterns": [{ "group": ["../features/*"], "message": "Cross-feature imports go through the feature's index." }] }
87
+ }
88
+ }
89
+ }
90
+ }
91
+ }
92
+ ```
package/config.json ADDED
@@ -0,0 +1,101 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/2.5.12/schema.json",
3
+ "vcs": {
4
+ "enabled": true,
5
+ "clientKind": "git",
6
+ "useIgnoreFile": true
7
+ },
8
+ "files": {
9
+ "ignoreUnknown": true,
10
+ "includes": [
11
+ "**",
12
+ "!**/node_modules",
13
+ "!**/dist",
14
+ "!**/build",
15
+ "!**/coverage",
16
+ "!**/.next",
17
+ "!**/.expo",
18
+ "!**/.expo-shared",
19
+ "!**/android",
20
+ "!**/ios",
21
+ "!**/uniwind-types.d.ts",
22
+ "!**/next-env.d.ts",
23
+ "!**/expo-env.d.ts",
24
+ "!**/pnpm-lock.yaml"
25
+ ]
26
+ },
27
+ "formatter": {
28
+ "enabled": true,
29
+ "indentStyle": "space",
30
+ "indentWidth": 2,
31
+ "lineWidth": 140,
32
+ "lineEnding": "lf"
33
+ },
34
+ "javascript": {
35
+ "formatter": {
36
+ "quoteStyle": "single",
37
+ "jsxQuoteStyle": "double",
38
+ "semicolons": "asNeeded",
39
+ "trailingCommas": "es5",
40
+ "arrowParentheses": "always",
41
+ "bracketSpacing": true
42
+ }
43
+ },
44
+ "json": {
45
+ "formatter": {
46
+ "enabled": false
47
+ }
48
+ },
49
+ "css": {
50
+ "parser": {
51
+ "tailwindDirectives": true
52
+ },
53
+ "formatter": {
54
+ "enabled": true
55
+ }
56
+ },
57
+ "assist": {
58
+ "enabled": true,
59
+ "actions": {
60
+ "source": {
61
+ "organizeImports": "on"
62
+ }
63
+ }
64
+ },
65
+ "overrides": [
66
+ {
67
+ "includes": ["**/*.svg"],
68
+ "linter": {
69
+ "rules": {
70
+ "a11y": {
71
+ "noSvgWithoutTitle": "off"
72
+ }
73
+ }
74
+ }
75
+ }
76
+ ],
77
+ "linter": {
78
+ "enabled": true,
79
+ "rules": {
80
+ "recommended": true,
81
+ "correctness": {
82
+ "noUnusedVariables": "error",
83
+ "noUnusedImports": "error",
84
+ "noUnusedFunctionParameters": "error"
85
+ },
86
+ "suspicious": {
87
+ "noExplicitAny": "warn",
88
+ "noEmptyInterface": "warn",
89
+ "noConsole": {
90
+ "level": "warn",
91
+ "options": {
92
+ "allow": ["warn", "error"]
93
+ }
94
+ }
95
+ },
96
+ "complexity": {
97
+ "noBannedTypes": "warn"
98
+ }
99
+ }
100
+ }
101
+ }
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@rm30/biome-config",
3
+ "version": "0.1.0",
4
+ "description": "The shared RM30 Biome configuration — lint and format, replacing ESLint and Prettier.",
5
+ "license": "MIT",
6
+ "author": "Rafael Miziara",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/rafamiziara/cli.git",
10
+ "directory": "packages/biome-config"
11
+ },
12
+ "keywords": [
13
+ "biome",
14
+ "biome-config",
15
+ "lint",
16
+ "format"
17
+ ],
18
+ "exports": {
19
+ ".": "./config.json",
20
+ "./config.json": "./config.json"
21
+ },
22
+ "files": [
23
+ "config.json",
24
+ "README.md"
25
+ ],
26
+ "peerDependencies": {
27
+ "@biomejs/biome": "^2.5.0"
28
+ },
29
+ "publishConfig": {
30
+ "access": "public"
31
+ }
32
+ }