Skip to content

Commit db1943c

Browse files
fix: correct blockCSpell intake ignorePaths (#2174)
## PR Checklist - [x] Addresses an existing open issue: fixes #2173 - [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 Switches the Addon name to `ignorePaths` so that everything is called the same. The alternative was using `ignorePaths` for the schema that parses in files but `ignores` for the Addons schema. 🎁
1 parent e704a6a commit db1943c

10 files changed

+30
-28
lines changed

src/blocks/blockCSpell.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe("blockCSpell", () => {
7878
test("with addons", () => {
7979
const creation = testBlock(blockCSpell, {
8080
addons: {
81-
ignores: ["lib/"],
81+
ignorePaths: ["lib/"],
8282
words: ["joshuakgoldberg"],
8383
},
8484
options: optionsBase,
@@ -387,16 +387,16 @@ describe("blockCSpell", () => {
387387
it("returns undefined when cspell.json contains invalid data", () => {
388388
const actual = testIntake(blockCSpell, {
389389
files: {
390-
"cspell.json": [JSON.stringify({ ignores: true })],
390+
"cspell.json": [JSON.stringify({ ignorePaths: true })],
391391
},
392392
});
393393

394394
expect(actual).toBeUndefined();
395395
});
396396

397-
it("returns compilerOptions when cspell.json contains ignores and words", () => {
397+
it("returns compilerOptions when cspell.json contains ignorePaths and words", () => {
398398
const data = {
399-
ignores: ["other"],
399+
ignorePaths: ["other"],
400400
words: ["abc", "def"],
401401
};
402402

src/blocks/blockCSpell.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { CommandPhase } from "./phases.js";
1616
const filesGlob = `"**" ".github/**/*"`;
1717

1818
const addons = {
19-
ignores: z.array(z.string()).default([]),
19+
ignorePaths: z.array(z.string()).default([]),
2020
words: z.array(z.string()).default([]),
2121
};
2222

@@ -41,7 +41,7 @@ export const blockCSpell = base.createBlock({
4141
return data;
4242
},
4343
produce({ addons, options }) {
44-
const { ignores, words } = addons;
44+
const { ignorePaths, words } = addons;
4545

4646
const allWords = Array.from(
4747
new Set([...(options.words ?? []), ...words]),
@@ -83,14 +83,16 @@ export const blockCSpell = base.createBlock({
8383
files: {
8484
"cspell.json": JSON.stringify({
8585
dictionaries: ["npm", "node", "typescript"],
86-
ignorePaths: [
87-
".github",
88-
"CHANGELOG.md",
89-
"lib",
90-
"node_modules",
91-
"pnpm-lock.yaml",
92-
...ignores,
93-
].sort(),
86+
ignorePaths: Array.from(
87+
new Set([
88+
".github",
89+
"CHANGELOG.md",
90+
"lib",
91+
"node_modules",
92+
"pnpm-lock.yaml",
93+
...ignorePaths,
94+
]),
95+
).sort(),
9496
...(allWords.length && { words: allWords }),
9597
}),
9698
},

src/blocks/blockNcc.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe("blockNcc", () => {
1515
"addons": [
1616
{
1717
"addons": {
18-
"ignores": [
18+
"ignorePaths": [
1919
"dist",
2020
],
2121
},
@@ -126,7 +126,7 @@ describe("blockNcc", () => {
126126
"addons": [
127127
{
128128
"addons": {
129-
"ignores": [
129+
"ignorePaths": [
130130
"dist",
131131
],
132132
},

src/blocks/blockNcc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const blockNcc = base.createBlock({
2828
return {
2929
addons: [
3030
blockCSpell({
31-
ignores: ["dist"],
31+
ignorePaths: ["dist"],
3232
}),
3333
blockDevelopmentDocs({
3434
sections: {

src/blocks/blockPrettier.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe("blockPrettier", () => {
1515
"addons": [
1616
{
1717
"addons": {
18-
"ignores": [
18+
"ignorePaths": [
1919
".all-contributorsrc",
2020
],
2121
},
@@ -127,7 +127,7 @@ describe("blockPrettier", () => {
127127
"addons": [
128128
{
129129
"addons": {
130-
"ignores": [
130+
"ignorePaths": [
131131
".all-contributorsrc",
132132
],
133133
},
@@ -277,7 +277,7 @@ describe("blockPrettier", () => {
277277
"addons": [
278278
{
279279
"addons": {
280-
"ignores": [
280+
"ignorePaths": [
281281
".all-contributorsrc",
282282
],
283283
},

src/blocks/blockPrettier.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const blockPrettier = base.createBlock({
3838
return {
3939
addons: [
4040
blockCSpell({
41-
ignores: [".all-contributorsrc"],
41+
ignorePaths: [".all-contributorsrc"],
4242
}),
4343
blockDevelopmentDocs({
4444
sections: {

src/blocks/blockVitest.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe("blockVitest", () => {
1919
"addons": [
2020
{
2121
"addons": {
22-
"ignores": [
22+
"ignorePaths": [
2323
"coverage",
2424
],
2525
},
@@ -265,7 +265,7 @@ describe("blockVitest", () => {
265265
"addons": [
266266
{
267267
"addons": {
268-
"ignores": [
268+
"ignorePaths": [
269269
"coverage",
270270
],
271271
},
@@ -549,7 +549,7 @@ describe("blockVitest", () => {
549549
"addons": [
550550
{
551551
"addons": {
552-
"ignores": [
552+
"ignorePaths": [
553553
"coverage",
554554
],
555555
},
@@ -804,7 +804,7 @@ describe("blockVitest", () => {
804804
"addons": [
805805
{
806806
"addons": {
807-
"ignores": [
807+
"ignorePaths": [
808808
"coverage",
809809
],
810810
},

src/blocks/blockVitest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const blockVitest = base.createBlock({
8282
return {
8383
addons: [
8484
blockCSpell({
85-
ignores: ["coverage"],
85+
ignorePaths: ["coverage"],
8686
}),
8787
blockDevelopmentDocs({
8888
sections: {

src/blocks/blockWebExt.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe("blockWebExt", () => {
1515
"addons": [
1616
{
1717
"addons": {
18-
"ignores": [
18+
"ignorePaths": [
1919
"assets",
2020
],
2121
},

src/blocks/blockWebExt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const blockWebExt = base.createBlock({
1515
return {
1616
addons: [
1717
blockCSpell({
18-
ignores: ["assets"],
18+
ignorePaths: ["assets"],
1919
}),
2020
blockDevelopmentDocs({
2121
sections: {

0 commit comments

Comments
 (0)