@dnd-mapp/config-prettier 1.0.0 → 1.1.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/CHANGELOG.md CHANGED
@@ -6,11 +6,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.1.0] - 2026-09-20
10
+
11
+ ### Added
12
+
13
+ - `organize-imports` config, available as `@dnd-mapp/config-prettier/organize-imports`. It extends `base` with `prettier-plugin-organize-imports`.
14
+ - Type declarations for every config. Each one is typed as a Prettier `Config`.
15
+ - `prettier-plugin-organize-imports` and `typescript` as optional peer dependencies. Install them to use the `organize-imports` config.
16
+
9
17
  ## [1.0.0] - 2026-09-20
10
18
 
11
19
  ### Added
12
20
 
13
21
  - `base` config, available as `@dnd-mapp/config-prettier` and `@dnd-mapp/config-prettier/base`.
14
22
 
15
- [Unreleased]: https://github.com/dnd-mapp/config-prettier/compare/v1.0.0...HEAD
23
+ [Unreleased]: https://github.com/dnd-mapp/config-prettier/compare/v1.1.0...HEAD
24
+ [1.1.0]: https://github.com/dnd-mapp/config-prettier/releases/tag/v1.1.0
16
25
  [1.0.0]: https://github.com/dnd-mapp/config-prettier/releases/tag/v1.0.0
package/README.md CHANGED
@@ -37,12 +37,31 @@ export default {
37
37
 
38
38
  ## Available configs
39
39
 
40
- | Config | Import path | Description |
41
- |:-------|:---------------------------------|:-----------------------------------|
42
- | `base` | `@dnd-mapp/config-prettier/base` | The default config for any project |
40
+ | Config | Import path | Description |
41
+ |:-------------------|:---------------------------------------------|:------------------------------------------------|
42
+ | `base` | `@dnd-mapp/config-prettier/base` | The default config for any project |
43
+ | `organize-imports` | `@dnd-mapp/config-prettier/organize-imports` | Extends `base` with the organize imports plugin |
43
44
 
44
45
  The package root, `@dnd-mapp/config-prettier`, resolves to `base`.
45
46
 
47
+ Every config ships with type declarations. Each one is typed as a Prettier `Config`, so it works in a `prettier.config.ts` file.
48
+
49
+ ### `organize-imports`
50
+
51
+ This config includes everything from `base` and adds [`prettier-plugin-organize-imports`](https://github.com/simonhaenisch/prettier-plugin-organize-imports). The plugin sorts and removes unused imports when Prettier formats a file.
52
+
53
+ The plugin is an optional peer dependency, so install it together with `typescript`, which it requires. The supported versions are `prettier-plugin-organize-imports` 4 and `typescript` 6.
54
+
55
+ ```bash
56
+ pnpm add --save-dev prettier prettier-plugin-organize-imports typescript @dnd-mapp/config-prettier
57
+ ```
58
+
59
+ Then re-export the config from a `prettier.config.js` file.
60
+
61
+ ```js
62
+ export { default } from '@dnd-mapp/config-prettier/organize-imports';
63
+ ```
64
+
46
65
  ## What `base` sets
47
66
 
48
67
  | Option | Value | Description |
@@ -0,0 +1,4 @@
1
+ import type { Config } from 'prettier';
2
+ /** The base Prettier config for D&D Mapp projects. */
3
+ declare const config: Config;
4
+ export default config;
package/configs/base.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @type {import('prettier').Config} */
1
+ /** The base Prettier config for D&D Mapp projects. */
2
2
  const config = {
3
3
  overrides: [
4
4
  {
@@ -12,5 +12,4 @@ const config = {
12
12
  quoteProps: 'consistent',
13
13
  singleQuote: true,
14
14
  };
15
-
16
15
  export default config;
@@ -0,0 +1,4 @@
1
+ import type { Config } from 'prettier';
2
+ /** The base Prettier config with import organizing. */
3
+ declare const config: Config;
4
+ export default config;
@@ -0,0 +1,7 @@
1
+ import base from "./base.js";
2
+ /** The base Prettier config with import organizing. */
3
+ const config = {
4
+ ...base,
5
+ plugins: ['prettier-plugin-organize-imports'],
6
+ };
7
+ export default config;
package/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import type { Config } from 'prettier';
2
+ /** The default Prettier config for D&D Mapp projects. */
3
+ declare const config: Config;
4
+ export default config;
package/index.js CHANGED
@@ -1 +1,4 @@
1
- export { default } from './configs/base.js';
1
+ import base from "./configs/base.js";
2
+ /** The default Prettier config for D&D Mapp projects. */
3
+ const config = base;
4
+ export default config;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dnd-mapp/config-prettier",
3
3
  "description": "Prettier configuration shared across D&D Mapp projects.",
4
- "version": "1.0.0",
4
+ "version": "1.1.0",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "author": "D&D Mapp",
@@ -21,8 +21,14 @@
21
21
  "url": "git+https://github.com/dnd-mapp/config-prettier.git"
22
22
  },
23
23
  "exports": {
24
- ".": "./index.js",
25
- "./*": "./configs/*.js",
24
+ ".": {
25
+ "types": "./index.d.ts",
26
+ "default": "./index.js"
27
+ },
28
+ "./*": {
29
+ "types": "./configs/*.d.ts",
30
+ "default": "./configs/*.js"
31
+ },
26
32
  "./package.json": "./package.json"
27
33
  },
28
34
  "publishConfig": {
@@ -32,6 +38,16 @@
32
38
  "node": "^24.21.0"
33
39
  },
34
40
  "peerDependencies": {
35
- "prettier": "^3"
41
+ "prettier": "^3",
42
+ "prettier-plugin-organize-imports": "^4",
43
+ "typescript": "^6"
44
+ },
45
+ "peerDependenciesMeta": {
46
+ "prettier-plugin-organize-imports": {
47
+ "optional": true
48
+ },
49
+ "typescript": {
50
+ "optional": true
51
+ }
36
52
  }
37
53
  }