@standard-config/prettier 1.0.1 → 1.1.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 +6 -1
- package/dist/index.d.mts +11 -2
- package/dist/index.mjs +105 -64
- package/dist/index.mjs.map +1 -0
- package/package.json +20 -17
- package/dist/index-CSe7NnCj.d.mts +0 -25
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,7 +30,7 @@ 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';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import "./index-CSe7NnCj.mjs";
|
|
2
1
|
import { Config } from "prettier";
|
|
3
2
|
|
|
3
|
+
//#region src/types/index.d.ts
|
|
4
|
+
declare module 'prettier' {
|
|
5
|
+
interface Options {
|
|
6
|
+
jsonRecursiveSort?: boolean | undefined;
|
|
7
|
+
jsonSortOrder?: string | undefined;
|
|
8
|
+
packageSortOrder?: string[] | undefined;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
4
12
|
//#region src/define-config/index.d.ts
|
|
5
13
|
declare function defineConfig(config?: Config): Config;
|
|
6
14
|
//#endregion
|
|
7
15
|
//#region src/prioritize-keys/index.d.ts
|
|
8
16
|
declare function prioritizeKeys(...keys: ReadonlyArray<string>): string;
|
|
9
17
|
//#endregion
|
|
10
|
-
export { defineConfig, prioritizeKeys };
|
|
18
|
+
export { defineConfig, prioritizeKeys };
|
|
19
|
+
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./index-CSe7NnCj.d.mts";
|
|
2
1
|
import * as pluginOxidation from "@prettier/plugin-oxc";
|
|
3
2
|
import * as pluginPackageJSON from "prettier-plugin-packagejson";
|
|
4
3
|
import * as pluginSortJSON from "prettier-plugin-sort-json";
|
|
4
|
+
import * as pluginShell from "prettier-plugin-sh";
|
|
5
5
|
import { klona } from "klona/lite";
|
|
6
6
|
|
|
7
7
|
//#region src/prioritize-keys/index.ts
|
|
@@ -16,27 +16,63 @@ function prioritizeKeys(...keys) {
|
|
|
16
16
|
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region src/config.ts
|
|
19
|
-
|
|
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: [
|
|
33
|
+
pluginOxidation,
|
|
34
|
+
pluginPackageJSON,
|
|
35
|
+
pluginShell,
|
|
36
|
+
pluginSortJSON
|
|
37
|
+
],
|
|
20
38
|
bracketSpacing: true,
|
|
21
39
|
printWidth: 80,
|
|
22
40
|
quoteProps: "consistent",
|
|
23
41
|
singleQuote: true,
|
|
24
|
-
tabWidth:
|
|
42
|
+
tabWidth: 2,
|
|
25
43
|
trailingComma: "es5",
|
|
26
|
-
useTabs:
|
|
44
|
+
useTabs: false,
|
|
27
45
|
overrides: [
|
|
28
46
|
{
|
|
29
47
|
files: ["*.css", "*.scss"],
|
|
30
48
|
options: {
|
|
49
|
+
...DEFAULT_OPTIONS,
|
|
31
50
|
printWidth: 100,
|
|
32
51
|
singleQuote: false
|
|
33
52
|
}
|
|
34
53
|
},
|
|
54
|
+
(
|
|
55
|
+
/**
|
|
56
|
+
* Fish file formatting follows the output of `fish_indent`, which
|
|
57
|
+
* defaults to four-space indentation.
|
|
58
|
+
*/
|
|
35
59
|
{
|
|
36
|
-
files: ["*.
|
|
60
|
+
files: ["*.fish"],
|
|
61
|
+
options: { tabWidth: 4 }
|
|
62
|
+
}),
|
|
63
|
+
{
|
|
64
|
+
files: [
|
|
65
|
+
"*.graphql",
|
|
66
|
+
"*.graphqls",
|
|
67
|
+
"*.gql"
|
|
68
|
+
],
|
|
69
|
+
options: { ...DEFAULT_OPTIONS }
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
files: ["*.html", "*.htm"],
|
|
37
73
|
options: {
|
|
38
|
-
|
|
39
|
-
|
|
74
|
+
...DEFAULT_OPTIONS,
|
|
75
|
+
printWidth: 100
|
|
40
76
|
}
|
|
41
77
|
},
|
|
42
78
|
{
|
|
@@ -47,18 +83,26 @@ const config = {
|
|
|
47
83
|
"*.mjs"
|
|
48
84
|
],
|
|
49
85
|
options: {
|
|
50
|
-
|
|
86
|
+
...DEFAULT_OPTIONS,
|
|
51
87
|
parser: "oxc"
|
|
52
88
|
}
|
|
53
89
|
},
|
|
54
90
|
{
|
|
55
|
-
files: [
|
|
91
|
+
files: [
|
|
92
|
+
"*.json",
|
|
93
|
+
"*.jsonc",
|
|
94
|
+
"*.json5"
|
|
95
|
+
],
|
|
56
96
|
options: {
|
|
57
|
-
|
|
97
|
+
...DEFAULT_OPTIONS,
|
|
58
98
|
jsonRecursiveSort: true,
|
|
59
99
|
jsonSortOrder: prioritizeKeys("$schema")
|
|
60
100
|
}
|
|
61
101
|
},
|
|
102
|
+
{
|
|
103
|
+
files: ["*.md", "*.mdx"],
|
|
104
|
+
options: { ...DEFAULT_OPTIONS }
|
|
105
|
+
},
|
|
62
106
|
{
|
|
63
107
|
files: [
|
|
64
108
|
"*.ts",
|
|
@@ -67,59 +111,21 @@ const config = {
|
|
|
67
111
|
"*.mts"
|
|
68
112
|
],
|
|
69
113
|
options: {
|
|
70
|
-
|
|
114
|
+
...DEFAULT_OPTIONS,
|
|
71
115
|
parser: "oxc-ts"
|
|
72
116
|
}
|
|
73
117
|
},
|
|
74
|
-
{
|
|
75
|
-
files: ["*.yaml", "*.yml"],
|
|
76
|
-
options: {
|
|
77
|
-
tabWidth: 2,
|
|
78
|
-
useTabs: false
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
118
|
{
|
|
82
119
|
files: [
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"tsconfig.*.json"
|
|
120
|
+
"*.xml",
|
|
121
|
+
"*.plist",
|
|
122
|
+
"*.svg"
|
|
87
123
|
],
|
|
88
124
|
options: {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
{
|
|
94
|
-
files: ["package.json"],
|
|
95
|
-
options: {
|
|
96
|
-
plugins: [pluginSortJSON, pluginPackageJSON],
|
|
97
|
-
packageSortOrder: [
|
|
98
|
-
"name",
|
|
99
|
-
"private",
|
|
100
|
-
"version",
|
|
101
|
-
"description",
|
|
102
|
-
"license",
|
|
103
|
-
"author",
|
|
104
|
-
"repository",
|
|
105
|
-
"keywords",
|
|
106
|
-
"directories",
|
|
107
|
-
"files",
|
|
108
|
-
"type",
|
|
109
|
-
"sideEffects",
|
|
110
|
-
"main",
|
|
111
|
-
"exports",
|
|
112
|
-
"types",
|
|
113
|
-
"bin",
|
|
114
|
-
"imports",
|
|
115
|
-
"engines",
|
|
116
|
-
"packageManager",
|
|
117
|
-
"dependencies",
|
|
118
|
-
"peerDependencies",
|
|
119
|
-
"peerDependenciesMeta",
|
|
120
|
-
"devDependencies",
|
|
121
|
-
"scripts"
|
|
122
|
-
]
|
|
125
|
+
...DEFAULT_OPTIONS,
|
|
126
|
+
parser: "html",
|
|
127
|
+
printWidth: 80,
|
|
128
|
+
singleAttributePerLine: true
|
|
123
129
|
}
|
|
124
130
|
},
|
|
125
131
|
{
|
|
@@ -133,14 +139,48 @@ const config = {
|
|
|
133
139
|
".oxlintrc.*.json",
|
|
134
140
|
".oxlintrc.*.jsonc"
|
|
135
141
|
],
|
|
136
|
-
options: {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
142
|
+
options: { jsonSortOrder: prioritizeKeys("$schema", "files", "extends", "plugins", "categories", "env", "settings", "rules", "overrides") }
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
files: ["package.json"],
|
|
146
|
+
options: { packageSortOrder: [
|
|
147
|
+
"name",
|
|
148
|
+
"private",
|
|
149
|
+
"version",
|
|
150
|
+
"description",
|
|
151
|
+
"license",
|
|
152
|
+
"author",
|
|
153
|
+
"repository",
|
|
154
|
+
"keywords",
|
|
155
|
+
"directories",
|
|
156
|
+
"files",
|
|
157
|
+
"type",
|
|
158
|
+
"sideEffects",
|
|
159
|
+
"main",
|
|
160
|
+
"exports",
|
|
161
|
+
"types",
|
|
162
|
+
"bin",
|
|
163
|
+
"imports",
|
|
164
|
+
"engines",
|
|
165
|
+
"packageManager",
|
|
166
|
+
"dependencies",
|
|
167
|
+
"peerDependencies",
|
|
168
|
+
"peerDependenciesMeta",
|
|
169
|
+
"devDependencies",
|
|
170
|
+
"scripts"
|
|
171
|
+
] }
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
files: [
|
|
175
|
+
"tsconfig.json",
|
|
176
|
+
"tsconfig.*.json",
|
|
177
|
+
"jsconfig.json",
|
|
178
|
+
"jsconfig.*.json"
|
|
179
|
+
],
|
|
180
|
+
options: { jsonSortOrder: prioritizeKeys("extends", "compilerOptions", "files", "include", "exclude") }
|
|
140
181
|
}
|
|
141
182
|
]
|
|
142
183
|
};
|
|
143
|
-
var config_default = config;
|
|
144
184
|
|
|
145
185
|
//#endregion
|
|
146
186
|
//#region src/merge-config/index.ts
|
|
@@ -166,9 +206,10 @@ function isArray(value) {
|
|
|
166
206
|
|
|
167
207
|
//#endregion
|
|
168
208
|
//#region src/define-config/index.ts
|
|
169
|
-
function defineConfig(config
|
|
170
|
-
return mergeConfig(
|
|
209
|
+
function defineConfig(config = {}) {
|
|
210
|
+
return mergeConfig(DEFAULT_CONFIG, config);
|
|
171
211
|
}
|
|
172
212
|
|
|
173
213
|
//#endregion
|
|
174
|
-
export { defineConfig, prioritizeKeys };
|
|
214
|
+
export { defineConfig, prioritizeKeys };
|
|
215
|
+
//# 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, pluginPackageJSON, pluginShell, pluginSortJSON],\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\tjsonRecursiveSort: true,\n\t\t\t\tjsonSortOrder: prioritizeKeys('$schema'),\n\t\t\t},\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},\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\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;EAAC;EAAiB;EAAmB;EAAa;EAAe;CAC1E,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,mBAAmB;IACnB,eAAe,eAAe,UAAU;IACxC;GACD;EACD;GACC,OAAO,CAAC,QAAQ,QAAQ;GACxB,SAAS,EACR,GAAG,iBACH;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,EACR,kBAAkB;IACjB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,EACD;GACD;EACD;GACC,OAAO;IACN;IACA;IACA;IACA;IACA;GACD,SAAS,EACR,eAAe,eACd,WACA,mBACA,SACA,WACA,UACA,EACD;GACD;EACD;CACD;;;;ACzKD,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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@standard-config/prettier",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Curated Prettier config for modern TypeScript projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -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
|
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import "prettier";
|
|
2
|
-
|
|
3
|
-
//#region src/types/vendor.d.ts
|
|
4
|
-
// Pending pull request:
|
|
5
|
-
// https://github.com/matzkoh/prettier-plugin-packagejson/pull/270
|
|
6
|
-
declare module 'prettier-plugin-packagejson' {
|
|
7
|
-
import type { Plugin } from 'prettier';
|
|
8
|
-
export const testPath: (path: string) => boolean;
|
|
9
|
-
export const options: NonNullable<Plugin['options']>;
|
|
10
|
-
export const parsers: NonNullable<Plugin['parsers']>;
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/types/index.d.ts
|
|
14
|
-
declare module 'prettier' {
|
|
15
|
-
interface Options {
|
|
16
|
-
// Pending pull request:
|
|
17
|
-
// https://github.com/Gudahtt/prettier-plugin-sort-json/pull/292
|
|
18
|
-
jsonRecursiveSort?: boolean | undefined;
|
|
19
|
-
jsonSortOrder?: string | undefined;
|
|
20
|
-
|
|
21
|
-
// Pending pull request:
|
|
22
|
-
// https://github.com/matzkoh/prettier-plugin-packagejson/pull/270
|
|
23
|
-
packageSortOrder?: string[] | undefined;
|
|
24
|
-
}
|
|
25
|
-
}
|