Skip to content

Commit a04c92f

Browse files
Allow create-typescript-app in .ts files
1 parent fc5e5dd commit a04c92f

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

.eslintrc.cjs

+10-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module.exports = {
3737
files: ["**/*.ts"],
3838
parser: "@typescript-eslint/parser",
3939
rules: {
40-
// These off-by-default rules work well for this repo and we like them on.
40+
// These off-/differently-configured-by-default rules work well for this repo and we like them on.
4141
"jsdoc/informative-docs": "error",
4242
"logical-assignment-operators": [
4343
"error",
@@ -53,6 +53,15 @@ module.exports = {
5353
"jsdoc/require-returns": "off",
5454
},
5555
},
56+
{
57+
files: "**/*.md/*.ts",
58+
rules: {
59+
"n/no-missing-import": [
60+
"error",
61+
{ allowModules: ["create-typescript-app"] },
62+
],
63+
},
64+
},
5665
{
5766
excludedFiles: ["**/*.md/*.ts"],
5867
extends: [

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

+18
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ describe("createESLintRC", () => {
7474
\\"operator-assignment\\": \\"error\\",
7575
},
7676
},
77+
{
78+
files: \\"**/*.md/*.ts\\",
79+
rules: {
80+
\\"n/no-missing-import\\": [
81+
\\"error\\",
82+
{ allowModules: [\\"create-typescript-app\\"] },
83+
],
84+
},
85+
},
7786
{
7887
extends: [\\"plugin:@typescript-eslint/recommended-type-checked\\"],
7988
files: [\\"**/*.ts\\"],
@@ -149,6 +158,15 @@ describe("createESLintRC", () => {
149158
\\"jsdoc/require-returns\\": \\"off\\",
150159
},
151160
},
161+
{
162+
files: \\"**/*.md/*.ts\\",
163+
rules: {
164+
\\"n/no-missing-import\\": [
165+
\\"error\\",
166+
{ allowModules: [\\"create-typescript-app\\"] },
167+
],
168+
},
169+
},
152170
{
153171
excludedFiles: [\\"**/*.md/*.ts\\"],
154172
extends: [

src/steps/writing/creation/createESLintRC.ts

+9
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ module.exports = {
7575
}
7676
},
7777
},
78+
{
79+
files: "**/*.md/*.ts",
80+
rules: {
81+
"n/no-missing-import": [
82+
"error",
83+
{ allowModules: ["create-typescript-app"] },
84+
],
85+
},
86+
},
7887
{
7988
${
8089
options.excludeLintMd

0 commit comments

Comments
 (0)