@cosyte/prettier-config 0.0.4 → 0.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 +23 -2
- package/README.md +96 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@cosyte/prettier-config` are documented here, following
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versions are managed with Changesets;
|
|
5
|
-
this file is hand-maintained (Changesets' own changelog generation is disabled). The package
|
|
6
|
-
|
|
5
|
+
this file is hand-maintained (Changesets' own changelog generation is disabled). The package is on the
|
|
6
|
+
**`0.1.x`** line: its surface is settled, and bump types follow ordinary semver rather than a
|
|
7
|
+
pre-alpha rule. See
|
|
8
|
+
[ADR 0002](../../documentation/decisions/0002-the-0-1-0-version-line.md).
|
|
7
9
|
|
|
8
10
|
> Because the generator is disabled, **`[Unreleased]` is promoted to a version heading BY HAND**, in
|
|
9
11
|
> the pull request that adds the changeset. Nothing does it automatically. Until 2026-08-04 nothing
|
|
@@ -11,6 +13,25 @@ the **`0.0.x`-until-first-alpha** ladder.
|
|
|
11
13
|
|
|
12
14
|
## [Unreleased]
|
|
13
15
|
|
|
16
|
+
## [0.1.0] - Unreleased
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- **The package leaves the pre-alpha version ladder for the `0.1.x` line.** No setting change: the
|
|
21
|
+
shared Prettier settings and their overrides are byte-identical to `0.0.4`. What moves is the
|
|
22
|
+
version policy this package states about itself, and the reasoning is in
|
|
23
|
+
[ADR 0002](../../documentation/decisions/0002-the-0-1-0-version-line.md). A consumer pinned at
|
|
24
|
+
`^0.0.4` does not resolve this release and has to widen its range once.
|
|
25
|
+
- The `README.md` in the tarball now opens its `## Status` section on the settled-line sentence
|
|
26
|
+
instead of the pre-alpha ladder one, so the policy text a consumer reads agrees with the version
|
|
27
|
+
printed beside it. `scripts/readme-check.mjs` grades that sentence against the release line the
|
|
28
|
+
pending changesets resolve to.
|
|
29
|
+
- The `0.0.4` section below was relabelled: its content had shipped and was still sitting under
|
|
30
|
+
`[Unreleased]`, which is the same defect the note above describes, recurring one release after it
|
|
31
|
+
was written down. That relabelling changes only the `CHANGELOG.md` inside the published tarball.
|
|
32
|
+
|
|
33
|
+
## [0.0.4] - 2026-08-04
|
|
34
|
+
|
|
14
35
|
### Changed
|
|
15
36
|
|
|
16
37
|
- The sections below were relabelled: content that had already shipped was still sitting under
|
package/README.md
CHANGED
|
@@ -1,8 +1,38 @@
|
|
|
1
|
+
<a href="https://cosyte.com">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://cosyte.com/tile/cosyte-lockup-tile-on-dark-1200x300.png">
|
|
4
|
+
<img alt="The Cosyte logo on its own white ground: the icon beside the word Cosyte." src="https://cosyte.com/tile/cosyte-lockup-tile-on-light-1200x300.png">
|
|
5
|
+
</picture>
|
|
6
|
+
</a>
|
|
7
|
+
|
|
1
8
|
# @cosyte/prettier-config
|
|
2
9
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
10
|
+
> One formatter setting sheet for every cosyte repository, adopted in a single line.
|
|
11
|
+
|
|
12
|
+
[](https://www.npmjs.com/package/@cosyte/prettier-config)
|
|
13
|
+
[](https://github.com/cosyte/config/actions/workflows/ci.yml)
|
|
14
|
+
[](https://github.com/cosyte/config/blob/main/LICENSE)
|
|
15
|
+
[](https://nodejs.org)
|
|
16
|
+
|
|
17
|
+
Shared Prettier configuration for @cosyte/\* packages.
|
|
18
|
+
|
|
19
|
+
## Why this exists
|
|
20
|
+
|
|
21
|
+
Formatting is the one thing a code review should never be about, and a per-repo `.prettierrc` makes
|
|
22
|
+
it about that anyway: two repositories disagree by one setting, a contributor moves between them,
|
|
23
|
+
and every diff carries reformatting noise that hides the change.
|
|
24
|
+
|
|
25
|
+
The nearest alternative is committing the same `.prettierrc` everywhere. That is the drift this
|
|
26
|
+
removes: adopting the settings is one `package.json` field, and changing them is a version bump
|
|
27
|
+
rather than ten pull requests.
|
|
28
|
+
|
|
29
|
+
## Status
|
|
30
|
+
|
|
31
|
+
`@cosyte/prettier-config` is on the cosyte 0.1.x line: the public API is settled and bump types follow ordinary semver.
|
|
32
|
+
|
|
33
|
+
Still moving: the `printWidth` and the per-filetype overrides. Both are the kind of setting that
|
|
34
|
+
reformats an entire repository when it changes, so a consumer that cares should pin an exact version
|
|
35
|
+
and take the reformat deliberately.
|
|
6
36
|
|
|
7
37
|
## Install
|
|
8
38
|
|
|
@@ -10,7 +40,9 @@ semicolons, trailing commas, `arrowParens: always`, and LF line endings, with th
|
|
|
10
40
|
pnpm add -D @cosyte/prettier-config prettier
|
|
11
41
|
```
|
|
12
42
|
|
|
13
|
-
|
|
43
|
+
`prettier` is a peer dependency. Node `>=22.14`. The package ships one JSON file and no code.
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
14
46
|
|
|
15
47
|
In `package.json`:
|
|
16
48
|
|
|
@@ -18,5 +50,63 @@ In `package.json`:
|
|
|
18
50
|
{ "prettier": "@cosyte/prettier-config" }
|
|
19
51
|
```
|
|
20
52
|
|
|
21
|
-
|
|
22
|
-
|
|
53
|
+
Then format and check as usual:
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
pnpm exec prettier --write "**/*.{js,mjs,ts,json,md,yml,yaml}"
|
|
57
|
+
pnpm exec prettier --check "**/*.{js,mjs,ts,json,md,yml,yaml}"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Keep the two globs identical. A `--write` that covers a file `--check` does not is a formatting
|
|
61
|
+
violation that can never fail CI, which is how a repository ends up with a green check over files
|
|
62
|
+
nobody reads.
|
|
63
|
+
|
|
64
|
+
## Entry points
|
|
65
|
+
|
|
66
|
+
| entry point | what it is |
|
|
67
|
+
| ------------------------- | ----------------------------------------------------------------------------- |
|
|
68
|
+
| `@cosyte/prettier-config` | the config object itself (`index.json`), ready for the `prettier` field above |
|
|
69
|
+
|
|
70
|
+
There is no JavaScript entry point, because the package is one JSON file a tool reads rather than a
|
|
71
|
+
module a consumer calls. That is also why no example here is executed by this repository's test run:
|
|
72
|
+
there is nothing to call.
|
|
73
|
+
|
|
74
|
+
## Overrides
|
|
75
|
+
|
|
76
|
+
Every key is overridable: Prettier has no enforcement of its own, so a divergence costs nothing but
|
|
77
|
+
the divergence. Point the `prettier` field at your own module and spread this one, which is the
|
|
78
|
+
shape Prettier supports for extending a shared config:
|
|
79
|
+
|
|
80
|
+
```js
|
|
81
|
+
// prettier.config.js
|
|
82
|
+
import cosyte from "@cosyte/prettier-config" with { type: "json" };
|
|
83
|
+
|
|
84
|
+
export default { ...cosyte, printWidth: 80 };
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Prefer changing it here and taking a version bump. A per-repo override is a formatting dialect, and
|
|
88
|
+
the point of a shared config is that there is one.
|
|
89
|
+
|
|
90
|
+
## PHI and safety
|
|
91
|
+
|
|
92
|
+
This package is formatter configuration. It contains no code, reads no input, and never sees patient
|
|
93
|
+
data: it is one JSON file Prettier reads. Nothing here logs, retains or transmits anything.
|
|
94
|
+
|
|
95
|
+
## Compatibility
|
|
96
|
+
|
|
97
|
+
`printWidth` 100, double quotes, semicolons, trailing commas, `arrowParens: always`, and LF line
|
|
98
|
+
endings, with the standard `*.md`, JSON and YAML overrides. `proseWrap` is `preserve`, so Prettier
|
|
99
|
+
reflows no prose: a markdown line stays where its author put it.
|
|
100
|
+
|
|
101
|
+
## Contributing
|
|
102
|
+
|
|
103
|
+
Questions, bug reports and proposals go to
|
|
104
|
+
[the issue tracker](https://github.com/cosyte/config/issues). Pull requests are welcome, in
|
|
105
|
+
[cosyte/config](https://github.com/cosyte/config), where this package lives.
|
|
106
|
+
|
|
107
|
+
A change has to clear the required `verify` job, and a change to a setting here needs a changeset
|
|
108
|
+
saying what moved: every consumer reformats on the version bump.
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
MIT, copyright Cosyte. See [LICENSE](https://github.com/cosyte/config/blob/main/LICENSE).
|