aboutsummaryrefslogtreecommitdiff
path: root/test/formatters/samplecode
diff options
context:
space:
mode:
authordalu <25452934+dalugm@users.noreply.github.com>2023-11-30 03:25:11 +0800
committerGitHub <noreply@github.com>2023-11-29 19:25:11 +0000
commitc8d9ad43ba99bb3b8703e6810fca357cf96c05ad (patch)
treed1997bb52d7187d7e8b4bf1c888eb027089126aa /test/formatters/samplecode
parent56651724ad22f2769bbdaccf54cbe75c1cb35c91 (diff)
Add denofmt (#264)
Diffstat (limited to 'test/formatters/samplecode')
l---------test/formatters/samplecode/denofmt-js/in.js1
-rw-r--r--test/formatters/samplecode/denofmt-js/out.js5
l---------test/formatters/samplecode/denofmt-json/in.json1
-rw-r--r--test/formatters/samplecode/denofmt-json/out.json19
-rw-r--r--test/formatters/samplecode/denofmt-jsonc/in.jsonc10
-rw-r--r--test/formatters/samplecode/denofmt-jsonc/out.jsonc19
-rw-r--r--test/formatters/samplecode/denofmt-jsx/in.jsx17
-rw-r--r--test/formatters/samplecode/denofmt-jsx/out.jsx16
l---------test/formatters/samplecode/denofmt-md/in.md1
-rw-r--r--test/formatters/samplecode/denofmt-md/out.md4
l---------test/formatters/samplecode/denofmt-ts/in.ts1
-rw-r--r--test/formatters/samplecode/denofmt-ts/out.ts6
-rw-r--r--test/formatters/samplecode/denofmt-tsx/in.tsx20
-rw-r--r--test/formatters/samplecode/denofmt-tsx/out.tsx19
l---------test/formatters/samplecode/denofmt/in.js1
l---------test/formatters/samplecode/denofmt/in.jsx1
l---------test/formatters/samplecode/denofmt/in.ts1
l---------test/formatters/samplecode/denofmt/in.tsx1
l---------test/formatters/samplecode/denofmt/out.js1
l---------test/formatters/samplecode/denofmt/out.jsx1
l---------test/formatters/samplecode/denofmt/out.ts1
l---------test/formatters/samplecode/denofmt/out.tsx1
22 files changed, 147 insertions, 0 deletions
diff --git a/test/formatters/samplecode/denofmt-js/in.js b/test/formatters/samplecode/denofmt-js/in.js
new file mode 120000
index 0000000..da49303
--- /dev/null
+++ b/test/formatters/samplecode/denofmt-js/in.js
@@ -0,0 +1 @@
+../prettier-javascript/in.js \ No newline at end of file
diff --git a/test/formatters/samplecode/denofmt-js/out.js b/test/formatters/samplecode/denofmt-js/out.js
new file mode 100644
index 0000000..bfd7620
--- /dev/null
+++ b/test/formatters/samplecode/denofmt-js/out.js
@@ -0,0 +1,5 @@
+function HelloWorld(
+ { greeting = "hello", greeted = '"World"', silent = false, onMouseOver },
+) {
+ if (!greeting) return null;
+}
diff --git a/test/formatters/samplecode/denofmt-json/in.json b/test/formatters/samplecode/denofmt-json/in.json
new file mode 120000
index 0000000..599a1e2
--- /dev/null
+++ b/test/formatters/samplecode/denofmt-json/in.json
@@ -0,0 +1 @@
+../prettier-json/in.json \ No newline at end of file
diff --git a/test/formatters/samplecode/denofmt-json/out.json b/test/formatters/samplecode/denofmt-json/out.json
new file mode 100644
index 0000000..59bb3b4
--- /dev/null
+++ b/test/formatters/samplecode/denofmt-json/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/denofmt-jsonc/in.jsonc b/test/formatters/samplecode/denofmt-jsonc/in.jsonc
new file mode 100644
index 0000000..8ce15bd
--- /dev/null
+++ b/test/formatters/samplecode/denofmt-jsonc/in.jsonc
@@ -0,0 +1,10 @@
+{"arrowParens": "always",// top comment
+ "bracketSpacing": true,"embeddedLanguageFormatting": "auto","htmlWhitespaceSensitivity": "css","insertPragma": false,"jsxBracketSameLine": false,"jsxSingleQuote": false,"printWidth": 80,// middle comment
+ "proseWrap": "preserve","quoteProps": "as-needed",
+ "requirePragma": false,
+ "semi": true,
+ "singleQuote": false,
+ "tabWidth": 2,
+ "trailingComma": "es5",
+ "useTabs": false,"vueIndentScriptAndStyle": false // bottom comment
+} \ No newline at end of file
diff --git a/test/formatters/samplecode/denofmt-jsonc/out.jsonc b/test/formatters/samplecode/denofmt-jsonc/out.jsonc
new file mode 100644
index 0000000..879665d
--- /dev/null
+++ b/test/formatters/samplecode/denofmt-jsonc/out.jsonc
@@ -0,0 +1,19 @@
+{
+ "arrowParens": "always", // top comment
+ "bracketSpacing": true,
+ "embeddedLanguageFormatting": "auto",
+ "htmlWhitespaceSensitivity": "css",
+ "insertPragma": false,
+ "jsxBracketSameLine": false,
+ "jsxSingleQuote": false,
+ "printWidth": 80, // middle comment
+ "proseWrap": "preserve",
+ "quoteProps": "as-needed",
+ "requirePragma": false,
+ "semi": true,
+ "singleQuote": false,
+ "tabWidth": 2,
+ "trailingComma": "es5",
+ "useTabs": false,
+ "vueIndentScriptAndStyle": false // bottom comment
+}
diff --git a/test/formatters/samplecode/denofmt-jsx/in.jsx b/test/formatters/samplecode/denofmt-jsx/in.jsx
new file mode 100644
index 0000000..1895e85
--- /dev/null
+++ b/test/formatters/samplecode/denofmt-jsx/in.jsx
@@ -0,0 +1,17 @@
+const Foo = ({name,
+ test}
+ ) => {
+ return <>
+ <h1>hello, {name}</h1>
+ <div>{test}</div>
+ </>
+;
+};
+
+const Bar = () => {
+ return (
+ <>
+ <Foo name="aaa" test="bbb" />
+ </>
+ )
+}
diff --git a/test/formatters/samplecode/denofmt-jsx/out.jsx b/test/formatters/samplecode/denofmt-jsx/out.jsx
new file mode 100644
index 0000000..9ce294f
--- /dev/null
+++ b/test/formatters/samplecode/denofmt-jsx/out.jsx
@@ -0,0 +1,16 @@
+const Foo = ({ name, test }) => {
+ return (
+ <>
+ <h1>hello, {name}</h1>
+ <div>{test}</div>
+ </>
+ );
+};
+
+const Bar = () => {
+ return (
+ <>
+ <Foo name="aaa" test="bbb" />
+ </>
+ );
+};
diff --git a/test/formatters/samplecode/denofmt-md/in.md b/test/formatters/samplecode/denofmt-md/in.md
new file mode 120000
index 0000000..99482b8
--- /dev/null
+++ b/test/formatters/samplecode/denofmt-md/in.md
@@ -0,0 +1 @@
+../prettier-markdown/in.md \ No newline at end of file
diff --git a/test/formatters/samplecode/denofmt-md/out.md b/test/formatters/samplecode/denofmt-md/out.md
new file mode 100644
index 0000000..4d08fcd
--- /dev/null
+++ b/test/formatters/samplecode/denofmt-md/out.md
@@ -0,0 +1,4 @@
+| col1 | col 2 |
+| ------ | ---------- |
+| nice | fits |
+| oh no! | it's ugly! |
diff --git a/test/formatters/samplecode/denofmt-ts/in.ts b/test/formatters/samplecode/denofmt-ts/in.ts
new file mode 120000
index 0000000..1b5f9d6
--- /dev/null
+++ b/test/formatters/samplecode/denofmt-ts/in.ts
@@ -0,0 +1 @@
+../prettier-typescript/in.ts \ No newline at end of file
diff --git a/test/formatters/samplecode/denofmt-ts/out.ts b/test/formatters/samplecode/denofmt-ts/out.ts
new file mode 100644
index 0000000..143b5a7
--- /dev/null
+++ b/test/formatters/samplecode/denofmt-ts/out.ts
@@ -0,0 +1,6 @@
+interface GreetingSettings {
+ greeting: string;
+ duration?: number;
+ color?: string;
+}
+declare function greet(setting: GreetingSettings): void;
diff --git a/test/formatters/samplecode/denofmt-tsx/in.tsx b/test/formatters/samplecode/denofmt-tsx/in.tsx
new file mode 100644
index 0000000..2412779
--- /dev/null
+++ b/test/formatters/samplecode/denofmt-tsx/in.tsx
@@ -0,0 +1,20 @@
+const Foo: FooComponent = ({
+name: string,
+ test: number}
+ ) => {
+ return <>
+ <h1>hello, {name}</h1>
+ <div>{test}</div>
+ </>
+;
+};
+
+const Bar
+: BarComponent = ()=> {
+ return (
+ <>
+ <Foo name="aaa"
+test={1} />
+ </>
+ )
+}
diff --git a/test/formatters/samplecode/denofmt-tsx/out.tsx b/test/formatters/samplecode/denofmt-tsx/out.tsx
new file mode 100644
index 0000000..8825eb5
--- /dev/null
+++ b/test/formatters/samplecode/denofmt-tsx/out.tsx
@@ -0,0 +1,19 @@
+const Foo: FooComponent = ({
+ name: string,
+ test: number,
+}) => {
+ return (
+ <>
+ <h1>hello, {name}</h1>
+ <div>{test}</div>
+ </>
+ );
+};
+
+const Bar: BarComponent = () => {
+ return (
+ <>
+ <Foo name="aaa" test={1} />
+ </>
+ );
+};
diff --git a/test/formatters/samplecode/denofmt/in.js b/test/formatters/samplecode/denofmt/in.js
new file mode 120000
index 0000000..0c434a4
--- /dev/null
+++ b/test/formatters/samplecode/denofmt/in.js
@@ -0,0 +1 @@
+../denofmt-js/in.js \ No newline at end of file
diff --git a/test/formatters/samplecode/denofmt/in.jsx b/test/formatters/samplecode/denofmt/in.jsx
new file mode 120000
index 0000000..cabbf0f
--- /dev/null
+++ b/test/formatters/samplecode/denofmt/in.jsx
@@ -0,0 +1 @@
+../denofmt-jsx/in.jsx \ No newline at end of file
diff --git a/test/formatters/samplecode/denofmt/in.ts b/test/formatters/samplecode/denofmt/in.ts
new file mode 120000
index 0000000..559c4ec
--- /dev/null
+++ b/test/formatters/samplecode/denofmt/in.ts
@@ -0,0 +1 @@
+../denofmt-ts/in.ts \ No newline at end of file
diff --git a/test/formatters/samplecode/denofmt/in.tsx b/test/formatters/samplecode/denofmt/in.tsx
new file mode 120000
index 0000000..ce378b5
--- /dev/null
+++ b/test/formatters/samplecode/denofmt/in.tsx
@@ -0,0 +1 @@
+../denofmt-tsx/in.tsx \ No newline at end of file
diff --git a/test/formatters/samplecode/denofmt/out.js b/test/formatters/samplecode/denofmt/out.js
new file mode 120000
index 0000000..591eac8
--- /dev/null
+++ b/test/formatters/samplecode/denofmt/out.js
@@ -0,0 +1 @@
+../denofmt-js/out.js \ No newline at end of file
diff --git a/test/formatters/samplecode/denofmt/out.jsx b/test/formatters/samplecode/denofmt/out.jsx
new file mode 120000
index 0000000..531e738
--- /dev/null
+++ b/test/formatters/samplecode/denofmt/out.jsx
@@ -0,0 +1 @@
+../denofmt-jsx/out.jsx \ No newline at end of file
diff --git a/test/formatters/samplecode/denofmt/out.ts b/test/formatters/samplecode/denofmt/out.ts
new file mode 120000
index 0000000..82e64da
--- /dev/null
+++ b/test/formatters/samplecode/denofmt/out.ts
@@ -0,0 +1 @@
+../denofmt-ts/out.ts \ No newline at end of file
diff --git a/test/formatters/samplecode/denofmt/out.tsx b/test/formatters/samplecode/denofmt/out.tsx
new file mode 120000
index 0000000..7089154
--- /dev/null
+++ b/test/formatters/samplecode/denofmt/out.tsx
@@ -0,0 +1 @@
+../denofmt-tsx/out.tsx \ No newline at end of file