@kitschpatrol/prettier-config 5.13.0 → 6.0.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/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
- import type { Config as PrettierConfig } from 'prettier';
2
- declare const sharedPrettierConfig: PrettierConfig;
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
- export declare function prettierConfig(config?: PrettierConfig): PrettierConfig;
15
- export default sharedPrettierConfig;
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 { deepmerge } from 'deepmerge-ts';
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": "5.13.0",
3
+ "version": "6.0.0",
4
4
  "description": "Prettier configuration for @kitschpatrol/shared-config.",
5
5
  "keywords": [
6
6
  "shared-config",
@@ -33,7 +33,6 @@
33
33
  "main": "dist/index.js",
34
34
  "types": "dist/index.d.ts",
35
35
  "bin": {
36
- "kpi-prettier": "bin/cli.js",
37
36
  "ksc-prettier": "bin/cli.js"
38
37
  },
39
38
  "files": [
@@ -48,27 +47,33 @@
48
47
  "@prettier/plugin-xml": "^3.4.2",
49
48
  "cosmiconfig": "^9.0.0",
50
49
  "cosmiconfig-typescript-loader": "^6.2.0",
50
+ "decircular": "^1.0.0",
51
+ "deepmerge": "^4.3.1",
51
52
  "deepmerge-ts": "^7.1.5",
52
53
  "execa": "^9.6.1",
53
54
  "find-workspaces": "^0.3.1",
54
55
  "fs-extra": "^11.3.3",
56
+ "json-stringify-pretty-compact": "^4.0.0",
57
+ "package-up": "^5.0.0",
58
+ "picocolors": "^1.1.1",
55
59
  "prettier": "^3.8.1",
56
60
  "prettier-plugin-astro": "^0.14.1",
57
61
  "prettier-plugin-packagejson": "^3.0.0",
58
62
  "prettier-plugin-sh": "^0.18.0",
59
- "prettier-plugin-svelte": "^3.4.1",
63
+ "prettier-plugin-svelte": "^3.5.0",
60
64
  "prettier-plugin-tailwindcss": "^0.7.2",
61
65
  "prettier-plugin-toml": "^2.0.6",
62
- "sort-package-json": "^3.6.1"
66
+ "sort-package-json": "^3.6.1",
67
+ "yargs": "^18.0.0"
63
68
  },
64
69
  "engines": {
65
- "node": ">=20.19.0"
70
+ "node": ">=22.21.0"
66
71
  },
67
72
  "publishConfig": {
68
73
  "access": "public"
69
74
  },
70
75
  "scripts": {
71
- "build": "tsc && tsx ../../scripts/build.ts",
76
+ "build": "tsdown",
72
77
  "cli": "node ./bin/cli.js"
73
78
  }
74
79
  }