Skip to content

Commit d4e4c0a

Browse files
committed
chore: dprint migration
- prettier 3.0 formatting has degraded in quality for js-like files, but the team refuses to fix it - prettier can be removed completely once dprint has its own yaml plugin - prettier formatting markdown was always subpar; it never played nicely with markdownlint - prettier/prettier#15358 - prettier/prettier#5715 - prettier/prettier#11881 - dprint/dprint#736 - dprint/dprint-plugin-typescript#432 Signed-off-by: Lexus Drumgold <[email protected]>
1 parent 0e939d1 commit d4e4c0a

File tree

106 files changed

+891
-1947
lines changed

Some content is hidden

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

106 files changed

+891
-1947
lines changed

.dictionary.txt

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ dequal
1414
desegment
1515
dessant
1616
dohm
17+
dprint
1718
fbca
1819
feff
1920
ggshield
@@ -37,6 +38,7 @@ pathe
3738
pkgs
3839
preid
3940
promisable
41+
shfmt
4042
stringafiable
4143
tryit
4244
tscu
@@ -45,5 +47,6 @@ unescapes
4547
unstub
4648
vates
4749
vitest
50+
yamlfmt
4851
yarnrc
4952
zyxwvutsrqponmlkjihgfedcba

.dprint.jsonc

+150
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
{
2+
"$schema": "https://dprint.dev/schemas/v0.json",
3+
"excludes": [
4+
"!**/__fixtures__/**/dist/",
5+
"!**/__fixtures__/**/node_modules/",
6+
"!**/typings/**/dist/",
7+
"**/*.patch",
8+
"**/*.snap",
9+
"**/*config.*.timestamp*",
10+
"**/.temp/",
11+
"**/.vercel/",
12+
"**/__tests__/report.json",
13+
"**/coverage/",
14+
"**/dist/",
15+
"**/node_modules",
16+
"**/tsconfig*temp.json",
17+
".git/",
18+
".husky/_/",
19+
".yarn/",
20+
"CHANGELOG.md",
21+
"LICENSE.md",
22+
"RELEASE_NOTES.md",
23+
"yarn.lock"
24+
],
25+
"exec": {
26+
"commands": [
27+
{
28+
"command": "node ./dprint/prettier.mjs {{file_path}}",
29+
"exts": ["yaml", "yml"],
30+
"stdin": true
31+
},
32+
{
33+
"command": "node ./dprint/shfmt.mjs {{file_path}}",
34+
"exts": ["sh", "txt", "zsh"],
35+
"fileNames": [
36+
".editorconfig",
37+
".env",
38+
".env.local",
39+
".env.repo",
40+
".eslintcache",
41+
".eslintignore",
42+
".gitattributes",
43+
".gitconfig",
44+
".gitignore",
45+
".markdownlintignore",
46+
".npmrc",
47+
".nvmrc",
48+
"Brewfile",
49+
"commit-msg",
50+
"pre-commit",
51+
"pre-push"
52+
],
53+
"stdin": true
54+
}
55+
]
56+
},
57+
"incremental": true,
58+
"indentWidth": 2,
59+
"json": {
60+
"associations": ["**/*.{json5,jsonc,json}"],
61+
"array.preferSingleLine": false,
62+
"commentLine.forceSpaceAfterSlashes": true,
63+
"ignoreNodeCommentText": "dprint-ignore",
64+
"object.preferSingleLine": false
65+
},
66+
"lineWidth": 80,
67+
"markdown": {
68+
"associations": ["**/*.{md,mdx}"],
69+
"emphasisKind": "asterisks",
70+
"ignoreDirective": "dprint-ignore",
71+
"ignoreEndDirective": "dprint-ignore-end",
72+
"ignoreFileDirective": "dprint-ignore-file",
73+
"ignoreStartDirective": "dprint-ignore-start",
74+
"lineWidth": 120,
75+
"strongKind": "asterisks",
76+
"textWrap": "maintain"
77+
},
78+
"newLineKind": "lf",
79+
"plugins": [
80+
"https://plugins.dprint.dev/typescript-0.87.1.wasm",
81+
"https://plugins.dprint.dev/json-0.17.4.wasm",
82+
"https://plugins.dprint.dev/markdown-0.16.0.wasm",
83+
"https://plugins.dprint.dev/exec-0.4.3.json@42343548b8022c99b1d750be6b894fe6b6c7ee25f72ae9f9082226dd2e515072"
84+
],
85+
"typescript": {
86+
"arrowFunction.useParentheses": "preferNone",
87+
"binaryExpression.linePerExpression": false,
88+
"binaryExpression.operatorPosition": "sameLine",
89+
"binaryExpression.spaceSurroundingBitwiseAndArithmeticOperator": true,
90+
"bracePosition": "sameLine",
91+
"commentLine.forceSpaceAfterSlashes": true,
92+
"constructSignature.spaceAfterNewKeyword": true,
93+
"constructor.spaceBeforeParentheses": false,
94+
"constructorType.spaceAfterNewKeyword": true,
95+
"doWhileStatement.spaceAfterWhileKeyword": true,
96+
"enumDeclaration.memberSpacing": "maintain",
97+
"exportDeclaration.forceMultiLine": false,
98+
"exportDeclaration.forceSingleLine": false,
99+
"exportDeclaration.sortNamedExports": "maintain",
100+
"exportDeclaration.spaceSurroundingNamedExports": true,
101+
"forInStatement.spaceAfterForKeyword": true,
102+
"forOfStatement.spaceAfterForKeyword": true,
103+
"forStatement.spaceAfterForKeyword": true,
104+
"forStatement.spaceAfterSemiColons": true,
105+
"functionDeclaration.spaceBeforeParentheses": false,
106+
"functionExpression.spaceAfterFunctionKeyword": false,
107+
"functionExpression.spaceBeforeParentheses": false,
108+
"getAccessor.spaceBeforeParentheses": false,
109+
"ifStatement.spaceAfterIfKeyword": true,
110+
"ignoreFileCommentText": "dprint-ignore-file",
111+
"ignoreNodeCommentText": "dprint-ignore",
112+
"importDeclaration.forceMultiLine": false,
113+
"importDeclaration.forceSingleLine": false,
114+
"importDeclaration.sortNamedImports": "maintain",
115+
"importDeclaration.spaceSurroundingNamedImports": true,
116+
"jsx.bracketPosition": "nextLine",
117+
"jsx.forceNewLinesSurroundingContent": false,
118+
"jsx.multiLineParens": "always",
119+
"jsx.quoteStyle": "preferSingle",
120+
"jsxExpressionContainer.spaceSurroundingExpression": true,
121+
"jsxSelfClosingElement.spaceBeforeSlash": true,
122+
"memberExpression.linePerExpression": false,
123+
"method.spaceBeforeParentheses": false,
124+
"module.sortExportDeclarations": "caseSensitive",
125+
"module.sortImportDeclarations": "caseSensitive",
126+
"newLineKind": "lf",
127+
"nextControlFlowPosition": "sameLine",
128+
"objectExpression.spaceSurroundingProperties": true,
129+
"objectPattern.spaceSurroundingProperties": true,
130+
"operatorPosition": "nextLine",
131+
"preferHanging": true,
132+
"preferSingleLine": false,
133+
"quoteProps": "asNeeded",
134+
"quoteStyle": "alwaysSingle",
135+
"semiColons": "asi",
136+
"setAccessor.spaceBeforeParentheses": false,
137+
"singleBodyPosition": "sameLine",
138+
"spaceAround": false,
139+
"spaceSurroundingProperties": true,
140+
"taggedTemplate.spaceBeforeLiteral": false,
141+
"trailingCommas": "never",
142+
"typeAnnotation.spaceBeforeColon": false,
143+
"typeAssertion.spaceBeforeExpression": false,
144+
"typeLiteral.separatorKind.singleLine": "semiColon",
145+
"typeLiteral.spaceSurroundingProperties": true,
146+
"useBraces": "maintain",
147+
"whileStatement.spaceAfterWhileKeyword": true
148+
},
149+
"useTabs": false
150+
}

.editorconfig

+8-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,14 @@ max_line_length = 120
3232

3333
# shellscript
3434
[*.sh]
35+
binary_next_line = true
36+
function_next_line = false
37+
keep_comments = true
38+
keep_padding = false
3539
max_line_length = 100
40+
shell_variant = 0
41+
space_redirects = false
42+
switch_case_indent = true
3643

3744
# snapshots
3845
[*.snap]
@@ -43,5 +50,5 @@ max_line_length = 130
4350
max_line_length = 100
4451

4552
# yaml
46-
[*.yml]
53+
[{*.yaml,*.yml}]
4754
max_line_length = 100

.eslintignore

-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ yarn.lock
2323
!.commitlintrc.*
2424
!.cspell.json
2525
!.github/
26-
!.graphqlrc.yml
2726
!.lintstagedrc.json
2827
!.markdownlint.jsonc
29-
!.prettierrc.json
3028
!.vscode/
3129
!.yarnrc.yml

0 commit comments

Comments
 (0)