Skip to content

Commit 3eaf027

Browse files
authored
feat: added biome + makefile (#143)
1 parent afb6e90 commit 3eaf027

File tree

4 files changed

+104
-1
lines changed

4 files changed

+104
-1
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
###############
1010
Thumbs.db
1111
.DS_Store
12-
.vscode
1312
*.code-workspace
1413

1514
# Logs #

.vscode/settings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"editor.defaultFormatter": "biomejs.biome",
3+
"css.validate": false,
4+
"editor.codeActionsOnSave": {
5+
"source.fixAll.biome": "explicit"
6+
},
7+
"[javascript][css][json]": {
8+
"editor.defaultFormatter": "biomejs.biome",
9+
"editor.formatOnSave": true
10+
}
11+
}

Makefile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
BIOME_BASE_CMD := npx @biomejs/biome
2+
BIOME_CONFIG_PATH := --config-path="biome.json"
3+
WRITE_FLAG := --write
4+
5+
.PHONY: list help
6+
list help::
7+
$(info Available Make targets:)
8+
@echo "<COMMON>"
9+
@echo " list | help: Print these available make targets"
10+
@echo "<LINTING AND FORMATTING>"
11+
@echo " biome-format: Runs the biome formatter."
12+
@echo " biome-lint: Runs the biome linter."
13+
@echo " biome-all: Runs both the lint and formatting commands."
14+
@echo " (Set BIOME_ARGS to add additional arguments to biome command (ex: make biome-all BIOME_ARGS=write))"
15+
16+
.PHONY: biome-format biome-lint biome-all
17+
BIOME_ARGS ?=
18+
FLAG :=
19+
ifeq ($(BIOME_ARGS), write)
20+
FLAG := $(WRITE_FLAG)
21+
endif
22+
23+
biome-format:
24+
$(BIOME_BASE_CMD) format $(BIOME_CONFIG_PATH) $(FLAG)
25+
biome-lint:
26+
$(BIOME_BASE_CMD) lint $(BIOME_CONFIG_PATH) $(FLAG)
27+
biome-all:
28+
$(BIOME_BASE_CMD) check $(BIOME_CONFIG_PATH) $(FLAG)

biome.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"vcs": {
4+
"enabled": false,
5+
"clientKind": "git",
6+
"useIgnoreFile": false
7+
},
8+
"files": {
9+
"ignoreUnknown": false,
10+
"ignore": [
11+
".vscode/",
12+
"**/*.min.js",
13+
"**/*.standalone.js",
14+
"kube.js",
15+
16+
"**/css/docs-nginx-com/*.css",
17+
"**/css/inter/*.css",
18+
"**/fontawesome/*.css",
19+
"**/static/*.css",
20+
"**/bootstrap*.css",
21+
"**/*.min.css",
22+
"**/coveo.css",
23+
"**/f5-hugo.css",
24+
"**/highlight.css",
25+
"**/*-overrides.css"
26+
]
27+
},
28+
"formatter": {
29+
"enabled": true,
30+
"indentStyle": "space"
31+
},
32+
"linter": {
33+
"enabled": true,
34+
"rules": {
35+
"recommended": true,
36+
"complexity": {
37+
"noForEach": "off"
38+
},
39+
"style": {
40+
"useTemplate": "off"
41+
},
42+
"nursery": {
43+
"noDuplicateProperties": "error"
44+
},
45+
"suspicious": {
46+
"noEmptyBlock": "error"
47+
},
48+
"correctness": {
49+
"noUnknownUnit": "error"
50+
}
51+
}
52+
},
53+
"javascript": {
54+
"formatter": {
55+
"quoteStyle": "single",
56+
"trailingCommas": "es5",
57+
"semicolons": "always"
58+
}
59+
},
60+
"css": {
61+
"formatter": {
62+
"quoteStyle": "double"
63+
}
64+
}
65+
}

0 commit comments

Comments
 (0)