Repository: JoshuaKGoldberg/eslint-plugin-package-json (ts)

Issue:
🚀 Feature: Bring in a require-name rule
### 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/eslint-plugin-package-json/issues?q=is%3Aissue) and found none that matched my issue.

### Overview

Following #42 -> #51: we've resolved to create a standalone `require-name` rule. It should enforce that the field exists in the `package.json` file.

### Additional Info

💖 

Pull request:
feat(require-name): add require-name rule
<!-- 👋 Hi, thanks for sending a PR to eslint-plugin-package-json! 💖.
Please fill out all fields below and make sure each item is true and [x] checked.
Otherwise we may not be able to review your PR. -->

## PR Checklist

-   [x] Addresses an existing open issue: fixes #808 
-   [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22)
-   [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/main/.github/CONTRIBUTING.md) were taken

## Overview

<!-- Description of what is changed and how the code change does that. -->

Add `require-name` rule.


Patch:
diff --git a/README.md b/README.md
index f67638d..7055510 100644
--- a/README.md
+++ b/README.md
@@ -127,6 +127,7 @@ The default settings don't conflict, and Prettier plugins can quickly fix up ord
 | [order-properties](docs/rules/order-properties.md)                     | Package properties must be declared in standard order                                             | ✅  | 🔧 |    |    |
 | [repository-shorthand](docs/rules/repository-shorthand.md)             | Enforce either object or shorthand declaration for repository.                                    | ✅  | 🔧 |    |    |
 | [require-author](docs/rules/require-author.md)                         | Requires the `author` property to be present.                                                     |    |    |    |    |
+| [require-name](docs/rules/require-name.md)                             | Requires the `name` property to be present.                                                       | ✅  |    |    |    |
 | [require-version](docs/rules/require-version.md)                       | Requires the `version` property to be present.                                                    | ✅  |    |    |    |
 | [sort-collections](docs/rules/sort-collections.md)                     | Dependencies, scripts, and configuration values must be declared in alphabetical order.           | ✅  | 🔧 |    |    |
 | [unique-dependencies](docs/rules/unique-dependencies.md)               | Checks a dependency isn't specified more than once (i.e. in `dependencies` and `devDependencies`) | ✅  |    | 💡 |    |
diff --git a/docs/rules/require-name.md b/docs/rules/require-name.md
new file mode 100644
index 0000000..b13eeb4
--- /dev/null
+++ b/docs/rules/require-name.md
@@ -0,0 +1,27 @@
+# require-name
+
+💼 This rule is enabled in the ✅ `recommended` config.
+
+<!-- end auto-generated rule header -->
+
+This rule checks for the existence of the `"name"` property in a package.json,
+and reports a violation if it doesn't exist.
+
+Example of **incorrect** code for this rule:
+
+```json
+{
+	"version": "13.0.0",
+	"author": "Jessica Moss"
+}
+```
+
+Example of **correct** code for this rule:
+
+```json
+{
+	"name": "thee-silver-mt-zion",
+	"version": "13.0.0",
+	"author": "Jessica Moss"
+}
+```
diff --git a/src/rules/require-properties.ts b/src/rules/require-properties.ts
index 7ca7e10..9d047bc 100644
--- a/src/rules/require-properties.ts
+++ b/src/rules/require-properties.ts
@@ -6,6 +6,7 @@ import { createRequirePropertyRule } from "../utils/createRequirePropertyRule.js
 // in the format [propertyName, isRecommended]
 const properties = [
 	["author", false],
+	["name", true],
 	["version", true],
 	// TODO: More to come!
 ] satisfies [string, boolean][];


Test patch:
diff --git a/src/tests/rules/require-name.test.ts b/src/tests/rules/require-name.test.ts
new file mode 100644
index 0000000..7ab7fdb
--- /dev/null
+++ b/src/tests/rules/require-name.test.ts
@@ -0,0 +1,47 @@
+import { rules } from "../../rules/require-properties.js";
+import { ruleTester } from "./ruleTester.js";
+
+ruleTester.run("require-name", rules["require-name"], {
+	invalid: [
+		{
+			code: "{}",
+			errors: [
+				{
+					data: { property: "name" },
+					line: 1,
+					messageId: "missing",
+				},
+			],
+		},
+		{
+			code: `{
+            "version": "1.0.0"
+            }
+            `,
+			errors: [
+				{
+					data: { property: "name" },
+					line: 1,
+					messageId: "missing",
+				},
+			],
+		},
+		{
+			code: `{
+            "author": "Jessica Moss",
+            "bin": {
+                "name": "test"
+            }
+            }
+            `,
+			errors: [
+				{
+					data: { property: "name" },
+					line: 1,
+					messageId: "missing",
+				},
+			],
+		},
+	],
+	valid: [`{ "name": "test" }`],
+});