Skip to content

Commit 37319a1

Browse files
authored
Replace Prettier with dprint (#1556)
1 parent 78f696d commit 37319a1

File tree

132 files changed

+607
-556
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+607
-556
lines changed

.prettierignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

.prettierrc

Lines changed: 0 additions & 15 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ doc: # runs the documentation tests
1919
env $(YARN_ARGS) yarn exec --silent -- turbo run doc $(TURBO_ARGS)
2020

2121
fix: # runs all auto-fixes
22-
yarn exec --silent -- prettier --write .
22+
yarn exec --silent -- dprint fmt
2323
yarn exec --silent -- sort-package-json --quiet
2424
env $(YARN_ARGS) yarn exec --silent -- turbo run fix $(TURBO_ARGS)
2525

documentation/.prettierignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

documentation/external-actions.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,3 @@
22

33
Text-Runner can use actions stored in NPM modules. This allows sharing actions
44
between projects.
5-
6-
###
7-
8-
TODO
9-
10-
### Creating an external action

documentation/installation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ Read more about:
125125
- the [built-in actions](built-in-actions.md)
126126
- writing your own [user-defined actions](user-defined-actions.md)
127127
- [installing](installation.md) TextRunner
128+
128129
<hr>
129130

130131
Read more about:

documentation/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"type": "module",
77
"scripts": {
88
"doc": "text-runner static --format=summary && text-runner dynamic --format=progress",
9-
"fix": "prettier --write . && sort-package-json --quiet",
10-
"lint": "prettier -l . && sort-package-json --check --quiet && depcheck --config=../.depcheckrc"
9+
"fix": "dprint fmt && sort-package-json --quiet",
10+
"lint": "dprint check && sort-package-json --check --quiet && depcheck --config=../.depcheckrc"
1111
},
1212
"devDependencies": {
1313
"assert-no-diff": "3.0.6",

documentation/user-defined-actions.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,14 @@ TextRunner supports all forms of JavaScript functions as actions:
6969
- synchronous functions
7070
- functions receiving a callback
7171
- functions returning a Promise
72-
- [async
73-
functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function)
72+
- [async functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function)
7473

7574
Examples for custom actions written in ESM are
7675
[here](../examples/custom-action-esm/text-runner/hello-world.js). You can write
7776
functions in [TypeScript](../examples/custom-action-typescript/) or in classic
7877
[CommonJS](../examples/custom-action-commonjs/text-runner/hello-world.js). Throw
79-
an exception to fail a test. Use only [strippable
80-
types](https://nodejs.org/en/learn/typescript/run-natively).
78+
an exception to fail a test. Use only
79+
[strippable types](https://nodejs.org/en/learn/typescript/run-natively).
8180

8281
## Accessing document content
8382

dprint.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"typescript": {
3+
"lineWidth": 120,
4+
"semiColons": "asi",
5+
"arrowFunction.useParentheses": "preferNone",
6+
"trailingCommas": "never",
7+
"quoteStyle": "preferDouble"
8+
},
9+
"json": {
10+
"trailingCommas": "never"
11+
},
12+
"markdown": {
13+
"textWrap": "always",
14+
"lineWidth": 80
15+
},
16+
"markup": {},
17+
"yaml": {},
18+
"excludes": [
19+
"documentation",
20+
"examples",
21+
"shared",
22+
"text-runner-cli",
23+
"text-runner-core",
24+
"text-runner-features",
25+
"tools"
26+
],
27+
"plugins": [
28+
"https://plugins.dprint.dev/typescript-0.94.0.wasm",
29+
"https://plugins.dprint.dev/json-0.20.0.wasm",
30+
"https://plugins.dprint.dev/markdown-0.18.0.wasm",
31+
"https://plugins.dprint.dev/g-plane/markup_fmt-v0.19.0.wasm",
32+
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm"
33+
]
34+
}

examples/custom-action-commonjs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"module": "commonjs",
66
"scripts": {
77
"doc": "text-runner --format=progress",
8-
"fix": "prettier --write . && sort-package-json --quiet",
9-
"lint": "prettier -l . && sort-package-json --check --quiet"
8+
"fix": "dprint fmt && sort-package-json --quiet",
9+
"lint": "dprint check && sort-package-json --check --quiet"
1010
},
1111
"devDependencies": {
1212
"text-runner": "7.0.0",

examples/custom-action-commonjs/text-runner/hello-world.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ async function helloWorldAsync(action) {
1212
}
1313

1414
function helloWorldCallback(action, done) {
15-
setTimeout(function () {
15+
setTimeout(function() {
1616
action.log("Greetings from the callback action!")
1717
setTimeout(done, 1)
1818
}, 1)
1919
}
2020

2121
function helloWorldPromise(action) {
22-
return new Promise(function (resolve) {
23-
setTimeout(function () {
22+
return new Promise(function(resolve) {
23+
setTimeout(function() {
2424
action.log("Greetings from the promise-based action!")
2525
setTimeout(resolve, 1)
2626
}, 1)

examples/custom-action-esm/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"type": "module",
66
"scripts": {
77
"doc": "text-runner --format=progress",
8-
"fix": "prettier --write . && sort-package-json --quiet",
9-
"lint": "prettier -l . && sort-package-json --check --quiet"
8+
"fix": "dprint fmt && sort-package-json --quiet",
9+
"lint": "dprint check && sort-package-json --check --quiet"
1010
},
1111
"devDependencies": {
1212
"text-runner": "7.0.0",

examples/custom-action-esm/text-runner/hello-world.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ export async function helloWorldAsync(action) {
1212
}
1313

1414
export function helloWorldCallback(action, done) {
15-
setTimeout(function () {
15+
setTimeout(function() {
1616
action.log("Greetings from the callback action!")
1717
setTimeout(done, 1)
1818
}, 1)
1919
}
2020

2121
export function helloWorldPromise(action) {
22-
return new Promise(function (resolve) {
23-
setTimeout(function () {
22+
return new Promise(function(resolve) {
23+
setTimeout(function() {
2424
action.log("Greetings from the promise-based action!")
2525
setTimeout(resolve, 1)
2626
}, 1)

examples/custom-action-typescript/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"type": "module",
66
"scripts": {
77
"doc": "text-runner --format=progress",
8-
"fix": "prettier --write . && sort-package-json --quiet",
9-
"lint": "prettier -l . && sort-package-json --check --quiet"
8+
"fix": "dprint fmt && sort-package-json --quiet",
9+
"lint": "dprint check && sort-package-json --check --quiet"
1010
},
1111
"devDependencies": {
1212
"text-runner": "7.0.0",

examples/global-tool/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
This example codebase contains a global tool aptly named `tool`. This file is
44
the documentation for this tool. We want to give usage examples like this one:
55

6-
> You run the tool with a number as an argument. Here is an example:
7-
>
8-
> <pre type="shell/command">
9-
> tool 123
10-
> </pre>
6+
```md
7+
You run the tool with a number as an argument. Here is an example:
8+
9+
<pre type="shell/command">
10+
tool 123
11+
</pre>
12+
```

examples/global-tool/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"type": "module",
66
"scripts": {
77
"doc": "text-runner --format=progress",
8-
"fix": "prettier --write . && sort-package-json --quiet",
9-
"lint": "prettier -l . && sort-package-json --check --quiet"
8+
"fix": "dprint fmt && sort-package-json --quiet",
9+
"lint": "dprint check && sort-package-json --check --quiet"
1010
},
1111
"dependencies": {
1212
"text-runner": "7.0.0",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
"@types/node": "22.13.5",
4545
"chai": "5.2.0",
4646
"depcheck": "1.4.7",
47+
"dprint": "0.49.0",
4748
"eslint": "9.21.0",
4849
"eslint-plugin-perfectionist": "4.9.0",
4950
"lerna": "8.2.0",
50-
"prettier": "3.5.2",
5151
"sort-package-json": "2.15.0",
5252
"ts-json-schema-generator": "2.3.0",
5353
"turbo": "2.4.4",

shared/cucumber-steps/.prettierignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

shared/cucumber-steps/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"scripts": {
88
"build": "tsc -p tsconfig-build.json",
99
"clean": "rm -rf dist",
10-
"fix": "eslint --fix --ignore-pattern=dist/ . && prettier --write . && sort-package-json --quiet",
11-
"lint": "prettier -l . && sort-package-json --check --quiet && eslint --ignore-pattern=dist/ . && depcheck --config=../../.depcheckrc",
10+
"fix": "eslint --fix --ignore-pattern=dist/ . && dprint fmt && sort-package-json --quiet",
11+
"lint": "dprint check && sort-package-json --check --quiet && eslint --ignore-pattern=dist/ . && depcheck --config=../../.depcheckrc",
1212
"unit": "node --test --import tsx 'src/**/*.test.ts'"
1313
},
1414
"devDependencies": {

shared/cucumber-steps/src/env.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ import { endChildProcesses } from "end-child-processes"
44
import * as workspace from "./helpers/workspace.js"
55
import { TRWorld } from "./world.js"
66

7-
cucumber.BeforeAll(async function () {
7+
cucumber.BeforeAll(async function() {
88
await workspace.backup()
99
})
1010

11-
cucumber.After({ timeout: 20_000 }, async function (this: TRWorld) {
11+
cucumber.After({ timeout: 20_000 }, async function(this: TRWorld) {
1212
await endChildProcesses()
1313
await workspace.restore()
1414
})
1515

16-
cucumber.Before({ tags: "@debug" }, function (this: TRWorld) {
16+
cucumber.Before({ tags: "@debug" }, function(this: TRWorld) {
1717
this.debug = true
1818
})
1919

20-
cucumber.After({ tags: "@debug" }, function (this: TRWorld) {
20+
cucumber.After({ tags: "@debug" }, function(this: TRWorld) {
2121
this.debug = false
2222
})

0 commit comments

Comments
 (0)