-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🚀 Feature: Rule to flag empty arrays/objects that do nothing #683
Comments
@JoshuaKGoldberg I want to ask a question about this lint rule. If the |
By " {
"name": "my-example",
- "dependencies": {},
"version": "0.1.2"
} Same with Them being set to |
Sorry, it is typo. I think I can have a try to complete it. Can you assign this issue to me? |
I don't use any kind of issue assignment system, go ahead and send a PR. Thanks for offering! 🚀 |
Thx |
<!-- 👋 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 #683 - [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. -->
🎉 This is included in version v0.21.0 🎉 The release is available on: Cheers! 📦🚀 |
Bug Report Checklist
main
branch of the repository.Overview
Quite a few package entries do nothing if they're an empty array or object. Some top-of-mind examples:
dependencies
/devDependencies
/peerDependencies
files
scripts
It'd be nice to have a lint rule that reports on them & autofixes them away.
Additional Info
This is similar on the surface to eslint/json#54, in that it's a rule for blank/empty entries. The difference here is that
eslint-plugin-package-json
is for a specific JSON schema.@eslint/json
is general to all JSON.Putting as
status: in discussion
for a bit because I suspect this might already exist somewhere else. Maybe one of the equivalents mentioned in #42? This feels like it should exist already...This issue prompted by seeing a very nice cleanup by @crutchcorn in https://github.com/TryGhost/Ghost/pull/21818/files#r1873314451. Thanks Corbin! 😄
💖
The text was updated successfully, but these errors were encountered: