Skip to content

Commit 0b542be

Browse files
fix: use options.repository for n/no-missing-import's allowedModules (#924)
## PR Checklist - [x] Addresses an existing open issue: fixes #923 - [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 Instead of hardcoding the one allowed module name to `create-typescript-app`, uses `options.repository`.
1 parent ebde1d9 commit 0b542be

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

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

+2-8
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,7 @@ describe("createESLintRC", () => {
7777
{
7878
files: \\"**/*.md/*.ts\\",
7979
rules: {
80-
\\"n/no-missing-import\\": [
81-
\\"error\\",
82-
{ allowModules: [\\"create-typescript-app\\"] },
83-
],
80+
\\"n/no-missing-import\\": [\\"error\\", { allowModules: [\\"test-repository\\"] }],
8481
},
8582
},
8683
{
@@ -162,10 +159,7 @@ describe("createESLintRC", () => {
162159
{
163160
files: \\"**/*.md/*.ts\\",
164161
rules: {
165-
\\"n/no-missing-import\\": [
166-
\\"error\\",
167-
{ allowModules: [\\"create-typescript-app\\"] },
168-
],
162+
\\"n/no-missing-import\\": [\\"error\\", { allowModules: [\\"test-repository\\"] }],
169163
},
170164
},
171165
{

src/steps/writing/creation/createESLintRC.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ module.exports = {
8282
rules: {
8383
"n/no-missing-import": [
8484
"error",
85-
{ allowModules: ["create-typescript-app"] },
85+
{ allowModules: ["${options.repository}"] },
8686
],
8787
},
8888
},

0 commit comments

Comments
 (0)