Skip to content

Commit 3934596

Browse files
feat: enable Knip's treatConfigHintsAsErrors (#2300)
## PR Checklist - [x] Addresses an existing open issue: fixes #2213 - [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 🎁
1 parent f81695f commit 3934596

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

knip.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
"trash-cli"
99
],
1010
"ignoreExportsUsedInFile": { "interface": true, "type": true },
11-
"project": ["src/**/*.ts"]
11+
"project": ["src/**/*.ts"],
12+
"treatConfigHintsAsErrors": true
1213
}

src/blocks/blockKnip.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ describe("blockKnip", () => {
6969
},
7070
],
7171
"files": {
72-
"knip.json": "{"$schema":"https://unpkg.com/knip@5.71.0/schema.json","ignoreExportsUsedInFile":{"interface":true,"type":true}}",
72+
"knip.json": "{"$schema":"https://unpkg.com/knip@5.71.0/schema.json","ignoreExportsUsedInFile":{"interface":true,"type":true},"treatConfigHintsAsErrors":true}",
7373
},
7474
}
7575
`);
@@ -140,7 +140,7 @@ describe("blockKnip", () => {
140140
},
141141
],
142142
"files": {
143-
"knip.json": "{"$schema":"https://unpkg.com/knip@5.71.0/schema.json","entry":["src/index.ts"],"ignoreDependencies":["abc","def"],"ignoreExportsUsedInFile":{"interface":true,"type":true},"project":["src/**/*.ts"]}",
143+
"knip.json": "{"$schema":"https://unpkg.com/knip@5.71.0/schema.json","entry":["src/index.ts"],"ignoreDependencies":["abc","def"],"ignoreExportsUsedInFile":{"interface":true,"type":true},"project":["src/**/*.ts"],"treatConfigHintsAsErrors":true}",
144144
},
145145
}
146146
`);
@@ -216,7 +216,7 @@ describe("blockKnip", () => {
216216
},
217217
],
218218
"files": {
219-
"knip.json": "{"$schema":"https://unpkg.com/knip@5.71.0/schema.json","ignoreExportsUsedInFile":{"interface":true,"type":true}}",
219+
"knip.json": "{"$schema":"https://unpkg.com/knip@5.71.0/schema.json","ignoreExportsUsedInFile":{"interface":true,"type":true},"treatConfigHintsAsErrors":true}",
220220
},
221221
}
222222
`);

src/blocks/blockKnip.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export const blockKnip = base.createBlock({
8282
type: true,
8383
},
8484
project: project?.sort(),
85+
treatConfigHintsAsErrors: true,
8586
}),
8687
},
8788
};

0 commit comments

Comments
 (0)