Skip to content

Commit 8dced8a

Browse files
feat: move sentences-per-line from Markdownlint to Prettier (#2285)
## PR Checklist - [x] Addresses an existing open issue: fixes #2216 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md) were taken ## Overview Uses [`prettier-plugin-sentences-per-line`](https://www.npmjs.com/package/prettier-plugin-sentences-per-line) to move this formatting/style concern to the formatter. This creates a new `blockPrettierPluginSentencesPerLine` separate from Markdownlint. As a tooling benefit, now the `lint:md` command doesn't have to add in a `--rules`. This also applies the rule to `CODE_OF_CONDUCT.md`. I'd previously resisted because I didn't want to mess with the pre-provided copy&paste of the Contributor Covenant. But it's simpler to just apply the whitespace changes. 🎁
1 parent 32a8bb8 commit 8dced8a

13 files changed

+157
-135
lines changed

.github/CODE_OF_CONDUCT.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,29 +78,31 @@ unprofessional or unwelcome in the community.
7878

7979
**Consequence**: A private, written warning from community leaders, providing
8080
clarity around the nature of the violation and an explanation of why the
81-
behavior was inappropriate. A public apology may be requested.
81+
behavior was inappropriate.
82+
A public apology may be requested.
8283

8384
### 2. Warning
8485

8586
**Community Impact**: A violation through a single incident or series of
8687
actions.
8788

88-
**Consequence**: A warning with consequences for continued behavior. No
89-
interaction with the people involved, including unsolicited interaction with
90-
those enforcing the Code of Conduct, for a specified period of time. This
91-
includes avoiding interactions in community spaces as well as external channels
92-
like social media. Violating these terms may lead to a temporary or permanent
93-
ban.
89+
**Consequence**: A warning with consequences for continued behavior.
90+
No interaction with the people involved, including unsolicited interaction with
91+
those enforcing the Code of Conduct, for a specified period of time.
92+
This includes avoiding interactions in community spaces as well as external
93+
channels like social media.
94+
Violating these terms may lead to a temporary or permanent ban.
9495

9596
### 3. Temporary Ban
9697

9798
**Community Impact**: A serious violation of community standards, including
9899
sustained inappropriate behavior.
99100

100101
**Consequence**: A temporary ban from any sort of interaction or public
101-
communication with the community for a specified period of time. No public or
102-
private interaction with the people involved, including unsolicited interaction
103-
with those enforcing the Code of Conduct, is allowed during this period.
102+
communication with the community for a specified period of time.
103+
No public or private interaction with the people involved, including unsolicited
104+
interaction with those enforcing the Code of Conduct, is allowed during this
105+
period.
104106
Violating these terms may lead to a permanent ban.
105107

106108
### 4. Permanent Ban
@@ -122,7 +124,8 @@ Community Impact Guidelines were inspired by
122124
[Mozilla's code of conduct enforcement ladder][mozilla coc].
123125

124126
For answers to common questions about this code of conduct, see the FAQ at
125-
[https://www.contributor-covenant.org/faq][faq]. Translations are available at
127+
[https://www.contributor-covenant.org/faq][faq].
128+
Translations are available at
126129
[https://www.contributor-covenant.org/translations][translations].
127130

128131
[homepage]: https://www.contributor-covenant.org

.prettierrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"plugins": [
55
"prettier-plugin-curly",
66
"prettier-plugin-packagejson",
7+
"prettier-plugin-sentences-per-line",
78
"prettier-plugin-sh"
89
],
910
"useTabs": true

docs/Blocks.md

Lines changed: 57 additions & 51 deletions
Large diffs are not rendered by default.

docs/FAQs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Yes! If you want to read the [GitHub Actions documentation](https://docs.github.
1919
Here we'll outline the steps required to migrate a CTA app to a GitHub Action:
2020

2121
1. GitHub Actions store built output on a GitHub branch rather than in a published package on npm.
22-
As a consequence we should:
22+
As a consequence we should:
2323
- delete `.github/workflows/release.yml` and `.github/workflows/post-release.yml`.
2424
- update `.github/workflows/build.yml` to ensure `dist` is up to date:
2525

@@ -66,8 +66,8 @@ Here we'll outline the steps required to migrate a CTA app to a GitHub Action:
6666
</details>
6767
6868
- GitHub Actions run without installing package dependencies.
69-
Replace `tsdown` with [`ncc`](https://github.com/vercel/ncc) to build source files and dependencies into a single JS file.
70-
Delete `tsdown.config.ts` then execute the following commands:
69+
Replace `tsdown` with [`ncc`](https://github.com/vercel/ncc) to build source files and dependencies into a single JS file.
70+
Delete `tsdown.config.ts` then execute the following commands:
7171

7272
```bash
7373
pnpm remove tsdown

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"format": "prettier .",
2727
"lint": "eslint . --max-warnings 0",
2828
"lint:knip": "knip",
29-
"lint:md": "markdownlint \"**/*.md\" \".github/**/*.md\" --rules markdownlint-sentences-per-line",
29+
"lint:md": "markdownlint \"**/*.md\" \".github/**/*.md\"",
3030
"lint:packages": "pnpm dedupe --check",
3131
"lint:spelling": "cspell \"**\" \".github/**/*\"",
3232
"prepare": "husky",
@@ -107,10 +107,10 @@
107107
"lodash": "4.17.21",
108108
"markdownlint": "0.38.0",
109109
"markdownlint-cli": "0.45.0",
110-
"markdownlint-sentences-per-line": "0.1.1",
111110
"prettier": "3.6.1",
112111
"prettier-plugin-curly": "0.3.2",
113112
"prettier-plugin-packagejson": "2.5.15",
113+
"prettier-plugin-sentences-per-line": "0.1.0",
114114
"prettier-plugin-sh": "0.17.4",
115115
"release-it": "19.0.3",
116116
"tsdown": "0.12.7",

pnpm-lock.yaml

Lines changed: 12 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/blocks/blockContributorCovenant.test.ts

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -116,29 +116,31 @@ describe("blockContributorCovenant", () => {
116116
117117
**Consequence**: A private, written warning from community leaders, providing
118118
clarity around the nature of the violation and an explanation of why the
119-
behavior was inappropriate. A public apology may be requested.
119+
behavior was inappropriate.
120+
A public apology may be requested.
120121
121122
### 2. Warning
122123
123124
**Community Impact**: A violation through a single incident or series of
124125
actions.
125126
126-
**Consequence**: A warning with consequences for continued behavior. No
127-
interaction with the people involved, including unsolicited interaction with
128-
those enforcing the Code of Conduct, for a specified period of time. This
129-
includes avoiding interactions in community spaces as well as external channels
130-
like social media. Violating these terms may lead to a temporary or permanent
131-
ban.
127+
**Consequence**: A warning with consequences for continued behavior.
128+
No interaction with the people involved, including unsolicited interaction with
129+
those enforcing the Code of Conduct, for a specified period of time.
130+
This includes avoiding interactions in community spaces as well as external
131+
channels like social media.
132+
Violating these terms may lead to a temporary or permanent ban.
132133
133134
### 3. Temporary Ban
134135
135136
**Community Impact**: A serious violation of community standards, including
136137
sustained inappropriate behavior.
137138
138139
**Consequence**: A temporary ban from any sort of interaction or public
139-
communication with the community for a specified period of time. No public or
140-
private interaction with the people involved, including unsolicited interaction
141-
with those enforcing the Code of Conduct, is allowed during this period.
140+
communication with the community for a specified period of time.
141+
No public or private interaction with the people involved, including unsolicited
142+
interaction with those enforcing the Code of Conduct, is allowed during this
143+
period.
142144
Violating these terms may lead to a permanent ban.
143145
144146
### 4. Permanent Ban
@@ -160,7 +162,8 @@ describe("blockContributorCovenant", () => {
160162
[Mozilla's code of conduct enforcement ladder][mozilla coc].
161163
162164
For answers to common questions about this code of conduct, see the FAQ at
163-
[https://www.contributor-covenant.org/faq][faq]. Translations are available at
165+
[https://www.contributor-covenant.org/faq][faq].
166+
Translations are available at
164167
[https://www.contributor-covenant.org/translations][translations].
165168
166169
[homepage]: https://www.contributor-covenant.org
@@ -295,29 +298,31 @@ describe("blockContributorCovenant", () => {
295298
296299
**Consequence**: A private, written warning from community leaders, providing
297300
clarity around the nature of the violation and an explanation of why the
298-
behavior was inappropriate. A public apology may be requested.
301+
behavior was inappropriate.
302+
A public apology may be requested.
299303
300304
### 2. Warning
301305
302306
**Community Impact**: A violation through a single incident or series of
303307
actions.
304308
305-
**Consequence**: A warning with consequences for continued behavior. No
306-
interaction with the people involved, including unsolicited interaction with
307-
those enforcing the Code of Conduct, for a specified period of time. This
308-
includes avoiding interactions in community spaces as well as external channels
309-
like social media. Violating these terms may lead to a temporary or permanent
310-
ban.
309+
**Consequence**: A warning with consequences for continued behavior.
310+
No interaction with the people involved, including unsolicited interaction with
311+
those enforcing the Code of Conduct, for a specified period of time.
312+
This includes avoiding interactions in community spaces as well as external
313+
channels like social media.
314+
Violating these terms may lead to a temporary or permanent ban.
311315
312316
### 3. Temporary Ban
313317
314318
**Community Impact**: A serious violation of community standards, including
315319
sustained inappropriate behavior.
316320
317321
**Consequence**: A temporary ban from any sort of interaction or public
318-
communication with the community for a specified period of time. No public or
319-
private interaction with the people involved, including unsolicited interaction
320-
with those enforcing the Code of Conduct, is allowed during this period.
322+
communication with the community for a specified period of time.
323+
No public or private interaction with the people involved, including unsolicited
324+
interaction with those enforcing the Code of Conduct, is allowed during this
325+
period.
321326
Violating these terms may lead to a permanent ban.
322327
323328
### 4. Permanent Ban
@@ -339,7 +344,8 @@ describe("blockContributorCovenant", () => {
339344
[Mozilla's code of conduct enforcement ladder][mozilla coc].
340345
341346
For answers to common questions about this code of conduct, see the FAQ at
342-
[https://www.contributor-covenant.org/faq][faq]. Translations are available at
347+
[https://www.contributor-covenant.org/faq][faq].
348+
Translations are available at
343349
[https://www.contributor-covenant.org/translations][translations].
344350
345351
[homepage]: https://www.contributor-covenant.org

src/blocks/blockContributorCovenant.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,29 +105,31 @@ unprofessional or unwelcome in the community.
105105
106106
**Consequence**: A private, written warning from community leaders, providing
107107
clarity around the nature of the violation and an explanation of why the
108-
behavior was inappropriate. A public apology may be requested.
108+
behavior was inappropriate.
109+
A public apology may be requested.
109110
110111
### 2. Warning
111112
112113
**Community Impact**: A violation through a single incident or series of
113114
actions.
114115
115-
**Consequence**: A warning with consequences for continued behavior. No
116-
interaction with the people involved, including unsolicited interaction with
117-
those enforcing the Code of Conduct, for a specified period of time. This
118-
includes avoiding interactions in community spaces as well as external channels
119-
like social media. Violating these terms may lead to a temporary or permanent
120-
ban.
116+
**Consequence**: A warning with consequences for continued behavior.
117+
No interaction with the people involved, including unsolicited interaction with
118+
those enforcing the Code of Conduct, for a specified period of time.
119+
This includes avoiding interactions in community spaces as well as external
120+
channels like social media.
121+
Violating these terms may lead to a temporary or permanent ban.
121122
122123
### 3. Temporary Ban
123124
124125
**Community Impact**: A serious violation of community standards, including
125126
sustained inappropriate behavior.
126127
127128
**Consequence**: A temporary ban from any sort of interaction or public
128-
communication with the community for a specified period of time. No public or
129-
private interaction with the people involved, including unsolicited interaction
130-
with those enforcing the Code of Conduct, is allowed during this period.
129+
communication with the community for a specified period of time.
130+
No public or private interaction with the people involved, including unsolicited
131+
interaction with those enforcing the Code of Conduct, is allowed during this
132+
period.
131133
Violating these terms may lead to a permanent ban.
132134
133135
### 4. Permanent Ban
@@ -149,7 +151,8 @@ Community Impact Guidelines were inspired by
149151
[Mozilla's code of conduct enforcement ladder][mozilla coc].
150152
151153
For answers to common questions about this code of conduct, see the FAQ at
152-
[https://www.contributor-covenant.org/faq][faq]. Translations are available at
154+
[https://www.contributor-covenant.org/faq][faq].
155+
Translations are available at
153156
[https://www.contributor-covenant.org/translations][translations].
154157
155158
[homepage]: https://www.contributor-covenant.org

src/blocks/blockMarkdownlint.test.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,9 @@ describe("blockMarkdownlint", () => {
4848
"devDependencies": {
4949
"markdownlint": "0.38.0",
5050
"markdownlint-cli": "0.45.0",
51-
"markdownlint-sentences-per-line": "0.1.1",
5251
},
5352
"scripts": {
54-
"lint:md": "markdownlint "**/*.md" ".github/**/*.md" --rules markdownlint-sentences-per-line",
53+
"lint:md": "markdownlint "**/*.md" ".github/**/*.md"",
5554
},
5655
},
5756
},
@@ -129,10 +128,9 @@ describe("blockMarkdownlint", () => {
129128
"devDependencies": {
130129
"markdownlint": "0.38.0",
131130
"markdownlint-cli": "0.45.0",
132-
"markdownlint-sentences-per-line": "0.1.1",
133131
},
134132
"scripts": {
135-
"lint:md": "markdownlint "**/*.md" ".github/**/*.md" --rules markdownlint-sentences-per-line",
133+
"lint:md": "markdownlint "**/*.md" ".github/**/*.md"",
136134
},
137135
},
138136
},
@@ -209,10 +207,9 @@ describe("blockMarkdownlint", () => {
209207
"devDependencies": {
210208
"markdownlint": "0.38.0",
211209
"markdownlint-cli": "0.45.0",
212-
"markdownlint-sentences-per-line": "0.1.1",
213210
},
214211
"scripts": {
215-
"lint:md": "markdownlint "**/*.md" ".github/**/*.md" --rules markdownlint-sentences-per-line",
212+
"lint:md": "markdownlint "**/*.md" ".github/**/*.md"",
216213
},
217214
},
218215
},

src/blocks/blockMarkdownlint.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,9 @@ export const blockMarkdownlint = base.createBlock({
5858
devDependencies: getPackageDependencies(
5959
"markdownlint",
6060
"markdownlint-cli",
61-
"markdownlint-sentences-per-line",
6261
),
6362
scripts: {
64-
"lint:md":
65-
'markdownlint "**/*.md" ".github/**/*.md" --rules markdownlint-sentences-per-line',
63+
"lint:md": 'markdownlint "**/*.md" ".github/**/*.md"',
6664
},
6765
},
6866
}),

0 commit comments

Comments
 (0)