@lobehub/prettier-config 2.0.0-beta.10

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 LobeHub
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,101 @@
1
+ <a name="readme-top"></a>
2
+
3
+ <div align="center">
4
+
5
+ <img height="120" src="https://registry.npmmirror.com/@lobehub/assets-logo/1.0.0/files/assets/logo-3d.webp">
6
+ <img height="120" src="https://gw.alipayobjects.com/zos/kitchen/qJ3l3EPsdW/split.svg">
7
+ <img height="120" src="https://registry.npmmirror.com/@lobehub/assets-emoji/1.3.0/files/assets/triangular-ruler.webp">
8
+
9
+ <h1>@lobehub/prettier-config</h1>
10
+
11
+ Prettier configuration for LobeHub projects
12
+
13
+ [![][npm-release-shield]][npm-release-link]
14
+ [![][npm-downloads-shield]][npm-downloads-link]
15
+ [![][github-license-shield]][github-license-link]
16
+
17
+ </div>
18
+
19
+ ## Features
20
+
21
+ - Sensible defaults for modern JavaScript/TypeScript projects
22
+ - Shell script formatting (`prettier-plugin-sh`)
23
+ - Package.json sorting (`prettier-plugin-packagejson`)
24
+ - JSON sorting (`prettier-plugin-sort-json`)
25
+
26
+ ## Installation
27
+
28
+ ```bash
29
+ pnpm add -D @lobehub/prettier-config prettier
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ Create `prettier.config.js` (or `prettier.config.mjs`) in your project root:
35
+
36
+ ```js
37
+ import config from '@lobehub/prettier-config';
38
+
39
+ export default config;
40
+ ```
41
+
42
+ Or add to your `package.json`:
43
+
44
+ ```json
45
+ {
46
+ "prettier": "@lobehub/prettier-config"
47
+ }
48
+ ```
49
+
50
+ ## Configuration
51
+
52
+ The config includes:
53
+
54
+ ```js
55
+ {
56
+ arrowParens: 'always',
57
+ bracketSpacing: true,
58
+ endOfLine: 'lf',
59
+ printWidth: 100,
60
+ proseWrap: 'never',
61
+ quoteProps: 'consistent',
62
+ singleQuote: true,
63
+ tabWidth: 2,
64
+ trailingComma: 'all',
65
+ useTabs: false,
66
+ plugins: [
67
+ 'prettier-plugin-sh',
68
+ 'prettier-plugin-packagejson',
69
+ 'prettier-plugin-sort-json',
70
+ ],
71
+ }
72
+ ```
73
+
74
+ ### Extending the Config
75
+
76
+ ```js
77
+ import config from '@lobehub/prettier-config';
78
+
79
+ export default {
80
+ ...config,
81
+ printWidth: 120,
82
+ };
83
+ ```
84
+
85
+ ## Requirements
86
+
87
+ - Node.js >= 18
88
+ - Prettier >= 3.0.0
89
+
90
+ ## License
91
+
92
+ MIT © [LobeHub](https://github.com/lobehub)
93
+
94
+ <!-- LINK GROUP -->
95
+
96
+ [github-license-link]: https://github.com/lobehub/lobe-lint/blob/master/LICENSE
97
+ [github-license-shield]: https://img.shields.io/github/license/lobehub/lobe-lint?color=white&labelColor=black&style=flat-square
98
+ [npm-downloads-link]: https://www.npmjs.com/package/@lobehub/prettier-config
99
+ [npm-downloads-shield]: https://img.shields.io/npm/dt/@lobehub/prettier-config?labelColor=black&style=flat-square
100
+ [npm-release-link]: https://www.npmjs.com/package/@lobehub/prettier-config
101
+ [npm-release-shield]: https://img.shields.io/npm/v/@lobehub/prettier-config?color=369eff&labelColor=black&logo=npm&logoColor=white&style=flat-square
package/dist/index.cjs ADDED
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ //#region src/index.ts
4
+ const config = {
5
+ arrowParens: "always",
6
+ bracketSpacing: true,
7
+ endOfLine: "lf",
8
+ jsonRecursiveSort: false,
9
+ jsonSortOrder: "{\"*\": \"lexical\"}",
10
+ overrides: [{
11
+ files: "*.md",
12
+ options: { proseWrap: "preserve" }
13
+ }],
14
+ plugins: [
15
+ "prettier-plugin-sh",
16
+ "prettier-plugin-packagejson",
17
+ "prettier-plugin-sort-json"
18
+ ],
19
+ printWidth: 100,
20
+ proseWrap: "never",
21
+ quoteProps: "consistent",
22
+ singleQuote: true,
23
+ tabWidth: 2,
24
+ trailingComma: "all",
25
+ useTabs: false
26
+ };
27
+ var src_default = config;
28
+
29
+ //#endregion
30
+ module.exports = src_default;
@@ -0,0 +1,8 @@
1
+ import { Config } from "prettier";
2
+
3
+ //#region src/index.d.ts
4
+ declare const config: Config;
5
+
6
+ //#endregion
7
+ export { config as default };
8
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":null,"mappings":";;;cAEM,QAAQ"}
@@ -0,0 +1,8 @@
1
+ import { Config } from "prettier";
2
+
3
+ //#region src/index.d.ts
4
+ declare const config: Config;
5
+
6
+ //#endregion
7
+ export { config as default };
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"sourcesContent":null,"mappings":";;;cAEM,QAAQ"}
package/dist/index.js ADDED
@@ -0,0 +1,29 @@
1
+ //#region src/index.ts
2
+ const config = {
3
+ arrowParens: "always",
4
+ bracketSpacing: true,
5
+ endOfLine: "lf",
6
+ jsonRecursiveSort: false,
7
+ jsonSortOrder: "{\"*\": \"lexical\"}",
8
+ overrides: [{
9
+ files: "*.md",
10
+ options: { proseWrap: "preserve" }
11
+ }],
12
+ plugins: [
13
+ "prettier-plugin-sh",
14
+ "prettier-plugin-packagejson",
15
+ "prettier-plugin-sort-json"
16
+ ],
17
+ printWidth: 100,
18
+ proseWrap: "never",
19
+ quoteProps: "consistent",
20
+ singleQuote: true,
21
+ tabWidth: 2,
22
+ trailingComma: "all",
23
+ useTabs: false
24
+ };
25
+ var src_default = config;
26
+
27
+ //#endregion
28
+ export { src_default as default };
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["config: Config"],"sources":["../src/index.ts"],"sourcesContent":["import type { Config } from 'prettier';\n\nconst config: Config = {\n arrowParens: 'always',\n bracketSpacing: true,\n endOfLine: 'lf',\n jsonRecursiveSort: false,\n jsonSortOrder: '{\"*\": \"lexical\"}',\n overrides: [\n {\n files: '*.md',\n options: {\n proseWrap: 'preserve',\n },\n },\n ],\n plugins: ['prettier-plugin-sh', 'prettier-plugin-packagejson', 'prettier-plugin-sort-json'],\n printWidth: 100,\n proseWrap: 'never',\n quoteProps: 'consistent',\n singleQuote: true,\n tabWidth: 2,\n trailingComma: 'all',\n useTabs: false,\n} as Config;\n\nexport default config;\n"],"mappings":";AAEA,MAAMA,SAAiB;CACrB,aAAa;CACb,gBAAgB;CAChB,WAAW;CACX,mBAAmB;CACnB,eAAe;CACf,WAAW,CACT;EACE,OAAO;EACP,SAAS,EACP,WAAW,WACZ;CAEJ,CAAA;CACD,SAAS;EAAC;EAAsB;EAA+B;CAA4B;CAC3F,YAAY;CACZ,WAAW;CACX,YAAY;CACZ,aAAa;CACb,UAAU;CACV,eAAe;CACf,SAAS;AACV;AAED,kBAAe"}
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@lobehub/prettier-config",
3
+ "version": "2.0.0-beta.10",
4
+ "description": "Prettier configuration for LobeHub projects",
5
+ "homepage": "https://github.com/lobehub/lobe-lint/tree/master/packages/prettier-config",
6
+ "bugs": {
7
+ "url": "https://github.com/lobehub/lobe-lint/issues/new"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/lobehub/lobe-lint.git",
12
+ "directory": "packages/prettier-config"
13
+ },
14
+ "license": "MIT",
15
+ "author": "canisminor1990 <i@canisminor.cc>, Innei <i@innei.in>",
16
+ "type": "module",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/index.js",
21
+ "require": "./dist/index.cjs"
22
+ }
23
+ },
24
+ "main": "./dist/index.cjs",
25
+ "module": "./dist/index.js",
26
+ "types": "./dist/index.d.ts",
27
+ "files": [
28
+ "dist"
29
+ ],
30
+ "dependencies": {
31
+ "prettier-plugin-packagejson": "^2.5.6",
32
+ "prettier-plugin-sh": "^0.14.0",
33
+ "prettier-plugin-sort-json": "^4.1.0"
34
+ },
35
+ "peerDependencies": {
36
+ "prettier": ">=3.0.0"
37
+ },
38
+ "engines": {
39
+ "node": ">=18"
40
+ },
41
+ "publishConfig": {
42
+ "access": "public",
43
+ "registry": "https://registry.npmjs.org"
44
+ },
45
+ "scripts": {
46
+ "build": "tsdown",
47
+ "dev": "tsdown --watch",
48
+ "type-check": "tsc --noEmit"
49
+ }
50
+ }