Skip to content

🚀 Feature: Enable no-useless-rename #939

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

Closed
3 tasks done
JoshuaKGoldberg opened this issue Oct 3, 2023 · 2 comments · Fixed by #944
Closed
3 tasks done

🚀 Feature: Enable no-useless-rename #939

JoshuaKGoldberg opened this issue Oct 3, 2023 · 2 comments · Fixed by #944
Labels
good first issue Good for newcomers, please hop on! status: accepting prs Please, send a pull request to resolve this! type: feature New enhancement or request

Comments

@JoshuaKGoldberg
Copy link
Owner

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Overview

Once in a while I find a piece of code that unnecessarily renames a destructured variable:

return { github: github, repository };

That : github part is unnecessary. The code is essentially the same as:

- return { github: github, repository };
+ return { github, repository };

https://eslint.org/docs/latest/rules/no-useless-rename exists but isn't enabled yet. Let's add it in!

Additional Info

Note that there are multiple places you'll want to add no-useless-rename:

  1. The repo's ESLint config:
    // Stylistic concerns that don't interfere with Prettier
  2. The template for generating repo ESLint configs:
    : `// Stylistic concerns that don't interfere with Prettier
  3. Tests for ☝️ (createESLintRC.test.ts)
@JoshuaKGoldberg JoshuaKGoldberg added good first issue Good for newcomers, please hop on! type: feature New enhancement or request status: accepting prs Please, send a pull request to resolve this! labels Oct 3, 2023
@DerTimonius
Copy link
Contributor

I would love to take this!

JoshuaKGoldberg added a commit that referenced this issue Oct 8, 2023
<!-- 👋 Hi, thanks for sending a PR to create-typescript-app! 💖.
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 #939 
- [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

This PR adds the following rules to the ESLint config:
-
[no-useless-rename](https://eslint.org/docs/latest/rules/no-useless-rename)
-
[object-shorthand](https://eslint.org/docs/latest/rules/object-shorthand)

The rules have also been added to the created `.eslintrc` files and the
test has been updated. Lint errors have been solved.

Co-authored-by: Josh Goldberg ✨ <[email protected]>
@github-actions
Copy link

github-actions bot commented Oct 8, 2023

🎉 This is included in version v1.36.0 🎉

The release is available on:

Cheers! 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers, please hop on! status: accepting prs Please, send a pull request to resolve this! type: feature New enhancement or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants