Skip to content

Commit 4184d1b

Browse files
DerTimoniusJoshuaKGoldberg
andauthoredOct 8, 2023
feat(lint): add no-useless-rename and object-shorthand (#944)
<!-- 👋 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]>
1 parent 316508f commit 4184d1b

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed
 

‎.eslintrc.cjs

+2
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ module.exports = {
164164
"error",
165165
{ blankLine: "always", next: "*", prev: "block-like" },
166166
],
167+
"no-useless-rename": "error",
168+
"object-shorthand": "error",
167169
"perfectionist/sort-objects": [
168170
"error",
169171
{

‎src/shared/options/ensureRepositoryExists.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,5 @@ export async function ensureRepositoryExists(
8686
}
8787
}
8888

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

‎src/steps/writing/creation/createESLintRC.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ describe("createESLintRC", () => {
252252
\\"error\\",
253253
{ blankLine: \\"always\\", next: \\"*\\", prev: \\"block-like\\" },
254254
],
255+
\\"no-useless-rename\\": \\"error\\",
256+
\\"object-shorthand\\": \\"error\\",
255257
\\"perfectionist/sort-objects\\": [
256258
\\"error\\",
257259
{

‎src/steps/writing/creation/createESLintRC.ts

+2
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ module.exports = {
212212
"error",
213213
{ blankLine: "always", next: "*", prev: "block-like" },
214214
],
215+
"no-useless-rename": "error",
216+
"object-shorthand": "error",
215217
`
216218
}${
217219
options.excludeLintPerfectionist

0 commit comments

Comments
 (0)
Please sign in to comment.