Skip to content

Commit 7f578c9

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 + better json5 support - prettier markdown formatting 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 <unicornware@flexdevelopment.llc>
1 parent c7be6f0 commit 7f578c9

28 files changed

+522
-1594
lines changed

.dictionary.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dequal
1313
dessant
1414
dists
1515
dohm
16+
dprint
1617
emojify
1718
esbuild
1819
evanw
@@ -40,6 +41,7 @@ onrequest
4041
pathe
4142
pkgs
4243
preid
44+
shfmt
4345
swcrc
4446
toodles
4547
tribonacci

.dprint.jsonc

Lines changed: 150 additions & 0 deletions
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": ["json5", "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": ["**/*.{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

Lines changed: 8 additions & 1 deletion
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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
**/*.snap
77
**/*config.*.timestamp*
88
**/.DS_Store
9-
**/.temp/
109
**/__tests__/report.json
1110
**/coverage/
11+
**/.temp/
1212
**/dist/
1313
**/node_modules/
1414
**/tsconfig*temp.json
@@ -23,10 +23,9 @@ yarn.lock
2323
!.codecov.yml
2424
!.commitlintrc.*
2525
!.cspell.json
26+
!.dprint.*
2627
!.github/
27-
!.graphqlrc.yml
2828
!.lintstagedrc.json
2929
!.markdownlint.jsonc
30-
!.prettierrc.json
3130
!.vscode/
3231
!.yarnrc.yml

.eslintrc.base.cjs

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const config = {
3131
[require('./tsconfig.build.json').compilerOptions.target]: true,
3232
node: true
3333
},
34-
extends: ['plugin:prettier/recommended'],
34+
extends: [],
3535
overrides: [
3636
{
3737
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
@@ -56,7 +56,6 @@ const config = {
5656
'import',
5757
'jsdoc',
5858
'node',
59-
'prettier',
6059
'promise',
6160
'unicorn'
6261
],
@@ -958,14 +957,6 @@ const config = {
958957
'jsonc/no-comments': 0
959958
}
960959
},
961-
{
962-
extends: ['plugin:@graphql-eslint/operations-all'],
963-
files: '**/*.gql',
964-
rules: {
965-
'@graphql-eslint/no-anonymous-operations': 0,
966-
'@graphql-eslint/require-id-when-available': 0
967-
}
968-
},
969960
{
970961
files: ['**/package.json'],
971962
rules: {
@@ -1070,7 +1061,6 @@ const config = {
10701061
parser: 'yaml-eslint-parser',
10711062
plugins: ['yml'],
10721063
rules: {
1073-
'prettier/prettier': 0,
10741064
'spaced-comment': 0,
10751065
'yml/block-mapping': 2,
10761066
'yml/block-mapping-question-indicator-newline': [2, 'never'],
@@ -1167,14 +1157,15 @@ const config = {
11671157
files: [
11681158
'.github/dependabot.yml',
11691159
'.github/workflows/*.yml',
1170-
'action.yml'
1160+
'action.yml',
1161+
'docker*.yml'
11711162
],
11721163
rules: {
11731164
'yml/sort-keys': 0
11741165
}
11751166
},
11761167
{
1177-
files: ['.github/workflows/*.yml', '.yarnrc.yml'],
1168+
files: ['.github/workflows/*.yml', '.yarnrc.yml', 'docker*.yml'],
11781169
rules: {
11791170
'yml/key-name-casing': 0
11801171
}
@@ -1186,11 +1177,9 @@ const config = {
11861177
}
11871178
}
11881179
],
1189-
plugins: ['prettier'],
1180+
plugins: [],
11901181
reportUnusedDisableDirectives: true,
1191-
rules: {
1192-
'prettier/prettier': [2, {}, { usePrettierrc: true }]
1193-
},
1182+
rules: {},
11941183
settings: {
11951184
'import/parsers': {
11961185
'@typescript-eslint/parser': ['.cts', '.mts', '.ts', '.tsx']

.github/graphql/queries/linked-issues.gql

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

.github/workflows/label-linked-issues.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#pull_request
1111
# - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch
1212
# - https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions
13+
# - https://docs.github.com/graphql/overview/explorer
1314
# - https://docs.github.com/graphql/reference/objects#pullrequest
1415
# - https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request
1516
# - https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_dispatch

.graphqlrc.yml

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

.lintstagedrc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"*": ["prettier --check", "cspell lint --color --no-progress --relative $@"],
3-
"**/*.{cjs,cts,gql,js,json,json5,jsonc,md,mjs,mts,ts,yml}": [
2+
"*": ["dprint check", "cspell lint --color --no-progress --relative $@"],
3+
"**/*.{cjs,cts,js,json,json5,jsonc,jsx,md,mdx,mjs,mts,ts,tsx,yaml,yml}": [
44
"eslint --exit-on-fatal-error"
55
],
66
"**/*.{cts,mts,ts}": "vitest typecheck --changed --run",

.prettierignore

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

0 commit comments

Comments
 (0)