Repository: JoshuaKGoldberg/template-typescript-node-package (ts)

Issue:
🚀 Feature: Hydration script should run ESLint autofixer
### 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/template-typescript-node-package/issues?q=is%3Aissue) and found none that matched my issue.

### Overview

#441 added a hydration script that updates an existing repository to use this template's goodness. But the existing repository may have some lint failures at the end of the script, such as using extension-less imports (`... from "./file"` instead of `... from "./file.js"`).

Let's have the hydration script run `pnpm run lint --fix` after it finishes `pnpm run format:write`!

### Additional Info

_No response_
🚀 Feature: Hydration should remove common old tooling
### 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/template-typescript-node-package/issues?q=is%3Aissue) and found none that matched my issue.

### Overview

A lot of my old projects use different dev dependencies and/or config files. A couple of examples:

* Jest instead of Vitest
* `.prettierrc.json` instead of `.prettierrc`

There's no need to keep around the old tools' config files. Let's remove them as part of hydration.

### Additional Info

_No response_

Pull request description:
feat: remove more common unnecessary files
## PR Checklist

- [x] Addresses an existing open issue: fixes #452; fixes #512
- [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/template-typescript-node-package/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22)
- [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/template-typescript-node-package/blob/main/.github/CONTRIBUTING.md) were taken

## Overview

Adds some more globs to the list of those to remove. 

Patch:
diff --git a/cspell.json b/cspell.json
index 9fa0fda..a404903 100644
--- a/cspell.json
+++ b/cspell.json
@@ -19,11 +19,12 @@
 		"knip",
 		"lcov",
 		"markdownlintignore",
+		"npmignore",
 		"npmpackagejsonlintrc",
 		"outro",
 		"packagejson",
-		"Unstaged",
 		"quickstart",
+		"Unstaged",
 		"wontfix"
 	]
 }
diff --git a/src/hydrate/steps/clearUnnecessaryFiles.ts b/src/hydrate/steps/clearUnnecessaryFiles.ts
index c79884f..7dd423e 100644
--- a/src/hydrate/steps/clearUnnecessaryFiles.ts
+++ b/src/hydrate/steps/clearUnnecessaryFiles.ts
@@ -1,15 +1,27 @@
 import { execaCommand } from "execa";
 
+const ignoreGlobs = [
+	"./src/**/*.js",
+	".eslintrc.j*",
+	".npmignore",
+	".prettierrc.*",
+	"babel.*",
+	"CODE_OF_CONDUCT.md",
+	"CONTRIBUTING.md",
+	"DEVELOPMENT.md",
+	"dist",
+	"jest.*",
+	"lib",
+	"package-lock.json",
+	"yarn.lock",
+];
+
 export async function clearUnnecessaryFiles() {
-	for (const glob of [
-		"dist lib package-lock.json yarn.lock",
-		".eslintrc*",
-		"./src/**/*.js",
-	]) {
-		try {
-			await execaCommand(`rm -rf ${glob}`);
-		} catch {
-			// (we ignore failures if nothing matched)
-		}
+	try {
+		await execaCommand(
+			`rm -rf ${ignoreGlobs.map((glob) => `"${glob}"`).join(" ")}`
+		);
+	} catch {
+		// (we ignore failures if nothing matched)
 	}
 }


Test patch:
diff --git a/src/hydrate/steps/clearUnnecessaryFiles.test.ts b/src/hydrate/steps/clearUnnecessaryFiles.test.ts
index 0dfd5d6..20ac01a 100644
--- a/src/hydrate/steps/clearUnnecessaryFiles.test.ts
+++ b/src/hydrate/steps/clearUnnecessaryFiles.test.ts
@@ -11,9 +11,11 @@ vi.mock("execa", () => ({
 }));
 
 describe("clearUnnecessaryFiles", () => {
-	it("runs all commands even when they fail", async () => {
+	it("removes all globs, quoted", async () => {
 		await clearUnnecessaryFiles();
 
-		expect(mockExecaCommand).toHaveBeenCalledWith(`rm -rf ./src/**/*.js`);
+		expect(mockExecaCommand).toHaveBeenCalledWith(
+			`rm -rf "./src/**/*.js" ".eslintrc.j*" ".npmignore" ".prettierrc.*" "babel.*" "CODE_OF_CONDUCT.md" "CONTRIBUTING.md" "DEVELOPMENT.md" "dist" "jest.*" "lib" "package-lock.json" "yarn.lock"`
+		);
 	});
 });