Repository: JoshuaKGoldberg/create-typescript-app (ts)

Issue:
🛠 Tooling: Use formatIgnoreFile in Blocks that create them
### Bug Report Checklist

- [X] I have tried restarting my IDE and the issue persists.
- [X] I have pulled the latest `main` branch of the repository.
- [X] I have [searched for related issues](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aissue) and found none that matched my issue.

### Overview

In two places, manual `.join("\n")` instead of `formatIgnoreFile()` are used:

https://github.com/JoshuaKGoldberg/create-typescript-app/blob/42021fbc5c2d848ba815c04458dd212a6cfb27f7/src/next/blocks/blockMarkdownlint.ts#L69-L76

https://github.com/JoshuaKGoldberg/create-typescript-app/blob/0da6188744404646dc84054cf52bc5d0ce0fa1d6/src/next/blocks/blockPrettier.ts#L99-L101

I'll reuse `formatIgnoreFile`.

### Additional Info

Prototyped in #1839.

💖 

Pull request:
chore: use formatIgnoreFile in remaining blocks
## PR Checklist

- [x] Addresses an existing open issue: fixes #1853
- [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

Resists the urge to move the common `.sort()` inside the function, since not every consumer does that.

💖 

Patch:
diff --git a/src/next/blocks/blockMarkdownlint.ts b/src/next/blocks/blockMarkdownlint.ts
index 0f1cd90..c3e9a75 100644
--- a/src/next/blocks/blockMarkdownlint.ts
+++ b/src/next/blocks/blockMarkdownlint.ts
@@ -1,5 +1,6 @@
 import { z } from "zod";
 
+import { formatIgnoreFile } from "../../steps/writing/creation/formatters/formatIgnoreFile.js";
 import { base } from "../base.js";
 import { blockCSpell } from "./blockCSpell.js";
 import { blockDevelopmentDocs } from "./blockDevelopmentDocs.js";
@@ -66,14 +67,14 @@ export const blockMarkdownlint = base.createBlock({
 					"first-line-h1": false,
 					"no-inline-html": false,
 				}),
-				".markdownlintignore": [
-					".github/CODE_OF_CONDUCT.md",
-					"CHANGELOG.md",
-					"node_modules/",
-					...ignores,
-				]
-					.sort()
-					.join("\n"),
+				".markdownlintignore": formatIgnoreFile(
+					[
+						".github/CODE_OF_CONDUCT.md",
+						"CHANGELOG.md",
+						"node_modules/",
+						...ignores,
+					].sort(),
+				),
 			},
 			scripts: [
 				{
diff --git a/src/next/blocks/blockPrettier.ts b/src/next/blocks/blockPrettier.ts
index bce284e..628a556 100644
--- a/src/next/blocks/blockPrettier.ts
+++ b/src/next/blocks/blockPrettier.ts
@@ -1,5 +1,6 @@
 import { z } from "zod";
 
+import { formatIgnoreFile } from "../../steps/writing/creation/formatters/formatIgnoreFile.js";
 import { base } from "../base.js";
 import { blockCSpell } from "./blockCSpell.js";
 import { blockDevelopmentDocs } from "./blockDevelopmentDocs.js";
@@ -96,9 +97,9 @@ pnpm format --write
 					".gitignore": "_\n",
 					"pre-commit": ["npx lint-staged\n", { mode: 0x777 }],
 				},
-				".prettierignore": ["/.husky", "/lib", "/pnpm-lock.yaml", ...ignores]
-					.sort()
-					.join("\n"),
+				".prettierignore": formatIgnoreFile(
+					["/.husky", "/lib", "/pnpm-lock.yaml", ...ignores].sort(),
+				),
 				".prettierrc.json": JSON.stringify({
 					$schema: "http://json.schemastore.org/prettierrc",
 					...(overrides.length && { overrides: overrides.sort() }),


Test patch:
diff --git a/src/next/blocks/blockMarkdownlint.test.ts b/src/next/blocks/blockMarkdownlint.test.ts
index 749d102..db00740 100644
--- a/src/next/blocks/blockMarkdownlint.test.ts
+++ b/src/next/blocks/blockMarkdownlint.test.ts
@@ -78,7 +78,8 @@ describe("blockMarkdownlint", () => {
 			    ".markdownlint.json": "{"extends":"markdownlint/style/prettier","first-line-h1":false,"no-inline-html":false}",
 			    ".markdownlintignore": ".github/CODE_OF_CONDUCT.md
 			CHANGELOG.md
-			node_modules/",
+			node_modules/
+			",
 			  },
 			  "scripts": [
 			    {
@@ -169,7 +170,8 @@ describe("blockMarkdownlint", () => {
 			    ".markdownlintignore": ".github/CODE_OF_CONDUCT.md
 			CHANGELOG.md
 			lib/
-			node_modules/",
+			node_modules/
+			",
 			  },
 			  "scripts": [
 			    {
diff --git a/src/next/blocks/blockPrettier.test.ts b/src/next/blocks/blockPrettier.test.ts
index ef447c7..fc9787c 100644
--- a/src/next/blocks/blockPrettier.test.ts
+++ b/src/next/blocks/blockPrettier.test.ts
@@ -100,7 +100,8 @@ describe("blockPrettier", () => {
 			    },
 			    ".prettierignore": "/.husky
 			/lib
-			/pnpm-lock.yaml",
+			/pnpm-lock.yaml
+			",
 			    ".prettierrc.json": "{"$schema":"http://json.schemastore.org/prettierrc","useTabs":true}",
 			  },
 			  "scripts": [
@@ -211,7 +212,8 @@ describe("blockPrettier", () => {
 			    },
 			    ".prettierignore": "/.husky
 			/lib
-			/pnpm-lock.yaml",
+			/pnpm-lock.yaml
+			",
 			    ".prettierrc.json": "{"$schema":"http://json.schemastore.org/prettierrc","useTabs":true}",
 			  },
 			  "scripts": [
@@ -340,7 +342,8 @@ describe("blockPrettier", () => {
 			    ".prettierignore": "/.husky
 			/lib
 			/pnpm-lock.yaml
-			generated",
+			generated
+			",
 			    ".prettierrc.json": "{"$schema":"http://json.schemastore.org/prettierrc","overrides":[{"files":".nvmrc","options":{"parser":"yaml"}}],"plugins":["prettier-plugin-curly","prettier-plugin-packagejson","prettier-plugin-sh"],"useTabs":true}",
 			  },
 			  "scripts": [