@kitschpatrol/prettier-config 5.13.0 → 6.0.1
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/bin/cli.js +5 -5905
- package/dist/index.d.ts +7 -4
- package/dist/index.js +1 -100
- package/package.json +11 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { Config } from "prettier";
|
|
2
|
+
|
|
3
|
+
//#region src/index.d.ts
|
|
4
|
+
declare const sharedPrettierConfig: Config;
|
|
3
5
|
/**
|
|
4
6
|
* **\@Kitschpatrol's Shared Prettier Configuration**
|
|
5
7
|
* @see [@kitschpatrol/prettier-config](https://github.com/kitschpatrol/shared-config/tree/main/packages/prettier-config)
|
|
@@ -11,5 +13,6 @@ declare const sharedPrettierConfig: PrettierConfig;
|
|
|
11
13
|
* })
|
|
12
14
|
* ```
|
|
13
15
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
declare function prettierConfig(config?: Config): Config;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { sharedPrettierConfig as default, prettierConfig };
|
package/dist/index.js
CHANGED
|
@@ -1,100 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { homedir } from 'node:os';
|
|
3
|
-
import { sortOrder as sortPackageJsonSortOrder } from 'sort-package-json';
|
|
4
|
-
// export { commandDefinition } from './command.js'
|
|
5
|
-
/**
|
|
6
|
-
* Merge custom keys into the `sort-package-json` `order` array. Where
|
|
7
|
-
* duplicated, delete existing and prioritize new keys.
|
|
8
|
-
*/
|
|
9
|
-
function customizeSortOrder(keys, newKeys) {
|
|
10
|
-
// If new keys are in keys, remove them
|
|
11
|
-
const filteredKeys = keys.filter((key) => !newKeys.includes(key));
|
|
12
|
-
// Append new keys to the end
|
|
13
|
-
return [...filteredKeys, ...newKeys];
|
|
14
|
-
}
|
|
15
|
-
const sharedPrettierConfig = {
|
|
16
|
-
bracketSpacing: true,
|
|
17
|
-
endOfLine: 'lf',
|
|
18
|
-
overrides: [
|
|
19
|
-
{
|
|
20
|
-
files: ['*.md', '*.mdx', '*.yml'],
|
|
21
|
-
options: {
|
|
22
|
-
useTabs: false,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
files: '*.astro',
|
|
27
|
-
options: {
|
|
28
|
-
parser: 'astro',
|
|
29
|
-
plugins: ['prettier-plugin-astro'],
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
files: '*.svelte',
|
|
34
|
-
options: {
|
|
35
|
-
parser: 'svelte',
|
|
36
|
-
plugins: ['prettier-plugin-svelte'],
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
files: '*.rb',
|
|
41
|
-
options: {
|
|
42
|
-
rubyExecutablePath: `${homedir()}/.rbenv/shims/ruby`,
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
files: ['*rc', '*ignore', '*.sh', '*.zsh', '*.bash', '*.fish'],
|
|
47
|
-
options: {
|
|
48
|
-
parser: 'sh',
|
|
49
|
-
plugins: ['prettier-plugin-sh'],
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
// Make this match eslint 'json-package/order-properties'
|
|
53
|
-
// https://github.com/matzkoh/prettier-plugin-packagejson/issues/188
|
|
54
|
-
// This must stay in sync with packages/eslint-config/src/configs/json.ts
|
|
55
|
-
{
|
|
56
|
-
files: 'package.json',
|
|
57
|
-
options: {
|
|
58
|
-
packageSortOrder: customizeSortOrder(sortPackageJsonSortOrder, [
|
|
59
|
-
'cspell',
|
|
60
|
-
'knip',
|
|
61
|
-
'mdat',
|
|
62
|
-
'prettier',
|
|
63
|
-
'remarkConfig',
|
|
64
|
-
'stylelint',
|
|
65
|
-
]),
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
plugins: [
|
|
70
|
-
'@prettier/plugin-php',
|
|
71
|
-
'@prettier/plugin-ruby',
|
|
72
|
-
'@prettier/plugin-xml',
|
|
73
|
-
'prettier-plugin-packagejson',
|
|
74
|
-
'prettier-plugin-sh',
|
|
75
|
-
// 'prettier-plugin-sql',
|
|
76
|
-
'prettier-plugin-tailwindcss',
|
|
77
|
-
'prettier-plugin-toml',
|
|
78
|
-
],
|
|
79
|
-
printWidth: 100,
|
|
80
|
-
semi: false,
|
|
81
|
-
singleQuote: true,
|
|
82
|
-
tabWidth: 2,
|
|
83
|
-
trailingComma: 'all',
|
|
84
|
-
useTabs: true,
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* **\@Kitschpatrol's Shared Prettier Configuration**
|
|
88
|
-
* @see [@kitschpatrol/prettier-config](https://github.com/kitschpatrol/shared-config/tree/main/packages/prettier-config)
|
|
89
|
-
* @see [@kitschpatrol/shared-config](https://github.com/kitschpatrol/shared-config)
|
|
90
|
-
* @example
|
|
91
|
-
* ```js
|
|
92
|
-
* export default prettierConfig({
|
|
93
|
-
* printWidth: 120,
|
|
94
|
-
* })
|
|
95
|
-
* ```
|
|
96
|
-
*/
|
|
97
|
-
export function prettierConfig(config) {
|
|
98
|
-
return deepmerge(sharedPrettierConfig, config);
|
|
99
|
-
}
|
|
100
|
-
export default sharedPrettierConfig;
|
|
1
|
+
import{deepmerge as e}from"deepmerge-ts";import{homedir as t}from"node:os";import{sortOrder as n}from"sort-package-json";function r(e,t){return[...e.filter(e=>!t.includes(e)),...t]}const i={bracketSpacing:!0,endOfLine:`lf`,overrides:[{files:[`*.md`,`*.mdx`,`*.yml`],options:{useTabs:!1}},{files:`*.astro`,options:{parser:`astro`,plugins:[`prettier-plugin-astro`]}},{files:`*.svelte`,options:{parser:`svelte`,plugins:[`prettier-plugin-svelte`]}},{files:`*.rb`,options:{rubyExecutablePath:`${t()}/.rbenv/shims/ruby`}},{files:[`*rc`,`*ignore`,`*.sh`,`*.zsh`,`*.bash`,`*.fish`],options:{parser:`sh`,plugins:[`prettier-plugin-sh`]}},{files:`package.json`,options:{packageSortOrder:r(n,[`cspell`,`knip`,`mdat`,`prettier`,`remarkConfig`,`stylelint`])}}],plugins:[`@prettier/plugin-php`,`@prettier/plugin-ruby`,`@prettier/plugin-xml`,`prettier-plugin-packagejson`,`prettier-plugin-sh`,`prettier-plugin-tailwindcss`,`prettier-plugin-toml`],printWidth:100,semi:!1,singleQuote:!0,tabWidth:2,trailingComma:`all`,useTabs:!0};function a(t){return e(i,t)}export{i as default,a as prettierConfig};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitschpatrol/prettier-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"description": "Prettier configuration for @kitschpatrol/shared-config.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"shared-config",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"email": "eric@ericmika.com",
|
|
24
24
|
"url": "https://ericmika.com"
|
|
25
25
|
},
|
|
26
|
+
"sideEffects": false,
|
|
26
27
|
"type": "module",
|
|
27
28
|
"exports": {
|
|
28
29
|
".": {
|
|
@@ -33,7 +34,6 @@
|
|
|
33
34
|
"main": "dist/index.js",
|
|
34
35
|
"types": "dist/index.d.ts",
|
|
35
36
|
"bin": {
|
|
36
|
-
"kpi-prettier": "bin/cli.js",
|
|
37
37
|
"ksc-prettier": "bin/cli.js"
|
|
38
38
|
},
|
|
39
39
|
"files": [
|
|
@@ -48,18 +48,24 @@
|
|
|
48
48
|
"@prettier/plugin-xml": "^3.4.2",
|
|
49
49
|
"cosmiconfig": "^9.0.0",
|
|
50
50
|
"cosmiconfig-typescript-loader": "^6.2.0",
|
|
51
|
+
"decircular": "^1.0.0",
|
|
52
|
+
"deepmerge": "^4.3.1",
|
|
51
53
|
"deepmerge-ts": "^7.1.5",
|
|
52
54
|
"execa": "^9.6.1",
|
|
53
55
|
"find-workspaces": "^0.3.1",
|
|
54
56
|
"fs-extra": "^11.3.3",
|
|
57
|
+
"json-stringify-pretty-compact": "^4.0.0",
|
|
58
|
+
"package-up": "^5.0.0",
|
|
59
|
+
"picocolors": "^1.1.1",
|
|
55
60
|
"prettier": "^3.8.1",
|
|
56
61
|
"prettier-plugin-astro": "^0.14.1",
|
|
57
62
|
"prettier-plugin-packagejson": "^3.0.0",
|
|
58
63
|
"prettier-plugin-sh": "^0.18.0",
|
|
59
|
-
"prettier-plugin-svelte": "^3.
|
|
64
|
+
"prettier-plugin-svelte": "^3.5.0",
|
|
60
65
|
"prettier-plugin-tailwindcss": "^0.7.2",
|
|
61
66
|
"prettier-plugin-toml": "^2.0.6",
|
|
62
|
-
"sort-package-json": "^3.6.1"
|
|
67
|
+
"sort-package-json": "^3.6.1",
|
|
68
|
+
"yargs": "^18.0.0"
|
|
63
69
|
},
|
|
64
70
|
"engines": {
|
|
65
71
|
"node": ">=20.19.0"
|
|
@@ -68,7 +74,7 @@
|
|
|
68
74
|
"access": "public"
|
|
69
75
|
},
|
|
70
76
|
"scripts": {
|
|
71
|
-
"build": "
|
|
77
|
+
"build": "tsdown",
|
|
72
78
|
"cli": "node ./bin/cli.js"
|
|
73
79
|
}
|
|
74
80
|
}
|