prettier-config-nick2bad4u 1.0.12 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +95 -99
- package/index.d.ts +4 -0
- package/package.json +29 -20
- package/preset.mjs +13 -1
- package/prettier.config.mjs +99 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ The package is ESM-first and exports the config from `preset.mjs`.
|
|
|
20
20
|
|
|
21
21
|
```json
|
|
22
22
|
{
|
|
23
|
-
|
|
23
|
+
"prettier": "prettier-config-nick2bad4u"
|
|
24
24
|
}
|
|
25
25
|
```
|
|
26
26
|
|
|
@@ -46,8 +46,8 @@ export default config;
|
|
|
46
46
|
import prettierConfig from "prettier-config-nick2bad4u";
|
|
47
47
|
|
|
48
48
|
export default {
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
...prettierConfig,
|
|
50
|
+
printWidth: 100,
|
|
51
51
|
};
|
|
52
52
|
```
|
|
53
53
|
|
|
@@ -62,8 +62,8 @@ without duplicating override internals.
|
|
|
62
62
|
import { createConfig } from "prettier-config-nick2bad4u";
|
|
63
63
|
|
|
64
64
|
export default createConfig({
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
extensionlessJsonFiles: ["**/.my-json-rc"],
|
|
66
|
+
extensionlessIniFiles: ["**/.my-ini-rc"],
|
|
67
67
|
});
|
|
68
68
|
```
|
|
69
69
|
|
|
@@ -73,10 +73,10 @@ export default createConfig({
|
|
|
73
73
|
import { createConfig } from "prettier-config-nick2bad4u";
|
|
74
74
|
|
|
75
75
|
export default createConfig({
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
extensionlessJsonFiles: ["**/.custom-json-rc"],
|
|
77
|
+
extensionlessIniFiles: ["**/.custom-ini-rc"],
|
|
78
|
+
replaceDefaultExtensionlessJsonFiles: true,
|
|
79
|
+
replaceDefaultExtensionlessIniFiles: true,
|
|
80
80
|
});
|
|
81
81
|
```
|
|
82
82
|
|
|
@@ -84,21 +84,18 @@ export default createConfig({
|
|
|
84
84
|
|
|
85
85
|
```js
|
|
86
86
|
import {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
createConfig,
|
|
88
|
+
defaultExtensionlessIniFiles,
|
|
89
|
+
defaultExtensionlessJsonFiles,
|
|
90
|
+
extensionlessIniOptions,
|
|
91
|
+
extensionlessJsonOptions,
|
|
92
92
|
} from "prettier-config-nick2bad4u";
|
|
93
93
|
|
|
94
|
-
const myJsonFiles = [
|
|
95
|
-
...defaultExtensionlessJsonFiles,
|
|
96
|
-
"**/.my-extra-json-rc",
|
|
97
|
-
];
|
|
94
|
+
const myJsonFiles = [...defaultExtensionlessJsonFiles, "**/.my-extra-json-rc"];
|
|
98
95
|
|
|
99
96
|
export default createConfig({
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
extensionlessJsonFiles: myJsonFiles,
|
|
98
|
+
replaceDefaultExtensionlessJsonFiles: true,
|
|
102
99
|
});
|
|
103
100
|
|
|
104
101
|
// You can also spread option presets if you build your own override blocks:
|
|
@@ -120,15 +117,15 @@ same plugin/options behavior from a base override and only change a small delta
|
|
|
120
117
|
import { createConfig } from "prettier-config-nick2bad4u";
|
|
121
118
|
|
|
122
119
|
export default createConfig({
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
120
|
+
inheritedOverrides: [
|
|
121
|
+
{
|
|
122
|
+
inheritFrom: "*.ts",
|
|
123
|
+
files: "src/shared-config.ts",
|
|
124
|
+
options: {
|
|
125
|
+
printWidth: 140,
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
],
|
|
132
129
|
});
|
|
133
130
|
```
|
|
134
131
|
|
|
@@ -142,29 +139,29 @@ package.
|
|
|
142
139
|
|
|
143
140
|
```js
|
|
144
141
|
import prettierConfig, {
|
|
145
|
-
|
|
146
|
-
|
|
142
|
+
jsonOverrideOptions,
|
|
143
|
+
typescriptOverrideOptions,
|
|
147
144
|
} from "prettier-config-nick2bad4u";
|
|
148
145
|
|
|
149
146
|
export default {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
147
|
+
...prettierConfig,
|
|
148
|
+
overrides: [
|
|
149
|
+
...(prettierConfig.overrides ?? []),
|
|
150
|
+
{
|
|
151
|
+
files: "src/shared-config.ts",
|
|
152
|
+
options: {
|
|
153
|
+
...typescriptOverrideOptions,
|
|
154
|
+
printWidth: 140,
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
files: "config/custom.json",
|
|
159
|
+
options: {
|
|
160
|
+
...jsonOverrideOptions,
|
|
161
|
+
printWidth: 120,
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
],
|
|
168
165
|
};
|
|
169
166
|
```
|
|
170
167
|
|
|
@@ -177,6 +174,7 @@ Available named override option presets:
|
|
|
177
174
|
- `userJavaScriptOverrideOptions`
|
|
178
175
|
- `markdownOverrideOptions`
|
|
179
176
|
- `mdxOverrideOptions`
|
|
177
|
+
- `yamlOverrideOptions`
|
|
180
178
|
- `tomlOverrideOptions`
|
|
181
179
|
- `xmlOverrideOptions`
|
|
182
180
|
- `phpOverrideOptions`
|
|
@@ -199,41 +197,41 @@ is explicitly present, so there is nothing implicit to break.
|
|
|
199
197
|
import prettierConfig from "prettier-config-nick2bad4u";
|
|
200
198
|
|
|
201
199
|
export default {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
],
|
|
231
|
-
printWidth: 140, // your override
|
|
232
|
-
tsdoc: true,
|
|
233
|
-
useTabs: false,
|
|
234
|
-
},
|
|
235
|
-
},
|
|
200
|
+
...prettierConfig,
|
|
201
|
+
overrides: [
|
|
202
|
+
...(prettierConfig.overrides ?? []),
|
|
203
|
+
{
|
|
204
|
+
files: "src/shared-config.ts",
|
|
205
|
+
options: {
|
|
206
|
+
endOfLine: "lf",
|
|
207
|
+
jsdocBracketSpacing: false,
|
|
208
|
+
jsdocCapitalizeDescription: true,
|
|
209
|
+
jsdocCommentLineStrategy: "keep",
|
|
210
|
+
jsdocDescriptionTag: false,
|
|
211
|
+
jsdocDescriptionWithDot: false,
|
|
212
|
+
jsdocEmptyCommentStrategy: "keep",
|
|
213
|
+
jsdocKeepUnParseAbleExampleIndent: false,
|
|
214
|
+
jsdocLineWrappingStyle: "greedy",
|
|
215
|
+
jsdocPreferCodeFences: true,
|
|
216
|
+
jsdocPrintWidth: 80,
|
|
217
|
+
jsdocSeparateReturnsFromParam: true,
|
|
218
|
+
jsdocSeparateTagGroups: true,
|
|
219
|
+
jsdocSpaces: 1,
|
|
220
|
+
jsdocVerticalAlignment: false,
|
|
221
|
+
multilineArraysWrapThreshold: 2,
|
|
222
|
+
plugins: [
|
|
223
|
+
"@softonus/prettier-plugin-duplicate-remover",
|
|
224
|
+
"prettier-plugin-multiline-arrays",
|
|
225
|
+
"prettier-plugin-jsdoc",
|
|
226
|
+
"prettier-plugin-interpolated-html-tags",
|
|
227
|
+
"prettier-plugin-merge",
|
|
236
228
|
],
|
|
229
|
+
printWidth: 140, // your override
|
|
230
|
+
tsdoc: true,
|
|
231
|
+
useTabs: false,
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
],
|
|
237
235
|
};
|
|
238
236
|
```
|
|
239
237
|
|
|
@@ -249,37 +247,35 @@ If you prefer the original manual discovery approach, this still works:
|
|
|
249
247
|
import prettierConfig from "prettier-config-nick2bad4u";
|
|
250
248
|
|
|
251
249
|
const tsOverride = (prettierConfig.overrides ?? []).find(
|
|
252
|
-
|
|
253
|
-
Array.isArray(override.files) &&
|
|
254
|
-
override.files.includes("*.ts")
|
|
250
|
+
(override) => Array.isArray(override.files) && override.files.includes("*.ts")
|
|
255
251
|
);
|
|
256
252
|
|
|
257
253
|
export default {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
254
|
+
...prettierConfig,
|
|
255
|
+
overrides: [
|
|
256
|
+
...(prettierConfig.overrides ?? []),
|
|
257
|
+
{
|
|
258
|
+
files: "src/shared-config.ts",
|
|
259
|
+
options: {
|
|
260
|
+
...(tsOverride?.options ?? {}),
|
|
261
|
+
printWidth: 140,
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
],
|
|
269
265
|
};
|
|
270
266
|
```
|
|
271
267
|
|
|
272
268
|
## What this config includes
|
|
273
269
|
|
|
274
270
|
- Base formatting options (quotes, semicolons, trailing commas, tab width, etc.)
|
|
275
|
-
- File-specific overrides for JS/TS, Markdown, JSON, TOML, HTML, XML, PowerShell, INI, SQL, shell, and properties files
|
|
271
|
+
- File-specific overrides for JS/TS, Astro, Markdown, JSON, TOML, HTML, XML, PowerShell, INI, SQL, shell, and properties files
|
|
276
272
|
- Plugin-backed formatting for JSDoc, sorted JSON/package.json, and additional language formats
|
|
277
273
|
|
|
278
274
|
## Package surface
|
|
279
275
|
|
|
280
276
|
- Default export: the shared Prettier config object
|
|
281
277
|
- Named export: `config`
|
|
282
|
-
- Named exports: `createConfig`, `defaultExtensionlessJsonFiles`, `defaultExtensionlessIniFiles`, `extensionlessJsonOptions`, `extensionlessIniOptions`, `typescriptOverrideOptions`, `jsonOverrideOptions`, `packageJsonOverrideOptions`, `htmlOverrideOptions`, `userJavaScriptOverrideOptions`, `markdownOverrideOptions`, `mdxOverrideOptions`, `tomlOverrideOptions`, `xmlOverrideOptions`, `phpOverrideOptions`, `sqlOverrideOptions`, `powershellOverrideOptions`, `codeownersOverrideOptions`, `shellOverrideOptions`, `propertiesOverrideOptions`, `iniOverrideOptions`
|
|
278
|
+
- Named exports: `createConfig`, `defaultExtensionlessJsonFiles`, `defaultExtensionlessIniFiles`, `extensionlessJsonOptions`, `extensionlessIniOptions`, `typescriptOverrideOptions`, `jsonOverrideOptions`, `packageJsonOverrideOptions`, `htmlOverrideOptions`, `userJavaScriptOverrideOptions`, `markdownOverrideOptions`, `mdxOverrideOptions`, `astroOverrideOptions`, `yamlOverrideOptions`, `tomlOverrideOptions`, `xmlOverrideOptions`, `phpOverrideOptions`, `sqlOverrideOptions`, `powershellOverrideOptions`, `codeownersOverrideOptions`, `shellOverrideOptions`, `propertiesOverrideOptions`, `iniOverrideOptions`
|
|
283
279
|
- Published files: `prettier.config.mjs`, `preset.mjs`, and `index.d.ts`
|
|
284
280
|
|
|
285
281
|
## Development checks
|
package/index.d.ts
CHANGED
|
@@ -63,6 +63,10 @@ export declare const userJavaScriptOverrideOptions: Readonly<Partial<Config>>;
|
|
|
63
63
|
export declare const markdownOverrideOptions: Readonly<Partial<Config>>;
|
|
64
64
|
/** Shared option preset used by MDX override blocks. */
|
|
65
65
|
export declare const mdxOverrideOptions: Readonly<Partial<Config>>;
|
|
66
|
+
/** Shared option preset used by Astro override blocks. */
|
|
67
|
+
export declare const astroOverrideOptions: Readonly<Partial<Config>>;
|
|
68
|
+
/** Shared option preset used by YAML override blocks. */
|
|
69
|
+
export declare const yamlOverrideOptions: Readonly<Partial<Config>>;
|
|
66
70
|
/** Shared option preset used by TOML override blocks. */
|
|
67
71
|
export declare const tomlOverrideOptions: Readonly<Partial<Config>>;
|
|
68
72
|
/** Shared option preset used by XML-family override blocks. */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://www.schemastore.org/package.json",
|
|
3
3
|
"name": "prettier-config-nick2bad4u",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.14",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Shared Prettier config for Nick2bad4u projects.",
|
|
7
7
|
"keywords": [
|
|
@@ -49,13 +49,14 @@
|
|
|
49
49
|
"build": "npm run typecheck",
|
|
50
50
|
"changelog:generate": "git-cliff --config cliff.toml --output CHANGELOG.md",
|
|
51
51
|
"changelog:preview": "git-cliff --config cliff.toml --unreleased",
|
|
52
|
-
"changelog:release-notes": "git-cliff --config cliff.toml --
|
|
52
|
+
"changelog:release-notes": "git-cliff --config cliff.toml --current --strip all",
|
|
53
53
|
"coverage": "vitest run --coverage",
|
|
54
54
|
"lint": "cross-env NODE_OPTIONS=--max_old_space_size=8192 eslint . --cache --cache-strategy content --cache-location .cache/.eslintcache",
|
|
55
|
-
"lint:all": "npm run lint && npm run typecheck && npm run test && npm run lint:prettier && npm run lint:package && npm run lint:yaml && npm run lint:secretlint",
|
|
55
|
+
"lint:all": "npm run lint && npm run typecheck && npm run test && npm run lint:prettier && npm run lint:package && npm run lint:yaml && npm run lint:yamllint && npm run lint:gitleaks && npm run lint:secretlint",
|
|
56
56
|
"lint:all:fix": "npm run lint:fix && npm run lint:prettier:fix && npm run lint:package:fix && npm run typecheck && npm run test && npm run lint:yaml:fix && npm run lint:secretlint",
|
|
57
57
|
"lint:attw": "attw --pack . --profile esm-only",
|
|
58
58
|
"lint:fix": "npm run lint -- --fix",
|
|
59
|
+
"lint:gitleaks": "gitleaks dir --config .gitleaks.toml .",
|
|
59
60
|
"lint:package": "npm run lint:package-sort && npm run lint:package-json && npm run lint:package-check",
|
|
60
61
|
"lint:package:fix": "sort-package-json package.json",
|
|
61
62
|
"lint:package-check": "npm run package:check && npm run lint:publint && npm run lint:attw",
|
|
@@ -68,6 +69,7 @@
|
|
|
68
69
|
"lint:secretlint": "secretlint --secretlintrc .secretlintrc.cjs --secretlintignore .gitignore \"**/*\"",
|
|
69
70
|
"lint:yaml": "eslint --cache --cache-strategy content --cache-location .cache/.eslintcache \"**/*.{yml,yaml}\"",
|
|
70
71
|
"lint:yaml:fix": "npm run lint:yaml -- --fix",
|
|
72
|
+
"lint:yamllint": "yamllint -c .yamllint .",
|
|
71
73
|
"package:check": "npm pack --dry-run",
|
|
72
74
|
"release:check": "npm run release:verify",
|
|
73
75
|
"release:verify": "npm run build && npm run lint:all:fix && npm run lint:package:fix && npm run test:coverage",
|
|
@@ -85,45 +87,52 @@
|
|
|
85
87
|
"@prettier/plugin-php": "^0.25.0",
|
|
86
88
|
"@prettier/plugin-xml": "^3.4.2",
|
|
87
89
|
"@softonus/prettier-plugin-duplicate-remover": "^1.1.2",
|
|
90
|
+
"prettier-plugin-astro": "^0.14.1",
|
|
88
91
|
"prettier-plugin-codeowners": "^0.1.1",
|
|
89
92
|
"prettier-plugin-ini": "^1.3.0",
|
|
90
93
|
"prettier-plugin-interpolated-html-tags": "^2.0.1",
|
|
91
|
-
"prettier-plugin-jsdoc": "^1.8.
|
|
94
|
+
"prettier-plugin-jsdoc": "^1.8.1",
|
|
92
95
|
"prettier-plugin-merge": "^0.10.1",
|
|
93
|
-
"prettier-plugin-multiline-arrays": "^4.1.
|
|
96
|
+
"prettier-plugin-multiline-arrays": "^4.1.9",
|
|
94
97
|
"prettier-plugin-packagejson": "^3.0.2",
|
|
95
|
-
"prettier-plugin-powershell": "^2.1.
|
|
98
|
+
"prettier-plugin-powershell": "^2.1.4",
|
|
96
99
|
"prettier-plugin-properties": "^0.3.1",
|
|
97
100
|
"prettier-plugin-sh": "^0.18.1",
|
|
98
101
|
"prettier-plugin-sort-json": "^4.2.0",
|
|
99
102
|
"prettier-plugin-sql": "^0.20.0",
|
|
100
|
-
"prettier-plugin-toml": "^2.0.6"
|
|
103
|
+
"prettier-plugin-toml": "^2.0.6",
|
|
104
|
+
"prettier-plugin-yaml": "^1.2.0"
|
|
101
105
|
},
|
|
102
106
|
"devDependencies": {
|
|
103
|
-
"@arethetypeswrong/cli": "^0.18.
|
|
107
|
+
"@arethetypeswrong/cli": "^0.18.3",
|
|
104
108
|
"@codecov/bundle-analyzer": "^2.0.1",
|
|
105
|
-
"@
|
|
106
|
-
"@
|
|
109
|
+
"@microsoft/tsdoc-config": "^0.18.1",
|
|
110
|
+
"@types/node": "^25.9.1",
|
|
111
|
+
"@vitest/coverage-v8": "^4.1.8",
|
|
107
112
|
"cross-env": "^10.1.0",
|
|
108
|
-
"eslint": "^10.
|
|
109
|
-
"eslint-config-nick2bad4u": "^1.
|
|
113
|
+
"eslint": "^10.4.1",
|
|
114
|
+
"eslint-config-nick2bad4u": "^1.2.7",
|
|
110
115
|
"git-cliff": "^2.13.1",
|
|
111
|
-
"
|
|
116
|
+
"gitleaks-config-nick2bad4u": "^1.0.2",
|
|
117
|
+
"npm-check-updates": "^22.2.2",
|
|
112
118
|
"npm-package-json-lint": "^10.4.0",
|
|
119
|
+
"npm-package-json-lint-config-nick2bad4u": "^1.0.2",
|
|
113
120
|
"picocolors": "^1.1.1",
|
|
114
121
|
"prettier": "^3.8.3",
|
|
115
|
-
"publint": "^0.3.
|
|
116
|
-
"secretlint": "^13.0.
|
|
117
|
-
"secretlint-config-nick2bad4u": "^1.0
|
|
118
|
-
"sort-package-json": "^
|
|
122
|
+
"publint": "^0.3.21",
|
|
123
|
+
"secretlint": "^13.0.2",
|
|
124
|
+
"secretlint-config-nick2bad4u": "^1.1.0",
|
|
125
|
+
"sort-package-json": "^4.0.0",
|
|
126
|
+
"tsdoc-config-nick2bad4u": "^1.0.4",
|
|
119
127
|
"typescript": "^6.0.3",
|
|
120
|
-
"vite": "^8.0.
|
|
121
|
-
"vitest": "^4.1.
|
|
128
|
+
"vite": "^8.0.16",
|
|
129
|
+
"vitest": "^4.1.8",
|
|
130
|
+
"yamllint-config-nick2bad4u": "^1.0.1"
|
|
122
131
|
},
|
|
123
132
|
"peerDependencies": {
|
|
124
133
|
"prettier": "^3.0.0 || ^3.8.3"
|
|
125
134
|
},
|
|
126
|
-
"packageManager": "npm@11.
|
|
135
|
+
"packageManager": "npm@11.16.0",
|
|
127
136
|
"engines": {
|
|
128
137
|
"node": ">=22.0.0"
|
|
129
138
|
},
|
package/preset.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import sharedPrettierConfig, {
|
|
2
|
+
astroOverrideOptions as astroOverrideOptionsInternal,
|
|
2
3
|
codeownersOverrideOptions as codeownersOverrideOptionsInternal,
|
|
3
4
|
createConfig as createConfigInternal,
|
|
4
5
|
defaultExtensionlessIniFiles as defaultExtensionlessIniFilesInternal,
|
|
@@ -20,6 +21,7 @@ import sharedPrettierConfig, {
|
|
|
20
21
|
typescriptOverrideOptions as typescriptOverrideOptionsInternal,
|
|
21
22
|
userJavaScriptOverrideOptions as userJavaScriptOverrideOptionsInternal,
|
|
22
23
|
xmlOverrideOptions as xmlOverrideOptionsInternal,
|
|
24
|
+
yamlOverrideOptions as yamlOverrideOptionsInternal,
|
|
23
25
|
} from "./prettier.config.mjs";
|
|
24
26
|
|
|
25
27
|
/** Named export — use when you want to spread or inspect individual options. */
|
|
@@ -43,7 +45,7 @@ export const config = Object.freeze(sharedPrettierConfig);
|
|
|
43
45
|
* }>
|
|
44
46
|
* ) => import("prettier").Config}
|
|
45
47
|
*/
|
|
46
|
-
|
|
48
|
+
|
|
47
49
|
export const createConfig = (options = {}) => createConfigInternal(options);
|
|
48
50
|
|
|
49
51
|
/** Default extensionless INI-like globs used by this shared configuration. */
|
|
@@ -101,6 +103,16 @@ export const mdxOverrideOptions = Object.freeze({
|
|
|
101
103
|
...mdxOverrideOptionsInternal,
|
|
102
104
|
});
|
|
103
105
|
|
|
106
|
+
/** Shared option preset used by Astro override blocks. */
|
|
107
|
+
export const astroOverrideOptions = Object.freeze({
|
|
108
|
+
...astroOverrideOptionsInternal,
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
/** Shared option preset used by YAML override blocks. */
|
|
112
|
+
export const yamlOverrideOptions = Object.freeze({
|
|
113
|
+
...yamlOverrideOptionsInternal,
|
|
114
|
+
});
|
|
115
|
+
|
|
104
116
|
/** Shared option preset used by TOML override blocks. */
|
|
105
117
|
export const tomlOverrideOptions = Object.freeze({
|
|
106
118
|
...tomlOverrideOptionsInternal,
|
package/prettier.config.mjs
CHANGED
|
@@ -171,35 +171,92 @@ export const mdxOverrideOptions = Object.freeze({
|
|
|
171
171
|
useTabs: false,
|
|
172
172
|
});
|
|
173
173
|
|
|
174
|
+
/** @type {Readonly<Partial<import("prettier").Config>>} */
|
|
175
|
+
export const astroOverrideOptions = Object.freeze({
|
|
176
|
+
endOfLine: "lf",
|
|
177
|
+
parser: "astro",
|
|
178
|
+
plugins: ["prettier-plugin-astro"],
|
|
179
|
+
printWidth: 100,
|
|
180
|
+
tabWidth: 4,
|
|
181
|
+
useTabs: false,
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
/** @type {Readonly<Partial<import("prettier").Config>>} */
|
|
185
|
+
export const yamlOverrideOptions = Object.freeze({
|
|
186
|
+
endOfLine: "lf",
|
|
187
|
+
parser: "yaml",
|
|
188
|
+
plugins: ["prettier-plugin-yaml"],
|
|
189
|
+
tabWidth: 4,
|
|
190
|
+
useTabs: false,
|
|
191
|
+
yamlQuoteKeys: false,
|
|
192
|
+
yamlQuoteValues: true,
|
|
193
|
+
yamlQuoteValuesMatching: "^(?:yes|no|on|off)$",
|
|
194
|
+
});
|
|
195
|
+
|
|
174
196
|
/** @type {Readonly<Partial<import("prettier").Config>>} */
|
|
175
197
|
export const tomlOverrideOptions = Object.freeze({
|
|
198
|
+
alignComments: true,
|
|
199
|
+
alignEntries: true,
|
|
200
|
+
allowedBlankLines: 1,
|
|
201
|
+
arrayAutoCollapse: true,
|
|
202
|
+
arrayAutoExpand: true,
|
|
203
|
+
compactArrays: false,
|
|
204
|
+
compactEntries: false,
|
|
205
|
+
compactInlineTables: false,
|
|
176
206
|
endOfLine: "lf",
|
|
207
|
+
indentEntries: true,
|
|
208
|
+
indentTables: true,
|
|
177
209
|
plugins: ["prettier-plugin-toml"],
|
|
178
210
|
printWidth: 120,
|
|
211
|
+
reorderKeys: false,
|
|
179
212
|
tabWidth: 4,
|
|
213
|
+
trailingComma: "none",
|
|
180
214
|
useTabs: false,
|
|
181
215
|
});
|
|
182
216
|
|
|
183
217
|
/** @type {Readonly<Partial<import("prettier").Config>>} */
|
|
184
218
|
export const xmlOverrideOptions = Object.freeze({
|
|
219
|
+
bracketSameLine: false,
|
|
185
220
|
endOfLine: "lf",
|
|
186
221
|
plugins: ["@prettier/plugin-xml"],
|
|
222
|
+
printWidth: 80,
|
|
223
|
+
singleAttributePerLine: false,
|
|
187
224
|
tabWidth: 2,
|
|
188
225
|
useTabs: false,
|
|
226
|
+
xmlQuoteAttributes: "preserve",
|
|
227
|
+
xmlSelfClosingSpace: true,
|
|
228
|
+
xmlSortAttributesByKey: false,
|
|
229
|
+
xmlWhitespaceSensitivity: "strict",
|
|
189
230
|
});
|
|
190
231
|
|
|
191
232
|
/** @type {Readonly<Partial<import("prettier").Config>>} */
|
|
192
233
|
export const phpOverrideOptions = Object.freeze({
|
|
234
|
+
braceStyle: "per-cs",
|
|
193
235
|
endOfLine: "lf",
|
|
194
236
|
phpVersion: "auto",
|
|
195
237
|
plugins: ["@prettier/plugin-php"],
|
|
238
|
+
printWidth: 80,
|
|
239
|
+
singleQuote: false,
|
|
240
|
+
tabWidth: 4,
|
|
241
|
+
trailingCommaPHP: true,
|
|
196
242
|
useTabs: false,
|
|
197
243
|
});
|
|
198
244
|
|
|
199
245
|
/** @type {Readonly<Partial<import("prettier").Config>>} */
|
|
200
246
|
export const sqlOverrideOptions = Object.freeze({
|
|
247
|
+
dataTypeCase: "preserve",
|
|
248
|
+
denseOperators: false,
|
|
201
249
|
endOfLine: "lf",
|
|
250
|
+
expressionWidth: 50,
|
|
251
|
+
formatter: "sql-formatter",
|
|
252
|
+
functionCase: "preserve",
|
|
253
|
+
identifierCase: "preserve",
|
|
254
|
+
indentStyle: "standard",
|
|
255
|
+
keywordCase: "preserve",
|
|
202
256
|
language: "sqlite",
|
|
257
|
+
linesBetweenQueries: 1,
|
|
258
|
+
logicalOperatorNewline: "before",
|
|
259
|
+
newlineBeforeSemicolon: false,
|
|
203
260
|
plugins: ["prettier-plugin-sql"],
|
|
204
261
|
useTabs: false,
|
|
205
262
|
});
|
|
@@ -208,6 +265,19 @@ export const sqlOverrideOptions = Object.freeze({
|
|
|
208
265
|
export const powershellOverrideOptions = Object.freeze({
|
|
209
266
|
endOfLine: "lf",
|
|
210
267
|
plugins: ["prettier-plugin-powershell"],
|
|
268
|
+
powershellBlankLineAfterParam: true,
|
|
269
|
+
powershellBlankLinesBetweenFunctions: 1,
|
|
270
|
+
powershellBraceStyle: "1tbs",
|
|
271
|
+
powershellIndentSize: 4,
|
|
272
|
+
powershellIndentStyle: "spaces",
|
|
273
|
+
powershellKeywordCase: "lower",
|
|
274
|
+
powershellLineWidth: 120,
|
|
275
|
+
powershellPreferSingleQuote: false,
|
|
276
|
+
powershellPreset: "invoke-formatter",
|
|
277
|
+
powershellRewriteAliases: false,
|
|
278
|
+
powershellRewriteWriteHost: false,
|
|
279
|
+
powershellSortHashtableKeys: false,
|
|
280
|
+
powershellTrailingComma: "none",
|
|
211
281
|
useTabs: false,
|
|
212
282
|
});
|
|
213
283
|
|
|
@@ -220,8 +290,17 @@ export const codeownersOverrideOptions = Object.freeze({
|
|
|
220
290
|
|
|
221
291
|
/** @type {Readonly<Partial<import("prettier").Config>>} */
|
|
222
292
|
export const shellOverrideOptions = Object.freeze({
|
|
293
|
+
binaryNextLine: true,
|
|
223
294
|
endOfLine: "lf",
|
|
295
|
+
functionNextLine: false,
|
|
296
|
+
indent: 4,
|
|
297
|
+
keepComments: true,
|
|
298
|
+
keepPadding: false,
|
|
299
|
+
minify: false,
|
|
224
300
|
plugins: ["prettier-plugin-sh"],
|
|
301
|
+
singleLine: false,
|
|
302
|
+
spaceRedirects: true,
|
|
303
|
+
switchCaseIndent: true,
|
|
225
304
|
useTabs: false,
|
|
226
305
|
});
|
|
227
306
|
|
|
@@ -249,7 +328,7 @@ export const iniOverrideOptions = Object.freeze({
|
|
|
249
328
|
* options?: Readonly<CreateConfigOptions>
|
|
250
329
|
* ) => import("prettier").Config}
|
|
251
330
|
*/
|
|
252
|
-
|
|
331
|
+
|
|
253
332
|
export const createConfig = (options = {}) => {
|
|
254
333
|
const {
|
|
255
334
|
extensionlessIniFiles = [],
|
|
@@ -307,6 +386,25 @@ export const createConfig = (options = {}) => {
|
|
|
307
386
|
files: "*.mdx",
|
|
308
387
|
options: mdxOverrideOptions,
|
|
309
388
|
},
|
|
389
|
+
{
|
|
390
|
+
files: "*.astro",
|
|
391
|
+
options: astroOverrideOptions,
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
files: [
|
|
395
|
+
"*.yaml",
|
|
396
|
+
"*.yml",
|
|
397
|
+
"**/.clang-format",
|
|
398
|
+
"**/.clang-tidy",
|
|
399
|
+
"**/.clangd",
|
|
400
|
+
"**/.yamlfmt",
|
|
401
|
+
"**/.yamllint",
|
|
402
|
+
".yamllint",
|
|
403
|
+
".yamllint.yaml",
|
|
404
|
+
".yamllint.yml",
|
|
405
|
+
],
|
|
406
|
+
options: yamlOverrideOptions,
|
|
407
|
+
},
|
|
310
408
|
{
|
|
311
409
|
files: "*.toml",
|
|
312
410
|
options: tomlOverrideOptions,
|