@timbic/prettier-config 1.1.3 → 1.2.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 +4 -3
- package/dist/index.d.ts +29 -6
- package/package.json +8 -9
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @timbic/prettier-config
|
|
2
2
|
|
|
3
|
-
Extensible prettier configuration for
|
|
3
|
+
Extensible prettier configuration for smart developers.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
@@ -9,6 +9,7 @@ pnpm add -D prettier @timbic/prettier-config
|
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
```ts
|
|
12
|
+
// prettier.config.{js,mjs,ts,mts}
|
|
12
13
|
import withTimbic from "@timbic/prettier-config";
|
|
13
14
|
|
|
14
15
|
export default withTimbic();
|
|
@@ -24,7 +25,7 @@ Your options will override the defaults and extend the config.
|
|
|
24
25
|
|
|
25
26
|
## Types
|
|
26
27
|
|
|
27
|
-
Now this package has its own types! That means that when using withTimbic() you will get enhanced type annotations
|
|
28
|
+
Now this package has its own types! That means that when using withTimbic() you will get enhanced type annotations via Quick Info on each
|
|
28
29
|
rule, as well as the right default set by withTimbic(), e.g.
|
|
29
30
|
|
|
30
31
|
```ts
|
|
@@ -34,7 +35,7 @@ export default withTimbic({
|
|
|
34
35
|
// Specify the number of spaces per indentation-level.
|
|
35
36
|
// @default
|
|
36
37
|
//
|
|
37
|
-
// 2 (incorrect, this is not a withTimbic() default, this is prettier default)
|
|
38
|
+
// 2 (incorrect, this is not a withTimbic() default, this is the prettier default)
|
|
38
39
|
});
|
|
39
40
|
|
|
40
41
|
// after
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BuiltInParserName, LiteralUnion, Plugin } from "prettier";
|
|
2
|
-
//#region src/
|
|
2
|
+
//#region src/index.d.ts
|
|
3
3
|
/**
|
|
4
|
-
* For use in
|
|
4
|
+
* For use in `prettier.config.js`, `prettier.config.ts`, `prettier.config.mjs`, `prettier.config.mts`
|
|
5
5
|
*/
|
|
6
6
|
interface Config extends Partial<Options> {
|
|
7
7
|
overrides?: Array<{
|
|
@@ -12,10 +12,10 @@ interface Config extends Partial<Options> {
|
|
|
12
12
|
}
|
|
13
13
|
interface Options {
|
|
14
14
|
/**
|
|
15
|
+
* @see https://prettier.io/docs/options#print-width
|
|
15
16
|
* Specify the line length that the printer will wrap on.
|
|
16
17
|
* @default 140
|
|
17
18
|
*
|
|
18
|
-
* @see https://prettier.io/docs/options#print-width
|
|
19
19
|
*/
|
|
20
20
|
printWidth: number;
|
|
21
21
|
/**
|
|
@@ -224,8 +224,31 @@ interface Options {
|
|
|
224
224
|
*/
|
|
225
225
|
[_: string]: unknown;
|
|
226
226
|
}
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
/**
|
|
228
|
+
* Returns a Prettier config preset with the Timbic defaults, merged with any
|
|
229
|
+
* user-provided options.
|
|
230
|
+
*
|
|
231
|
+
* @param options - Optional configuration to override the Timbic defaults.
|
|
232
|
+
* @returns The merged Prettier config object.
|
|
233
|
+
*
|
|
234
|
+
* @example
|
|
235
|
+
* ```ts
|
|
236
|
+
* export default withTimbic({
|
|
237
|
+
* singleQuote: true,
|
|
238
|
+
* });
|
|
239
|
+
* ```
|
|
240
|
+
* Returns the default config with `singleQuote` overridden to `true`:
|
|
241
|
+
* ```ts
|
|
242
|
+
* {
|
|
243
|
+
* arrowParens: "always",
|
|
244
|
+
* bracketSameLine: false,
|
|
245
|
+
* bracketSpacing: true,
|
|
246
|
+
* checkIgnorePragma: false,
|
|
247
|
+
* singleQuote: true,
|
|
248
|
+
* // ...other options
|
|
249
|
+
* }
|
|
250
|
+
* ```
|
|
251
|
+
*/
|
|
229
252
|
declare function withTimbic(options?: Config): Config;
|
|
230
253
|
//#endregion
|
|
231
|
-
export { withTimbic as default };
|
|
254
|
+
export { Config, Options, withTimbic as default };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@timbic/prettier-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Timbic's prettier configuration",
|
|
7
7
|
"author": "Timur Bikmuhametov <tim.bic22@gmail.com>",
|
|
@@ -28,16 +28,15 @@
|
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"prettier": "^3.0.0"
|
|
30
30
|
},
|
|
31
|
-
"dependencies": {
|
|
32
|
-
"prettier": "^3.9.6"
|
|
33
|
-
},
|
|
34
31
|
"devDependencies": {
|
|
35
|
-
"@timbic/eslint-config": "1.
|
|
36
|
-
"
|
|
37
|
-
"
|
|
32
|
+
"@timbic/eslint-config": "1.2.0",
|
|
33
|
+
"@types/node": "26.4.1",
|
|
34
|
+
"bumpp": "12.2.2",
|
|
35
|
+
"eslint": "10.9.1",
|
|
38
36
|
"husky": "9.1.7",
|
|
39
|
-
"lint-staged": "17.1
|
|
40
|
-
"
|
|
37
|
+
"lint-staged": "17.4.1",
|
|
38
|
+
"prettier": "3.9.6",
|
|
39
|
+
"tsdown": "0.22.14",
|
|
41
40
|
"typescript": "6.0.3"
|
|
42
41
|
},
|
|
43
42
|
"lint-staged": {
|