@timbic/prettier-config 1.1.4 → 1.2.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @timbic/prettier-config
2
2
 
3
- Extensible prettier configuration for the smart developers.
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 by Quick Info on each
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,21 +1,21 @@
1
1
  import { BuiltInParserName, LiteralUnion, Plugin } from "prettier";
2
- //#region src/types.d.ts
2
+ //#region src/index.d.ts
3
3
  /**
4
- * For use in `.prettierrc.js`, `.prettierrc.ts`, `.prettierrc.cjs`, `.prettierrc.cts`, `prettierrc.mjs`, `prettierrc.mts`, `prettier.config.js`, `prettier.config.ts`, `prettier.config.cjs`, `prettier.config.cts`, `prettier.config.mjs`, `prettier.config.mts`
4
+ * For use in `prettier.config.js`, `prettier.config.ts`, `prettier.config.mjs`, `prettier.config.mts`
5
5
  */
6
- interface Config extends Partial<Options> {
6
+ export interface Config extends Partial<Options> {
7
7
  overrides?: Array<{
8
8
  files: string | string[];
9
9
  excludeFiles?: string | string[];
10
10
  options?: Options;
11
11
  }>;
12
12
  }
13
- interface Options {
13
+ export 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,30 @@ interface Options {
224
224
  */
225
225
  [_: string]: unknown;
226
226
  }
227
- //#endregion
228
- //#region src/index.d.ts
229
- declare function withTimbic(options?: Config): Config;
230
- //#endregion
231
- export { withTimbic as default };
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
+ */
252
+ export default function withTimbic(options?: Config): Config;
253
+ //#endregion
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@timbic/prettier-config",
3
3
  "type": "module",
4
- "version": "1.1.4",
4
+ "version": "1.2.1",
5
5
  "private": false,
6
6
  "description": "Timbic's prettier configuration",
7
7
  "author": "Timur Bikmuhametov <tim.bic22@gmail.com>",
@@ -29,13 +29,14 @@
29
29
  "prettier": "^3.0.0"
30
30
  },
31
31
  "devDependencies": {
32
- "prettier": "^3.9.6",
33
- "@timbic/eslint-config": "1.0.0",
34
- "bumpp": "12.0.0",
35
- "eslint": "10.7.0",
32
+ "@timbic/eslint-config": "1.2.0",
33
+ "@types/node": "26.4.1",
34
+ "bumpp": "12.3.0",
35
+ "eslint": "10.9.1",
36
36
  "husky": "9.1.7",
37
- "lint-staged": "17.2.0",
38
- "tsdown": "0.22.14",
37
+ "lint-staged": "17.4.1",
38
+ "prettier": "3.9.6",
39
+ "tsdown": "0.23.0",
39
40
  "typescript": "6.0.3"
40
41
  },
41
42
  "lint-staged": {