Skip to content

Commit a556755

Browse files
fix: remove unnecessary devDependencies for --base common (#1636)
## PR Checklist - [x] Addresses an existing open issue: fixes #1635 - [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 Adds `options.*` checking in `finalizeDependencies`, to better restrict what gets installed. 💖
1 parent b53191c commit a556755

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/steps/finalizeDependencies.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ describe("finalize", () => {
9292
expect(mockExecaCommand.mock.calls).toMatchInlineSnapshot(`
9393
[
9494
[
95-
"pnpm add @eslint-community/eslint-plugin-eslint-comments@latest @eslint/js@latest @types/eslint-plugin-markdown@latest @types/eslint__js@latest @types/node@latest eslint@latest eslint-plugin-jsdoc@latest eslint-plugin-n@latest eslint-plugin-regexp@latest husky@latest lint-staged@latest prettier@latest prettier-plugin-curly@latest prettier-plugin-packagejson@latest prettier-plugin-sh@latest tsup@latest typescript@latest typescript-eslint@latest -D",
95+
"pnpm add @eslint-community/eslint-plugin-eslint-comments@latest @eslint/js@latest @types/eslint__js@latest @types/node@latest eslint@latest eslint-plugin-jsdoc@latest eslint-plugin-n@latest eslint-plugin-regexp@latest husky@latest lint-staged@latest prettier@latest prettier-plugin-curly@latest prettier-plugin-packagejson@latest prettier-plugin-sh@latest tsup@latest typescript@latest typescript-eslint@latest -D",
9696
],
9797
[
9898
"pnpm dedupe --offline",

src/steps/finalizeDependencies.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,10 @@ import { Options } from "../shared/types.js";
66
export async function finalizeDependencies(options: Options) {
77
const devDependencies = [
88
"@eslint/js",
9-
"@eslint-community/eslint-plugin-eslint-comments",
10-
"@types/eslint-plugin-markdown",
119
"@types/eslint__js",
1210
"@types/node",
1311
"eslint",
14-
"eslint-plugin-jsdoc",
1512
"eslint-plugin-n",
16-
"eslint-plugin-regexp",
1713
"husky",
1814
"lint-staged",
1915
"prettier",
@@ -24,6 +20,10 @@ export async function finalizeDependencies(options: Options) {
2420
"typescript",
2521
"typescript-eslint",
2622
...(options.excludeAllContributors ? [] : ["all-contributors-cli"]),
23+
...(options.excludeLintESLint
24+
? []
25+
: ["@eslint-community/eslint-plugin-eslint-comments"]),
26+
...(options.excludeLintJSDoc ? [] : ["eslint-plugin-jsdoc"]),
2727
...(options.excludeLintJson ? [] : ["eslint-plugin-jsonc"]),
2828
...(options.excludeLintJson && options.excludeLintPackageJson
2929
? []
@@ -32,6 +32,7 @@ export async function finalizeDependencies(options: Options) {
3232
...(options.excludeLintMd
3333
? []
3434
: [
35+
"@types/eslint-plugin-markdown",
3536
"eslint-plugin-markdown",
3637
"markdownlint",
3738
"markdownlint-cli",
@@ -41,6 +42,7 @@ export async function finalizeDependencies(options: Options) {
4142
...(options.excludeLintPerfectionist
4243
? []
4344
: ["eslint-plugin-perfectionist"]),
45+
...(options.excludeLintRegex ? [] : ["eslint-plugin-regexp"]),
4446
...(options.excludeLintSpelling ? [] : ["cspell"]),
4547
...(options.excludeLintYml ? [] : ["eslint-plugin-yml"]),
4648
...(options.excludeReleases

0 commit comments

Comments
 (0)