@timbic/prettier-config 1.1.0 → 1.1.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/README.md +29 -3
- package/dist/index.d.ts +9 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Extensible prettier configuration for the smart developers.
|
|
|
8
8
|
pnpm add -D prettier @timbic/prettier-config
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
```
|
|
11
|
+
```ts
|
|
12
12
|
import withTimbic from "@timbic/prettier-config";
|
|
13
13
|
|
|
14
14
|
export default withTimbic();
|
|
@@ -22,9 +22,35 @@ export default withTimbic({
|
|
|
22
22
|
|
|
23
23
|
Your options will override the defaults and extend the config.
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## Types
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
Now this package has its own types! That means that when using withTimbic() you will get enhanced type annotations by Quick Info on each
|
|
28
|
+
rule, as well as the right default set by withTimbic(), e.g.
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
// before
|
|
32
|
+
export default withTimbic({
|
|
33
|
+
tabWidth: 3,
|
|
34
|
+
// Specify the number of spaces per indentation-level.
|
|
35
|
+
// @default
|
|
36
|
+
//
|
|
37
|
+
// 2 (incorrect, this is not a withTimbic() default, this is prettier default)
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// after
|
|
41
|
+
export default withTimbic({
|
|
42
|
+
tabWidth: 3,
|
|
43
|
+
// Specify the number of spaces per indentation-level.
|
|
44
|
+
// @default
|
|
45
|
+
//
|
|
46
|
+
// 4 (correct, see our default options below)
|
|
47
|
+
// @see — https://prettier.io/docs/options#tab-width
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Default options
|
|
52
|
+
|
|
53
|
+
```ts
|
|
28
54
|
{
|
|
29
55
|
arrowParens: "always",
|
|
30
56
|
bracketSameLine: false,
|
package/dist/index.d.ts
CHANGED
|
@@ -31,9 +31,9 @@ interface Options {
|
|
|
31
31
|
*
|
|
32
32
|
* @see https://prettier.io/docs/options#tabs
|
|
33
33
|
*/
|
|
34
|
-
useTabs
|
|
35
|
-
parentParser?: string
|
|
36
|
-
__embeddedInHtml?: boolean
|
|
34
|
+
useTabs: boolean;
|
|
35
|
+
parentParser?: string;
|
|
36
|
+
__embeddedInHtml?: boolean;
|
|
37
37
|
/**
|
|
38
38
|
* Print semicolons at the ends of statements.
|
|
39
39
|
* @default true
|
|
@@ -100,10 +100,14 @@ interface Options {
|
|
|
100
100
|
rangeEnd: number;
|
|
101
101
|
/**
|
|
102
102
|
* Specify which parser to use.
|
|
103
|
+
*
|
|
104
|
+
* @see https://prettier.io/docs/options#parser
|
|
103
105
|
*/
|
|
104
106
|
parser: LiteralUnion<BuiltInParserName>;
|
|
105
107
|
/**
|
|
106
108
|
* Specify the input filepath. This will be used to do parser inference.
|
|
109
|
+
*
|
|
110
|
+
* @see https://prettier.io/docs/options#file-path
|
|
107
111
|
*/
|
|
108
112
|
filepath: string;
|
|
109
113
|
/**
|
|
@@ -148,6 +152,8 @@ interface Options {
|
|
|
148
152
|
arrowParens: "avoid" | "always";
|
|
149
153
|
/**
|
|
150
154
|
* Provide ability to support new languages to prettier.
|
|
155
|
+
*
|
|
156
|
+
* @see https://prettier.io/docs/plugins
|
|
151
157
|
*/
|
|
152
158
|
plugins: Array<string | URL | Plugin>;
|
|
153
159
|
/**
|