@standard-config/prettier 1.0.2 → 1.2.0
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 +7 -2
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +94 -37
- package/dist/index.mjs.map +1 -0
- package/package.json +21 -18
package/README.md
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
[](https://www.npmjs.com/package/@standard-config/prettier)
|
|
2
|
+
[](https://github.com/standard-config/prettier/actions/workflows/test.yaml)
|
|
3
|
+
[](https://codecov.io/github/standard-config/prettier)
|
|
4
|
+
|
|
1
5
|
# @standard-config/prettier
|
|
2
6
|
|
|
3
7
|
Curated Prettier config for modern TypeScript projects.
|
|
4
8
|
|
|
5
9
|
- Enables the [`oxc` parser](https://oxc.rs/docs/guide/usage/parser.html) for lightning-fast TypeScript formatting.
|
|
10
|
+
- Formats shell scripts out of the box, including `git` hooks.
|
|
6
11
|
- Sorts all JSON files, with curated order patterns for common config files: `package.json`, `tsconfig.json`, `.oxlintrc.json`, and more.
|
|
7
12
|
|
|
8
13
|
## Install
|
|
@@ -25,12 +30,12 @@ import { defineConfig } from '@standard-config/prettier';
|
|
|
25
30
|
export default defineConfig();
|
|
26
31
|
```
|
|
27
32
|
|
|
28
|
-
|
|
33
|
+
You can override the defaults by passing your own [config options](https://prettier.io/docs/options).
|
|
29
34
|
|
|
30
35
|
```ts
|
|
31
36
|
import { defineConfig } from '@standard-config/prettier';
|
|
32
37
|
|
|
33
38
|
export default defineConfig({
|
|
34
|
-
|
|
39
|
+
semi: false,
|
|
35
40
|
});
|
|
36
41
|
```
|
package/dist/index.d.mts
CHANGED
|
@@ -15,4 +15,5 @@ declare function defineConfig(config?: Config): Config;
|
|
|
15
15
|
//#region src/prioritize-keys/index.d.ts
|
|
16
16
|
declare function prioritizeKeys(...keys: ReadonlyArray<string>): string;
|
|
17
17
|
//#endregion
|
|
18
|
-
export { defineConfig, prioritizeKeys };
|
|
18
|
+
export { defineConfig, prioritizeKeys };
|
|
19
|
+
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as pluginOxidation from "@prettier/plugin-oxc";
|
|
2
2
|
import * as pluginPackageJSON from "prettier-plugin-packagejson";
|
|
3
3
|
import * as pluginSortJSON from "prettier-plugin-sort-json";
|
|
4
|
+
import * as pluginShell from "prettier-plugin-sh";
|
|
4
5
|
import { klona } from "klona/lite";
|
|
5
6
|
|
|
6
7
|
//#region src/prioritize-keys/index.ts
|
|
@@ -15,27 +16,58 @@ function prioritizeKeys(...keys) {
|
|
|
15
16
|
|
|
16
17
|
//#endregion
|
|
17
18
|
//#region src/config.ts
|
|
18
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Shell files can’t be reliably identified by name alone—they’re recognized by
|
|
21
|
+
* the shebang, not the extension. As a result, shell formatting options
|
|
22
|
+
* (two-space indentation) must be defined as the global defaults.
|
|
23
|
+
*
|
|
24
|
+
* This requires overriding those options for other file types individually
|
|
25
|
+
* with what we consider the actual defaults. This object defines them.
|
|
26
|
+
*/
|
|
27
|
+
const DEFAULT_OPTIONS = {
|
|
28
|
+
tabWidth: 4,
|
|
29
|
+
useTabs: true
|
|
30
|
+
};
|
|
31
|
+
const DEFAULT_CONFIG = {
|
|
32
|
+
plugins: [pluginOxidation, pluginShell],
|
|
19
33
|
bracketSpacing: true,
|
|
20
34
|
printWidth: 80,
|
|
21
35
|
quoteProps: "consistent",
|
|
22
36
|
singleQuote: true,
|
|
23
|
-
tabWidth:
|
|
37
|
+
tabWidth: 2,
|
|
24
38
|
trailingComma: "es5",
|
|
25
|
-
useTabs:
|
|
39
|
+
useTabs: false,
|
|
26
40
|
overrides: [
|
|
27
41
|
{
|
|
28
42
|
files: ["*.css", "*.scss"],
|
|
29
43
|
options: {
|
|
44
|
+
...DEFAULT_OPTIONS,
|
|
30
45
|
printWidth: 100,
|
|
31
46
|
singleQuote: false
|
|
32
47
|
}
|
|
33
48
|
},
|
|
49
|
+
(
|
|
50
|
+
/**
|
|
51
|
+
* Fish file formatting follows the output of `fish_indent`, which
|
|
52
|
+
* defaults to four-space indentation.
|
|
53
|
+
*/
|
|
54
|
+
{
|
|
55
|
+
files: ["*.fish"],
|
|
56
|
+
options: { tabWidth: 4 }
|
|
57
|
+
}),
|
|
58
|
+
{
|
|
59
|
+
files: [
|
|
60
|
+
"*.graphql",
|
|
61
|
+
"*.graphqls",
|
|
62
|
+
"*.gql"
|
|
63
|
+
],
|
|
64
|
+
options: { ...DEFAULT_OPTIONS }
|
|
65
|
+
},
|
|
34
66
|
{
|
|
35
|
-
files: ["*.html"],
|
|
67
|
+
files: ["*.html", "*.htm"],
|
|
36
68
|
options: {
|
|
37
|
-
|
|
38
|
-
|
|
69
|
+
...DEFAULT_OPTIONS,
|
|
70
|
+
printWidth: 100
|
|
39
71
|
}
|
|
40
72
|
},
|
|
41
73
|
{
|
|
@@ -46,18 +78,43 @@ const config = {
|
|
|
46
78
|
"*.mjs"
|
|
47
79
|
],
|
|
48
80
|
options: {
|
|
49
|
-
|
|
81
|
+
...DEFAULT_OPTIONS,
|
|
50
82
|
parser: "oxc"
|
|
51
83
|
}
|
|
52
84
|
},
|
|
53
85
|
{
|
|
54
|
-
files: [
|
|
86
|
+
files: [
|
|
87
|
+
"*.json",
|
|
88
|
+
"*.jsonc",
|
|
89
|
+
"*.json5"
|
|
90
|
+
],
|
|
55
91
|
options: {
|
|
92
|
+
...DEFAULT_OPTIONS,
|
|
56
93
|
plugins: [pluginSortJSON],
|
|
57
94
|
jsonRecursiveSort: true,
|
|
58
95
|
jsonSortOrder: prioritizeKeys("$schema")
|
|
59
96
|
}
|
|
60
97
|
},
|
|
98
|
+
(
|
|
99
|
+
/**
|
|
100
|
+
* Tab-based indentation becomes inconvenient when rendered outside the
|
|
101
|
+
* context of a code editor. In documentation, tabs in code blocks
|
|
102
|
+
* require special handling that very few renderers support.
|
|
103
|
+
*
|
|
104
|
+
* At the time of writing, GitHub renders tabs correctly on the web, but
|
|
105
|
+
* not in its mobile app. `npm`, often the point of discovery for
|
|
106
|
+
* packages, does not provide any special handling for tabs either.
|
|
107
|
+
*
|
|
108
|
+
* To maximize the readability of code blocks in documentation, spaces
|
|
109
|
+
* are the right compromise.
|
|
110
|
+
*/
|
|
111
|
+
{
|
|
112
|
+
files: ["*.md", "*.mdx"],
|
|
113
|
+
options: {
|
|
114
|
+
...DEFAULT_OPTIONS,
|
|
115
|
+
useTabs: false
|
|
116
|
+
}
|
|
117
|
+
}),
|
|
61
118
|
{
|
|
62
119
|
files: [
|
|
63
120
|
"*.ts",
|
|
@@ -66,33 +123,40 @@ const config = {
|
|
|
66
123
|
"*.mts"
|
|
67
124
|
],
|
|
68
125
|
options: {
|
|
69
|
-
|
|
126
|
+
...DEFAULT_OPTIONS,
|
|
70
127
|
parser: "oxc-ts"
|
|
71
128
|
}
|
|
72
129
|
},
|
|
73
130
|
{
|
|
74
|
-
files: [
|
|
131
|
+
files: [
|
|
132
|
+
"*.xml",
|
|
133
|
+
"*.plist",
|
|
134
|
+
"*.svg"
|
|
135
|
+
],
|
|
75
136
|
options: {
|
|
76
|
-
|
|
77
|
-
|
|
137
|
+
...DEFAULT_OPTIONS,
|
|
138
|
+
parser: "html",
|
|
139
|
+
printWidth: 80,
|
|
140
|
+
singleAttributePerLine: true
|
|
78
141
|
}
|
|
79
142
|
},
|
|
80
143
|
{
|
|
81
144
|
files: [
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
145
|
+
"oxlintrc.json",
|
|
146
|
+
"oxlintrc.jsonc",
|
|
147
|
+
"oxlintrc.*.json",
|
|
148
|
+
"oxlintrc.*.jsonc",
|
|
149
|
+
".oxlintrc.json",
|
|
150
|
+
".oxlintrc.jsonc",
|
|
151
|
+
".oxlintrc.*.json",
|
|
152
|
+
".oxlintrc.*.jsonc"
|
|
86
153
|
],
|
|
87
|
-
options: {
|
|
88
|
-
plugins: [pluginSortJSON],
|
|
89
|
-
jsonSortOrder: prioritizeKeys("extends", "compilerOptions", "files", "include", "exclude")
|
|
90
|
-
}
|
|
154
|
+
options: { jsonSortOrder: prioritizeKeys("$schema", "files", "extends", "plugins", "categories", "env", "settings", "rules", "overrides") }
|
|
91
155
|
},
|
|
92
156
|
{
|
|
93
157
|
files: ["package.json"],
|
|
94
158
|
options: {
|
|
95
|
-
plugins: [
|
|
159
|
+
plugins: [pluginPackageJSON, pluginSortJSON],
|
|
96
160
|
packageSortOrder: [
|
|
97
161
|
"name",
|
|
98
162
|
"private",
|
|
@@ -123,23 +187,15 @@ const config = {
|
|
|
123
187
|
},
|
|
124
188
|
{
|
|
125
189
|
files: [
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
"
|
|
130
|
-
".oxlintrc.json",
|
|
131
|
-
".oxlintrc.jsonc",
|
|
132
|
-
".oxlintrc.*.json",
|
|
133
|
-
".oxlintrc.*.jsonc"
|
|
190
|
+
"tsconfig.json",
|
|
191
|
+
"tsconfig.*.json",
|
|
192
|
+
"jsconfig.json",
|
|
193
|
+
"jsconfig.*.json"
|
|
134
194
|
],
|
|
135
|
-
options: {
|
|
136
|
-
plugins: [pluginSortJSON],
|
|
137
|
-
jsonSortOrder: prioritizeKeys("$schema", "files", "extends", "plugins", "categories", "env", "settings", "rules", "overrides")
|
|
138
|
-
}
|
|
195
|
+
options: { jsonSortOrder: prioritizeKeys("extends", "compilerOptions", "files", "include", "exclude") }
|
|
139
196
|
}
|
|
140
197
|
]
|
|
141
198
|
};
|
|
142
|
-
var config_default = config;
|
|
143
199
|
|
|
144
200
|
//#endregion
|
|
145
201
|
//#region src/merge-config/index.ts
|
|
@@ -165,9 +221,10 @@ function isArray(value) {
|
|
|
165
221
|
|
|
166
222
|
//#endregion
|
|
167
223
|
//#region src/define-config/index.ts
|
|
168
|
-
function defineConfig(config
|
|
169
|
-
return mergeConfig(
|
|
224
|
+
function defineConfig(config = {}) {
|
|
225
|
+
return mergeConfig(DEFAULT_CONFIG, config);
|
|
170
226
|
}
|
|
171
227
|
|
|
172
228
|
//#endregion
|
|
173
|
-
export { defineConfig, prioritizeKeys };
|
|
229
|
+
export { defineConfig, prioritizeKeys };
|
|
230
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["clone"],"sources":["../src/prioritize-keys/index.ts","../src/config.ts","../src/merge-config/index.ts","../src/define-config/index.ts"],"sourcesContent":["export default function prioritizeKeys(...keys: ReadonlyArray<string>): string {\n\t/* oxlint-disable-next-line typescript/no-restricted-types */\n\tconst order: Record<string, null> = {};\n\n\tfor (const key of keys) {\n\t\torder[String(key)] = null;\n\t}\n\n\treturn JSON.stringify({\n\t\t...order,\n\t\t/* oxlint-disable-next-line typescript/no-explicit-any */\n\t\t[/.*/ as any]: 'lexical',\n\t});\n}\n","import type { Config, Options } from 'prettier';\nimport * as pluginOxidation from '@prettier/plugin-oxc';\nimport * as pluginPackageJSON from 'prettier-plugin-packagejson';\nimport * as pluginSortJSON from 'prettier-plugin-sort-json';\nimport * as pluginShell from 'prettier-plugin-sh';\nimport prioritizeKeys from './prioritize-keys/index.ts';\n\n/**\n * Shell files can’t be reliably identified by name alone—they’re recognized by\n * the shebang, not the extension. As a result, shell formatting options\n * (two-space indentation) must be defined as the global defaults.\n *\n * This requires overriding those options for other file types individually\n * with what we consider the actual defaults. This object defines them.\n */\nexport const DEFAULT_OPTIONS = {\n\ttabWidth: 4,\n\tuseTabs: true,\n} as const satisfies Options;\n\nexport const DEFAULT_CONFIG = {\n\tplugins: [pluginOxidation, pluginShell],\n\tbracketSpacing: true,\n\tprintWidth: 80,\n\tquoteProps: 'consistent',\n\tsingleQuote: true,\n\ttabWidth: 2,\n\ttrailingComma: 'es5',\n\tuseTabs: false,\n\toverrides: [\n\t\t{\n\t\t\tfiles: ['*.css', '*.scss'],\n\t\t\toptions: {\n\t\t\t\t...DEFAULT_OPTIONS,\n\t\t\t\tprintWidth: 100,\n\t\t\t\tsingleQuote: false,\n\t\t\t},\n\t\t},\n\t\t/**\n\t\t * Fish file formatting follows the output of `fish_indent`, which\n\t\t * defaults to four-space indentation.\n\t\t */\n\t\t{\n\t\t\tfiles: ['*.fish'],\n\t\t\toptions: {\n\t\t\t\ttabWidth: 4,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: ['*.graphql', '*.graphqls', '*.gql'],\n\t\t\toptions: {\n\t\t\t\t...DEFAULT_OPTIONS,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: ['*.html', '*.htm'],\n\t\t\toptions: {\n\t\t\t\t...DEFAULT_OPTIONS,\n\t\t\t\tprintWidth: 100,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: ['*.js', '*.jsx', '*.cjs', '*.mjs'],\n\t\t\toptions: {\n\t\t\t\t...DEFAULT_OPTIONS,\n\t\t\t\tparser: 'oxc',\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: ['*.json', '*.jsonc', '*.json5'],\n\t\t\toptions: {\n\t\t\t\t...DEFAULT_OPTIONS,\n\t\t\t\tplugins: [pluginSortJSON],\n\t\t\t\tjsonRecursiveSort: true,\n\t\t\t\tjsonSortOrder: prioritizeKeys('$schema'),\n\t\t\t},\n\t\t},\n\t\t/**\n\t\t * Tab-based indentation becomes inconvenient when rendered outside the\n\t\t * context of a code editor. In documentation, tabs in code blocks\n\t\t * require special handling that very few renderers support.\n\t\t *\n\t\t * At the time of writing, GitHub renders tabs correctly on the web, but\n\t\t * not in its mobile app. `npm`, often the point of discovery for\n\t\t * packages, does not provide any special handling for tabs either.\n\t\t *\n\t\t * To maximize the readability of code blocks in documentation, spaces\n\t\t * are the right compromise.\n\t\t */\n\t\t{\n\t\t\tfiles: ['*.md', '*.mdx'],\n\t\t\toptions: {\n\t\t\t\t...DEFAULT_OPTIONS,\n\t\t\t\tuseTabs: false,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: ['*.ts', '*.tsx', '*.cts', '*.mts'],\n\t\t\toptions: {\n\t\t\t\t...DEFAULT_OPTIONS,\n\t\t\t\tparser: 'oxc-ts',\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: ['*.xml', '*.plist', '*.svg'],\n\t\t\toptions: {\n\t\t\t\t...DEFAULT_OPTIONS,\n\t\t\t\tparser: 'html',\n\t\t\t\tprintWidth: 80,\n\t\t\t\tsingleAttributePerLine: true,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: [\n\t\t\t\t'oxlintrc.json',\n\t\t\t\t'oxlintrc.jsonc',\n\t\t\t\t'oxlintrc.*.json',\n\t\t\t\t'oxlintrc.*.jsonc',\n\t\t\t\t'.oxlintrc.json',\n\t\t\t\t'.oxlintrc.jsonc',\n\t\t\t\t'.oxlintrc.*.json',\n\t\t\t\t'.oxlintrc.*.jsonc',\n\t\t\t],\n\t\t\toptions: {\n\t\t\t\tjsonSortOrder: prioritizeKeys(\n\t\t\t\t\t'$schema',\n\t\t\t\t\t'files',\n\t\t\t\t\t'extends',\n\t\t\t\t\t'plugins',\n\t\t\t\t\t'categories',\n\t\t\t\t\t'env',\n\t\t\t\t\t'settings',\n\t\t\t\t\t'rules',\n\t\t\t\t\t'overrides'\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: ['package.json'],\n\t\t\toptions: {\n\t\t\t\tplugins: [pluginPackageJSON, pluginSortJSON],\n\t\t\t\tpackageSortOrder: [\n\t\t\t\t\t'name',\n\t\t\t\t\t'private',\n\t\t\t\t\t'version',\n\t\t\t\t\t'description',\n\t\t\t\t\t'license',\n\t\t\t\t\t'author',\n\t\t\t\t\t'repository',\n\t\t\t\t\t'keywords',\n\t\t\t\t\t'directories',\n\t\t\t\t\t'files',\n\t\t\t\t\t'type',\n\t\t\t\t\t'sideEffects',\n\t\t\t\t\t'main',\n\t\t\t\t\t'exports',\n\t\t\t\t\t'types',\n\t\t\t\t\t'bin',\n\t\t\t\t\t'imports',\n\t\t\t\t\t'engines',\n\t\t\t\t\t'packageManager',\n\t\t\t\t\t'dependencies',\n\t\t\t\t\t'peerDependencies',\n\t\t\t\t\t'peerDependenciesMeta',\n\t\t\t\t\t'devDependencies',\n\t\t\t\t\t'scripts',\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: [\n\t\t\t\t'tsconfig.json',\n\t\t\t\t'tsconfig.*.json',\n\t\t\t\t'jsconfig.json',\n\t\t\t\t'jsconfig.*.json',\n\t\t\t],\n\t\t\toptions: {\n\t\t\t\tjsonSortOrder: prioritizeKeys(\n\t\t\t\t\t'extends',\n\t\t\t\t\t'compilerOptions',\n\t\t\t\t\t'files',\n\t\t\t\t\t'include',\n\t\t\t\t\t'exclude'\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t],\n} as const satisfies Config;\n","import type { Config } from 'prettier';\nimport { klona as clone } from 'klona/lite';\n\nexport default function mergeConfig(\n\tbaseConfig: Config,\n\textensionConfig: Config\n): Config {\n\tif (\n\t\t!(typeof baseConfig === 'object' && typeof extensionConfig === 'object')\n\t) {\n\t\tthrow new TypeError(\n\t\t\t'Prettier config error: expected config to be an object'\n\t\t);\n\t}\n\n\tconst result = clone(baseConfig);\n\n\tfor (const [key, value] of Object.entries(clone(extensionConfig))) {\n\t\tif (value === undefined) {\n\t\t\t/* oxlint-disable-next-line typescript/no-dynamic-delete */\n\t\t\tdelete result[key];\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (isArray(value) && isArray(result[key])) {\n\t\t\tresult[key] = [...result[key], ...value];\n\t\t\tcontinue;\n\t\t}\n\n\t\tresult[key] = value;\n\t}\n\n\treturn result;\n}\n\nfunction isArray(value: unknown): value is unknown[] {\n\treturn Array.isArray(value);\n}\n","import type { Config } from 'prettier';\nimport { DEFAULT_CONFIG } from '../config.ts';\nimport mergeConfig from '../merge-config/index.ts';\n\nexport default function defineConfig(config: Config = {}): Config {\n\treturn mergeConfig(DEFAULT_CONFIG, config);\n}\n"],"mappings":";;;;;;;AAAA,SAAwB,eAAe,GAAG,MAAqC;CAE9E,MAAM,QAA8B,EAAE;AAEtC,MAAK,MAAM,OAAO,KACjB,OAAM,OAAO,IAAI,IAAI;AAGtB,QAAO,KAAK,UAAU;EACrB,GAAG;GAEF,OAAc;EACf,CAAC;;;;;;;;;;;;;ACGH,MAAa,kBAAkB;CAC9B,UAAU;CACV,SAAS;CACT;AAED,MAAa,iBAAiB;CAC7B,SAAS,CAAC,iBAAiB,YAAY;CACvC,gBAAgB;CAChB,YAAY;CACZ,YAAY;CACZ,aAAa;CACb,UAAU;CACV,eAAe;CACf,SAAS;CACT,WAAW;EACV;GACC,OAAO,CAAC,SAAS,SAAS;GAC1B,SAAS;IACR,GAAG;IACH,YAAY;IACZ,aAAa;IACb;GACD;;;;;;EAKD;GACC,OAAO,CAAC,SAAS;GACjB,SAAS,EACR,UAAU,GACV;GACD;EACD;GACC,OAAO;IAAC;IAAa;IAAc;IAAQ;GAC3C,SAAS,EACR,GAAG,iBACH;GACD;EACD;GACC,OAAO,CAAC,UAAU,QAAQ;GAC1B,SAAS;IACR,GAAG;IACH,YAAY;IACZ;GACD;EACD;GACC,OAAO;IAAC;IAAQ;IAAS;IAAS;IAAQ;GAC1C,SAAS;IACR,GAAG;IACH,QAAQ;IACR;GACD;EACD;GACC,OAAO;IAAC;IAAU;IAAW;IAAU;GACvC,SAAS;IACR,GAAG;IACH,SAAS,CAAC,eAAe;IACzB,mBAAmB;IACnB,eAAe,eAAe,UAAU;IACxC;GACD;;;;;;;;;;;;;;EAaD;GACC,OAAO,CAAC,QAAQ,QAAQ;GACxB,SAAS;IACR,GAAG;IACH,SAAS;IACT;GACD;EACD;GACC,OAAO;IAAC;IAAQ;IAAS;IAAS;IAAQ;GAC1C,SAAS;IACR,GAAG;IACH,QAAQ;IACR;GACD;EACD;GACC,OAAO;IAAC;IAAS;IAAW;IAAQ;GACpC,SAAS;IACR,GAAG;IACH,QAAQ;IACR,YAAY;IACZ,wBAAwB;IACxB;GACD;EACD;GACC,OAAO;IACN;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACD,SAAS,EACR,eAAe,eACd,WACA,SACA,WACA,WACA,cACA,OACA,YACA,SACA,YACA,EACD;GACD;EACD;GACC,OAAO,CAAC,eAAe;GACvB,SAAS;IACR,SAAS,CAAC,mBAAmB,eAAe;IAC5C,kBAAkB;KACjB;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;IACD;GACD;EACD;GACC,OAAO;IACN;IACA;IACA;IACA;IACA;GACD,SAAS,EACR,eAAe,eACd,WACA,mBACA,SACA,WACA,UACA,EACD;GACD;EACD;CACD;;;;ACxLD,SAAwB,YACvB,YACA,iBACS;AACT,KACC,EAAE,OAAO,eAAe,YAAY,OAAO,oBAAoB,UAE/D,OAAM,IAAI,UACT,yDACA;CAGF,MAAM,SAASA,MAAM,WAAW;AAEhC,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQA,MAAM,gBAAgB,CAAC,EAAE;AAClE,MAAI,UAAU,QAAW;AAExB,UAAO,OAAO;AACd;;AAGD,MAAI,QAAQ,MAAM,IAAI,QAAQ,OAAO,KAAK,EAAE;AAC3C,UAAO,OAAO,CAAC,GAAG,OAAO,MAAM,GAAG,MAAM;AACxC;;AAGD,SAAO,OAAO;;AAGf,QAAO;;AAGR,SAAS,QAAQ,OAAoC;AACpD,QAAO,MAAM,QAAQ,MAAM;;;;;AChC5B,SAAwB,aAAa,SAAiB,EAAE,EAAU;AACjE,QAAO,YAAY,gBAAgB,OAAO"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@standard-config/prettier",
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "TypeScript-first Prettier config",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Dom Porada",
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"keywords": [
|
|
16
16
|
"json-sorting",
|
|
17
17
|
"oxc",
|
|
18
|
-
"oxc-parser",
|
|
19
18
|
"prettier-config",
|
|
20
19
|
"standard-config",
|
|
21
20
|
"typescript"
|
|
@@ -28,36 +27,40 @@
|
|
|
28
27
|
"exports": "./dist/index.mjs",
|
|
29
28
|
"types": "./dist/index.d.mts",
|
|
30
29
|
"engines": {
|
|
31
|
-
"node": ">=
|
|
30
|
+
"node": ">=22"
|
|
32
31
|
},
|
|
33
|
-
"packageManager": "pnpm@10.
|
|
32
|
+
"packageManager": "pnpm@10.28.0",
|
|
34
33
|
"dependencies": {
|
|
35
34
|
"@prettier/plugin-oxc": "^0.1.3",
|
|
36
35
|
"klona": "^2.0.6",
|
|
37
36
|
"prettier-plugin-packagejson": "2.5.20",
|
|
37
|
+
"prettier-plugin-sh": "^0.18.0",
|
|
38
38
|
"prettier-plugin-sort-json": "4.1.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"prettier": ">=3.7"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@standard-config/tsconfig": "
|
|
45
|
-
"@vitest/coverage-v8": "
|
|
46
|
-
"
|
|
47
|
-
"oxlint
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
44
|
+
"@standard-config/tsconfig": "2.0.0",
|
|
45
|
+
"@vitest/coverage-v8": "4.0.16",
|
|
46
|
+
"husky": "9.1.7",
|
|
47
|
+
"oxlint": "1.38.0",
|
|
48
|
+
"oxlint-tsgolint": "0.11.0",
|
|
49
|
+
"prettier": "3.7.4",
|
|
50
|
+
"publint": "0.3.16",
|
|
51
|
+
"tsdown": "0.19.0",
|
|
52
|
+
"typescript": "5.9.3",
|
|
53
|
+
"vitest": "4.0.16"
|
|
53
54
|
},
|
|
54
55
|
"scripts": {
|
|
55
|
-
"build": "tsdown
|
|
56
|
+
"build": "tsdown",
|
|
57
|
+
"fix": "pnpm format && pnpm lint",
|
|
56
58
|
"format": "prettier --write --ignore-unknown .",
|
|
57
|
-
"format:
|
|
59
|
+
"format:check": "prettier --check --ignore-unknown .",
|
|
58
60
|
"lint": "oxlint --fix --type-aware --type-check --deny-warnings --report-unused-disable-directives",
|
|
59
|
-
"lint:
|
|
60
|
-
"prepack": "pnpm run '/^(format:
|
|
61
|
+
"lint:check": "oxlint --type-aware --type-check --deny-warnings --report-unused-disable-directives",
|
|
62
|
+
"prepack": "pnpm run '/^(format:check|lint:check|test|typecheck)$/' && pnpm build",
|
|
63
|
+
"prepare": "husky",
|
|
61
64
|
"test": "vitest run",
|
|
62
65
|
"typecheck": "tsc --noEmit"
|
|
63
66
|
}
|