aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Perez Alvarez <danielpza@protonmail.com>2025-01-18 11:08:20 -0800
committerGitHub <noreply@github.com>2025-01-18 11:08:20 -0800
commitfa50cb3a3c7cb8f2b4216760c05f8a885a3ce906 (patch)
treefcfa0df142f091d336a3ee3be7d44796f0efdbb2 /test
parent30b19fa7b3841bb9b811e2ecdcd3782248052ae8 (diff)
feat: add biome formatter (#339)
See https://biomejs.dev/ Alternative formatter to `prettier` closes https://github.com/radian-software/apheleia/issues/323
Diffstat (limited to 'test')
-rw-r--r--test/formatters/installers/biome.bash1
-rw-r--r--test/formatters/samplecode/biome/in.css13
-rw-r--r--test/formatters/samplecode/biome/in.graphql1
-rw-r--r--test/formatters/samplecode/biome/in.js4
-rw-r--r--test/formatters/samplecode/biome/in.json1
-rw-r--r--test/formatters/samplecode/biome/in.ts1
-rw-r--r--test/formatters/samplecode/biome/out.css6
-rw-r--r--test/formatters/samplecode/biome/out.graphql6
-rw-r--r--test/formatters/samplecode/biome/out.js10
-rw-r--r--test/formatters/samplecode/biome/out.json19
-rw-r--r--test/formatters/samplecode/biome/out.ts6
11 files changed, 68 insertions, 0 deletions
diff --git a/test/formatters/installers/biome.bash b/test/formatters/installers/biome.bash
new file mode 100644
index 0000000..56b6e1b
--- /dev/null
+++ b/test/formatters/installers/biome.bash
@@ -0,0 +1 @@
+npm install -g @biomejs/biome
diff --git a/test/formatters/samplecode/biome/in.css b/test/formatters/samplecode/biome/in.css
new file mode 100644
index 0000000..55d5d36
--- /dev/null
+++ b/test/formatters/samplecode/biome/in.css
@@ -0,0 +1,13 @@
+ body
+
+{
+ padding-left : 11em;
+font-family
+ : Georgia,
+
+ "Times New Roman",
+ Times, serif;
+ color: purple;
+ background-color:
+ #d8da3d
+ }
diff --git a/test/formatters/samplecode/biome/in.graphql b/test/formatters/samplecode/biome/in.graphql
new file mode 100644
index 0000000..72fc73e
--- /dev/null
+++ b/test/formatters/samplecode/biome/in.graphql
@@ -0,0 +1 @@
+{human(id: "1000") {name height(unit: FOOT)}}
diff --git a/test/formatters/samplecode/biome/in.js b/test/formatters/samplecode/biome/in.js
new file mode 100644
index 0000000..fd56713
--- /dev/null
+++ b/test/formatters/samplecode/biome/in.js
@@ -0,0 +1,4 @@
+function HelloWorld({greeting = "hello", greeted = '"World"', silent = false, onMouseOver,}) {
+
+ if(!greeting){return null};
+ }
diff --git a/test/formatters/samplecode/biome/in.json b/test/formatters/samplecode/biome/in.json
new file mode 100644
index 0000000..28dc75f
--- /dev/null
+++ b/test/formatters/samplecode/biome/in.json
@@ -0,0 +1 @@
+{"arrowParens":"always","bracketSpacing":true,"embeddedLanguageFormatting":"auto","htmlWhitespaceSensitivity":"css","insertPragma":false,"jsxBracketSameLine":false,"jsxSingleQuote":false,"printWidth":80,"proseWrap":"preserve","quoteProps":"as-needed","requirePragma":false,"semi":true,"singleQuote":false,"tabWidth":2,"trailingComma":"es5","useTabs":false,"vueIndentScriptAndStyle":false}
diff --git a/test/formatters/samplecode/biome/in.ts b/test/formatters/samplecode/biome/in.ts
new file mode 100644
index 0000000..c75d40f
--- /dev/null
+++ b/test/formatters/samplecode/biome/in.ts
@@ -0,0 +1 @@
+interface GreetingSettings{greeting: string; duration?: number; color?: string;}declare function greet(setting: GreetingSettings): void;
diff --git a/test/formatters/samplecode/biome/out.css b/test/formatters/samplecode/biome/out.css
new file mode 100644
index 0000000..87717b9
--- /dev/null
+++ b/test/formatters/samplecode/biome/out.css
@@ -0,0 +1,6 @@
+body {
+ padding-left: 11em;
+ font-family: Georgia, "Times New Roman", Times, serif;
+ color: purple;
+ background-color: #d8da3d;
+}
diff --git a/test/formatters/samplecode/biome/out.graphql b/test/formatters/samplecode/biome/out.graphql
new file mode 100644
index 0000000..89828da
--- /dev/null
+++ b/test/formatters/samplecode/biome/out.graphql
@@ -0,0 +1,6 @@
+{
+ human(id: "1000") {
+ name
+ height(unit: FOOT)
+ }
+}
diff --git a/test/formatters/samplecode/biome/out.js b/test/formatters/samplecode/biome/out.js
new file mode 100644
index 0000000..1486b51
--- /dev/null
+++ b/test/formatters/samplecode/biome/out.js
@@ -0,0 +1,10 @@
+function HelloWorld({
+ greeting = "hello",
+ greeted = '"World"',
+ silent = false,
+ onMouseOver,
+}) {
+ if (!greeting) {
+ return null;
+ }
+}
diff --git a/test/formatters/samplecode/biome/out.json b/test/formatters/samplecode/biome/out.json
new file mode 100644
index 0000000..86787f9
--- /dev/null
+++ b/test/formatters/samplecode/biome/out.json
@@ -0,0 +1,19 @@
+{
+ "arrowParens": "always",
+ "bracketSpacing": true,
+ "embeddedLanguageFormatting": "auto",
+ "htmlWhitespaceSensitivity": "css",
+ "insertPragma": false,
+ "jsxBracketSameLine": false,
+ "jsxSingleQuote": false,
+ "printWidth": 80,
+ "proseWrap": "preserve",
+ "quoteProps": "as-needed",
+ "requirePragma": false,
+ "semi": true,
+ "singleQuote": false,
+ "tabWidth": 2,
+ "trailingComma": "es5",
+ "useTabs": false,
+ "vueIndentScriptAndStyle": false
+}
diff --git a/test/formatters/samplecode/biome/out.ts b/test/formatters/samplecode/biome/out.ts
new file mode 100644
index 0000000..b97c21b
--- /dev/null
+++ b/test/formatters/samplecode/biome/out.ts
@@ -0,0 +1,6 @@
+interface GreetingSettings {
+ greeting: string;
+ duration?: number;
+ color?: string;
+}
+declare function greet(setting: GreetingSettings): void;