@dnd-mapp/config-prettier 1.0.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 +16 -0
- package/LICENSE +21 -0
- package/README.md +68 -0
- package/configs/base.js +16 -0
- package/index.js +1 -0
- package/package.json +37 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [1.0.0] - 2026-09-20
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- `base` config, available as `@dnd-mapp/config-prettier` and `@dnd-mapp/config-prettier/base`.
|
|
14
|
+
|
|
15
|
+
[Unreleased]: https://github.com/dnd-mapp/config-prettier/compare/v1.0.0...HEAD
|
|
16
|
+
[1.0.0]: https://github.com/dnd-mapp/config-prettier/releases/tag/v1.0.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 D&D Mapp
|
|
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,68 @@
|
|
|
1
|
+
# @dnd-mapp/config-prettier
|
|
2
|
+
|
|
3
|
+
[](https://github.com/dnd-mapp/config-prettier/actions/workflows/push-main.yaml)
|
|
4
|
+
[](https://www.npmjs.com/package/@dnd-mapp/config-prettier)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
Shared Prettier config for all D&D Mapp projects.
|
|
8
|
+
|
|
9
|
+
## Requirements
|
|
10
|
+
|
|
11
|
+
- Prettier 3 is a peer dependency and must be installed in your project.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm add --save-dev prettier @dnd-mapp/config-prettier
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
Reference the config from a `.prettierrc` file in your project root.
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
"@dnd-mapp/config-prettier"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
To add your own options, re-export the config from a `prettier.config.js` file instead.
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
import config from '@dnd-mapp/config-prettier';
|
|
31
|
+
|
|
32
|
+
export default {
|
|
33
|
+
...config,
|
|
34
|
+
printWidth: 100,
|
|
35
|
+
};
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Available configs
|
|
39
|
+
|
|
40
|
+
| Config | Import path | Description |
|
|
41
|
+
|:-------|:---------------------------------|:-----------------------------------|
|
|
42
|
+
| `base` | `@dnd-mapp/config-prettier/base` | The default config for any project |
|
|
43
|
+
|
|
44
|
+
The package root, `@dnd-mapp/config-prettier`, resolves to `base`.
|
|
45
|
+
|
|
46
|
+
## What `base` sets
|
|
47
|
+
|
|
48
|
+
| Option | Value | Description |
|
|
49
|
+
|:--------------|:---------------|:-------------------------------------------------|
|
|
50
|
+
| `printWidth` | `120` | Wraps code at 120 columns |
|
|
51
|
+
| `quoteProps` | `'consistent'` | Quotes object properties only if one requires it |
|
|
52
|
+
| `singleQuote` | `true` | Uses single quotes instead of double quotes |
|
|
53
|
+
|
|
54
|
+
The config has one override. Files that match `*.yaml` or `*.yml` use double quotes, so `singleQuote` is `false` for them.
|
|
55
|
+
|
|
56
|
+
The config does not set `tabWidth`. Prettier reads it from the `.editorconfig` file in your project, so set `indent_size` there.
|
|
57
|
+
|
|
58
|
+
## Changelog
|
|
59
|
+
|
|
60
|
+
Notable changes for consumers of this package are listed in the [changelog](CHANGELOG.md).
|
|
61
|
+
|
|
62
|
+
## Contributing
|
|
63
|
+
|
|
64
|
+
Contributions are welcome. See the [contributing guide](CONTRIBUTING.md) for details.
|
|
65
|
+
|
|
66
|
+
## License
|
|
67
|
+
|
|
68
|
+
[MIT](LICENSE) © D&D Mapp
|
package/configs/base.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @type {import('prettier').Config} */
|
|
2
|
+
const config = {
|
|
3
|
+
overrides: [
|
|
4
|
+
{
|
|
5
|
+
files: ['*.yaml', '*.yml'],
|
|
6
|
+
options: {
|
|
7
|
+
singleQuote: false,
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
],
|
|
11
|
+
printWidth: 120,
|
|
12
|
+
quoteProps: 'consistent',
|
|
13
|
+
singleQuote: true,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default config;
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './configs/base.js';
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dnd-mapp/config-prettier",
|
|
3
|
+
"description": "Prettier configuration shared across D&D Mapp projects.",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"author": "D&D Mapp",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"dnd-mapp",
|
|
10
|
+
"prettier",
|
|
11
|
+
"prettier-config",
|
|
12
|
+
"config",
|
|
13
|
+
"formatting"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/dnd-mapp/config-prettier#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/dnd-mapp/config-prettier/issues"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/dnd-mapp/config-prettier.git"
|
|
22
|
+
},
|
|
23
|
+
"exports": {
|
|
24
|
+
".": "./index.js",
|
|
25
|
+
"./*": "./configs/*.js",
|
|
26
|
+
"./package.json": "./package.json"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": "^24.21.0"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"prettier": "^3"
|
|
36
|
+
}
|
|
37
|
+
}
|