mirror of
https://github.com/vale981/apheleia
synced 2025-03-04 17:11:40 -05:00
Add denofmt (#264)
This commit is contained in:
parent
56651724ad
commit
c8d9ad43ba
32 changed files with 166 additions and 0 deletions
|
@ -13,9 +13,12 @@ The format is based on [Keep a Changelog].
|
||||||
([#229])
|
([#229])
|
||||||
* [`robotidy`](https://robotidy.readthedocs.io) for Robot Framework files
|
* [`robotidy`](https://robotidy.readthedocs.io) for Robot Framework files
|
||||||
([#263]).
|
([#263]).
|
||||||
|
* [denofmt](https://docs.deno.com/runtime/manual/tools/formatter) for
|
||||||
|
js, jsx, ts, tsx, json, jsonc, md files. ([#264])
|
||||||
|
|
||||||
[#229]: https://github.com/radian-software/apheleia/pull/229
|
[#229]: https://github.com/radian-software/apheleia/pull/229
|
||||||
[#263]: https://github.com/radian-software/apheleia/pull/263
|
[#263]: https://github.com/radian-software/apheleia/pull/263
|
||||||
|
[#264]: https://github.com/radian-software/apheleia/pull/264
|
||||||
|
|
||||||
## 4.0 (released 2023-11-23)
|
## 4.0 (released 2023-11-23)
|
||||||
### Breaking changes
|
### Breaking changes
|
||||||
|
|
|
@ -47,6 +47,14 @@
|
||||||
(apheleia-formatters-indent
|
(apheleia-formatters-indent
|
||||||
"--indent-with-tabs" "--indent-size"))
|
"--indent-with-tabs" "--indent-size"))
|
||||||
(dart-format . ("dart" "format"))
|
(dart-format . ("dart" "format"))
|
||||||
|
(denofmt . ("deno" "fmt" "-"))
|
||||||
|
(denofmt-js . ("deno" "fmt" "-" "--ext" "js"))
|
||||||
|
(denofmt-json . ("deno" "fmt" "-" "--ext" "json"))
|
||||||
|
(denofmt-jsonc . ("deno" "fmt" "-" "--ext" "jsonc"))
|
||||||
|
(denofmt-jsx . ("deno" "fmt" "-" "--ext" "jsx"))
|
||||||
|
(denofmt-md . ("deno" "fmt" "-" "--ext" "md"))
|
||||||
|
(denofmt-ts . ("deno" "fmt" "-" "--ext" "ts"))
|
||||||
|
(denofmt-tsx . ("deno" "fmt" "-" "--ext" "tsx"))
|
||||||
(elm-format . ("elm-format" "--yes" "--stdin"))
|
(elm-format . ("elm-format" "--yes" "--stdin"))
|
||||||
(fish-indent . ("fish_indent"))
|
(fish-indent . ("fish_indent"))
|
||||||
(fourmolu . ("fourmolu"))
|
(fourmolu . ("fourmolu"))
|
||||||
|
|
1
test/formatters/installers/denofmt-js.bash
Symbolic link
1
test/formatters/installers/denofmt-js.bash
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
denofmt.bash
|
1
test/formatters/installers/denofmt-json.bash
Symbolic link
1
test/formatters/installers/denofmt-json.bash
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
denofmt.bash
|
1
test/formatters/installers/denofmt-jsonc.bash
Symbolic link
1
test/formatters/installers/denofmt-jsonc.bash
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
denofmt.bash
|
1
test/formatters/installers/denofmt-jsx.bash
Symbolic link
1
test/formatters/installers/denofmt-jsx.bash
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
denofmt.bash
|
1
test/formatters/installers/denofmt-md.bash
Symbolic link
1
test/formatters/installers/denofmt-md.bash
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
denofmt.bash
|
1
test/formatters/installers/denofmt-ts.bash
Symbolic link
1
test/formatters/installers/denofmt-ts.bash
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
denofmt.bash
|
1
test/formatters/installers/denofmt-tsx.bash
Symbolic link
1
test/formatters/installers/denofmt-tsx.bash
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
denofmt.bash
|
1
test/formatters/installers/denofmt.bash
Normal file
1
test/formatters/installers/denofmt.bash
Normal file
|
@ -0,0 +1 @@
|
||||||
|
curl -fsSL https://deno.land/x/install/install.sh | sudo DENO_INSTALL=/usr/local sh
|
1
test/formatters/samplecode/denofmt-js/in.js
Symbolic link
1
test/formatters/samplecode/denofmt-js/in.js
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../prettier-javascript/in.js
|
5
test/formatters/samplecode/denofmt-js/out.js
Normal file
5
test/formatters/samplecode/denofmt-js/out.js
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
function HelloWorld(
|
||||||
|
{ greeting = "hello", greeted = '"World"', silent = false, onMouseOver },
|
||||||
|
) {
|
||||||
|
if (!greeting) return null;
|
||||||
|
}
|
1
test/formatters/samplecode/denofmt-json/in.json
Symbolic link
1
test/formatters/samplecode/denofmt-json/in.json
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../prettier-json/in.json
|
19
test/formatters/samplecode/denofmt-json/out.json
Normal file
19
test/formatters/samplecode/denofmt-json/out.json
Normal file
|
@ -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
|
||||||
|
}
|
10
test/formatters/samplecode/denofmt-jsonc/in.jsonc
Normal file
10
test/formatters/samplecode/denofmt-jsonc/in.jsonc
Normal file
|
@ -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
|
||||||
|
}
|
19
test/formatters/samplecode/denofmt-jsonc/out.jsonc
Normal file
19
test/formatters/samplecode/denofmt-jsonc/out.jsonc
Normal file
|
@ -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
|
||||||
|
}
|
17
test/formatters/samplecode/denofmt-jsx/in.jsx
Normal file
17
test/formatters/samplecode/denofmt-jsx/in.jsx
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
const Foo = ({name,
|
||||||
|
test}
|
||||||
|
) => {
|
||||||
|
return <>
|
||||||
|
<h1>hello, {name}</h1>
|
||||||
|
<div>{test}</div>
|
||||||
|
</>
|
||||||
|
;
|
||||||
|
};
|
||||||
|
|
||||||
|
const Bar = () => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Foo name="aaa" test="bbb" />
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
16
test/formatters/samplecode/denofmt-jsx/out.jsx
Normal file
16
test/formatters/samplecode/denofmt-jsx/out.jsx
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
const Foo = ({ name, test }) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<h1>hello, {name}</h1>
|
||||||
|
<div>{test}</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const Bar = () => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Foo name="aaa" test="bbb" />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
1
test/formatters/samplecode/denofmt-md/in.md
Symbolic link
1
test/formatters/samplecode/denofmt-md/in.md
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../prettier-markdown/in.md
|
4
test/formatters/samplecode/denofmt-md/out.md
Normal file
4
test/formatters/samplecode/denofmt-md/out.md
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
| col1 | col 2 |
|
||||||
|
| ------ | ---------- |
|
||||||
|
| nice | fits |
|
||||||
|
| oh no! | it's ugly! |
|
1
test/formatters/samplecode/denofmt-ts/in.ts
Symbolic link
1
test/formatters/samplecode/denofmt-ts/in.ts
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../prettier-typescript/in.ts
|
6
test/formatters/samplecode/denofmt-ts/out.ts
Normal file
6
test/formatters/samplecode/denofmt-ts/out.ts
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
interface GreetingSettings {
|
||||||
|
greeting: string;
|
||||||
|
duration?: number;
|
||||||
|
color?: string;
|
||||||
|
}
|
||||||
|
declare function greet(setting: GreetingSettings): void;
|
20
test/formatters/samplecode/denofmt-tsx/in.tsx
Normal file
20
test/formatters/samplecode/denofmt-tsx/in.tsx
Normal file
|
@ -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} />
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
19
test/formatters/samplecode/denofmt-tsx/out.tsx
Normal file
19
test/formatters/samplecode/denofmt-tsx/out.tsx
Normal file
|
@ -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} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
1
test/formatters/samplecode/denofmt/in.js
Symbolic link
1
test/formatters/samplecode/denofmt/in.js
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../denofmt-js/in.js
|
1
test/formatters/samplecode/denofmt/in.jsx
Symbolic link
1
test/formatters/samplecode/denofmt/in.jsx
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../denofmt-jsx/in.jsx
|
1
test/formatters/samplecode/denofmt/in.ts
Symbolic link
1
test/formatters/samplecode/denofmt/in.ts
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../denofmt-ts/in.ts
|
1
test/formatters/samplecode/denofmt/in.tsx
Symbolic link
1
test/formatters/samplecode/denofmt/in.tsx
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../denofmt-tsx/in.tsx
|
1
test/formatters/samplecode/denofmt/out.js
Symbolic link
1
test/formatters/samplecode/denofmt/out.js
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../denofmt-js/out.js
|
1
test/formatters/samplecode/denofmt/out.jsx
Symbolic link
1
test/formatters/samplecode/denofmt/out.jsx
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../denofmt-jsx/out.jsx
|
1
test/formatters/samplecode/denofmt/out.ts
Symbolic link
1
test/formatters/samplecode/denofmt/out.ts
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../denofmt-ts/out.ts
|
1
test/formatters/samplecode/denofmt/out.tsx
Symbolic link
1
test/formatters/samplecode/denofmt/out.tsx
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../denofmt-tsx/out.tsx
|
Loading…
Add table
Reference in a new issue