@imapps/biome-config 0.5.1
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.
- package/README.md +93 -0
- package/configs/base.json +87 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# @imapps/biome-config
|
|
2
|
+
|
|
3
|
+
Shared Biome configuration for IM Apps projects.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn add -D @imapps/biome-config @biomejs/biome
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
Create a `biome.json` in your project root and extend one of the provided configurations:
|
|
14
|
+
|
|
15
|
+
### Monorepo Configuration (Recommended for multi-package repos)
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"extends": ["@imapps/biome-config/monorepo"]
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### React Application Configuration
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"extends": ["@imapps/biome-config/react"]
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Node.js Application Configuration
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"extends": ["@imapps/biome-config/node"]
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Base Configuration
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"extends": ["@imapps/biome-config/base"]
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Available Configurations
|
|
48
|
+
|
|
49
|
+
- **base** - Base configuration with formatter and linter rules
|
|
50
|
+
- **monorepo** - Extends base with relaxed rules for test and config files
|
|
51
|
+
- **react** - Extends base with React and accessibility rules
|
|
52
|
+
- **node** - Extends base for Node.js applications
|
|
53
|
+
|
|
54
|
+
## Configuration Details
|
|
55
|
+
|
|
56
|
+
All configurations include:
|
|
57
|
+
|
|
58
|
+
- **Formatter**: 4-space indentation, single quotes for JS, double quotes for JSX, always semicolons
|
|
59
|
+
- **Linter**: Recommended rules enabled with additional custom rules
|
|
60
|
+
- **Line Width**: 120 characters
|
|
61
|
+
- **Import Organization**: Automatic import sorting enabled
|
|
62
|
+
|
|
63
|
+
## Overriding Rules
|
|
64
|
+
|
|
65
|
+
You can override any rules in your project's `biome.json`:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"extends": ["@imapps/biome-config/monorepo"],
|
|
70
|
+
"linter": {
|
|
71
|
+
"rules": {
|
|
72
|
+
"suspicious": {
|
|
73
|
+
"noExplicitAny": "error"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Running Biome
|
|
81
|
+
|
|
82
|
+
Add these scripts to your `package.json`:
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"scripts": {
|
|
87
|
+
"lint": "biome check .",
|
|
88
|
+
"lint:fix": "biome check --fix --unsafe .",
|
|
89
|
+
"format": "biome format --write ."
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.2.5/schema.json",
|
|
3
|
+
"vcs": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"clientKind": "git",
|
|
6
|
+
"useIgnoreFile": true
|
|
7
|
+
},
|
|
8
|
+
"files": {
|
|
9
|
+
"ignoreUnknown": false
|
|
10
|
+
},
|
|
11
|
+
"formatter": {
|
|
12
|
+
"enabled": true,
|
|
13
|
+
"indentStyle": "space",
|
|
14
|
+
"indentWidth": 4,
|
|
15
|
+
"lineWidth": 120
|
|
16
|
+
},
|
|
17
|
+
"linter": {
|
|
18
|
+
"enabled": true,
|
|
19
|
+
"rules": {
|
|
20
|
+
"recommended": true,
|
|
21
|
+
"style": {
|
|
22
|
+
"useConst": "error",
|
|
23
|
+
"useTemplate": "error",
|
|
24
|
+
"useSingleVarDeclarator": "error"
|
|
25
|
+
},
|
|
26
|
+
"suspicious": {
|
|
27
|
+
"noDoubleEquals": "warn",
|
|
28
|
+
"noExplicitAny": "warn"
|
|
29
|
+
},
|
|
30
|
+
"a11y": {
|
|
31
|
+
"noAccessKey": "error",
|
|
32
|
+
"useAltText": "error",
|
|
33
|
+
"useAnchorContent": "error",
|
|
34
|
+
"useValidAnchor": "error",
|
|
35
|
+
"useHeadingContent": "error",
|
|
36
|
+
"useKeyWithClickEvents": "warn",
|
|
37
|
+
"useKeyWithMouseEvents": "warn"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"assist": {
|
|
42
|
+
"enabled": true,
|
|
43
|
+
"actions": {
|
|
44
|
+
"source": {
|
|
45
|
+
"organizeImports": "on"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"javascript": {
|
|
50
|
+
"formatter": {
|
|
51
|
+
"quoteStyle": "single",
|
|
52
|
+
"jsxQuoteStyle": "double",
|
|
53
|
+
"semicolons": "always",
|
|
54
|
+
"trailingCommas": "es5",
|
|
55
|
+
"bracketSpacing": true,
|
|
56
|
+
"arrowParentheses": "always"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"json": {
|
|
60
|
+
"formatter": {
|
|
61
|
+
"enabled": true,
|
|
62
|
+
"indentStyle": "space",
|
|
63
|
+
"indentWidth": 2
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"overrides": [
|
|
67
|
+
{
|
|
68
|
+
"includes": [
|
|
69
|
+
"**/*.test.ts",
|
|
70
|
+
"**/*.test.tsx",
|
|
71
|
+
"**/*.test.js",
|
|
72
|
+
"**/*.test.jsx",
|
|
73
|
+
"**/*.spec.ts",
|
|
74
|
+
"**/*.spec.tsx",
|
|
75
|
+
"**/*.spec.js",
|
|
76
|
+
"**/*.spec.jsx"
|
|
77
|
+
],
|
|
78
|
+
"linter": {
|
|
79
|
+
"rules": {
|
|
80
|
+
"suspicious": {
|
|
81
|
+
"noExplicitAny": "off"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@imapps/biome-config",
|
|
3
|
+
"version": "0.5.1",
|
|
4
|
+
"description": "Shared Biome configuration for IM Apps projects",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"registry": "https://registry.npmjs.org/",
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"exports": {
|
|
10
|
+
"./base": "./configs/base.json",
|
|
11
|
+
"./monorepo": "./configs/monorepo.json",
|
|
12
|
+
"./react": "./configs/react.json",
|
|
13
|
+
"./node": "./configs/node.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"configs",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"clean": "rimraf build"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"rimraf": "^6.0.1"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@biomejs/biome": "^2.0.0"
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/igor-siergiej/utils.git"
|
|
31
|
+
}
|
|
32
|
+
}
|