create-typescript-app 1.29.14 ā 1.29.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabel.d.ts +7 -2
- package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabel.js +2 -2
- package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabel.js.map +1 -1
- package/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.js +8 -12
- package/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.js.map +1 -1
- package/lib/steps/writing/creation/createESLintRC.js +1 -0
- package/lib/steps/writing/creation/createESLintRC.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<a href="#contributors" target="_blank">
|
|
7
7
|
<!-- prettier-ignore-start -->
|
|
8
8
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
9
|
-
<img alt="All Contributors:
|
|
9
|
+
<img alt="All Contributors: 23 š¤" src="https://img.shields.io/badge/all_contributors-23_š¤-21bb42.svg" />
|
|
10
10
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
11
11
|
<!-- prettier-ignore-end -->
|
|
12
12
|
</a>
|
|
@@ -102,10 +102,11 @@ Thanks! š
|
|
|
102
102
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/RebeccaStevens"><img src="https://avatars.githubusercontent.com/u/7224206?v=4?s=100" width="100px;" alt="Rebecca Stevens"/><br /><sub><b>Rebecca Stevens</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=RebeccaStevens" title="Code">š»</a> <a href="#infra-RebeccaStevens" title="Infrastructure (Hosting, Build-Tools, etc)">š</a></td>
|
|
103
103
|
<td align="center" valign="top" width="14.28%"><a href="https://linktr.ee/ronbraha"><img src="https://avatars.githubusercontent.com/u/45559220?v=4?s=100" width="100px;" alt="Ron Braha"/><br /><sub><b>Ron Braha</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=RNR1" title="Code">š»</a> <a href="#design-RNR1" title="Design">šØ</a> <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=RNR1" title="Tests">ā ļø</a></td>
|
|
104
104
|
<td align="center" valign="top" width="14.28%"><a href="http://ronjeanfrancois.com"><img src="https://avatars.githubusercontent.com/u/105710107?v=4?s=100" width="100px;" alt="Ron Jean-Francois"/><br /><sub><b>Ron Jean-Francois</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=ronthetech" title="Code">š»</a> <a href="#infra-ronthetech" title="Infrastructure (Hosting, Build-Tools, etc)">š</a></td>
|
|
105
|
+
<td align="center" valign="top" width="14.28%"><a href="https://ryota-murakami.github.io/"><img src="https://avatars.githubusercontent.com/u/5501268?v=4?s=100" width="100px;" alt="Ryota Murakami"/><br /><sub><b>Ryota Murakami</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=ryota-murakami" title="Code">š»</a></td>
|
|
105
106
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/the-lazy-learner"><img src="https://avatars.githubusercontent.com/u/13695177?v=4?s=100" width="100px;" alt="Sudhansu"/><br /><sub><b>Sudhansu</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=the-lazy-learner" title="Code">š»</a></td>
|
|
106
|
-
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tungbq"><img src="https://avatars.githubusercontent.com/u/85242618?v=4?s=100" width="100px;" alt="Tung Bui (Leo)"/><br /><sub><b>Tung Bui (Leo)</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=tungbq" title="Code">š»</a></td>
|
|
107
107
|
</tr>
|
|
108
108
|
<tr>
|
|
109
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tungbq"><img src="https://avatars.githubusercontent.com/u/85242618?v=4?s=100" width="100px;" alt="Tung Bui (Leo)"/><br /><sub><b>Tung Bui (Leo)</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=tungbq" title="Code">š»</a></td>
|
|
109
110
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/TAKANOME-DEV"><img src="https://avatars.githubusercontent.com/u/79809121?v=4?s=100" width="100px;" alt="takanomedev"/><br /><sub><b>takanomedev</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=TAKANOME-DEV" title="Code">š»</a></td>
|
|
110
111
|
</tr>
|
|
111
112
|
</tbody>
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
interface GhLabelData {
|
|
2
|
+
color: string;
|
|
3
|
+
description: string;
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
6
|
+
declare function getExistingEquivalentLabel(existingLabels: GhLabelData[], outcomeLabel: string): GhLabelData | undefined;
|
|
2
7
|
|
|
3
|
-
export { getExistingEquivalentLabel };
|
|
8
|
+
export { GhLabelData, getExistingEquivalentLabel };
|
|
@@ -4,8 +4,8 @@ const aliases = /* @__PURE__ */ new Map([
|
|
|
4
4
|
]);
|
|
5
5
|
function getExistingEquivalentLabel(existingLabels, outcomeLabel) {
|
|
6
6
|
const outcomeTrimmed = outcomeLabel.replace(/\w+: (\w+)/, "$1");
|
|
7
|
-
return existingLabels.find((
|
|
8
|
-
return
|
|
7
|
+
return existingLabels.find(({ name: existingName }) => {
|
|
8
|
+
return existingName === outcomeLabel || existingName === outcomeTrimmed || aliases.get(existingName) === outcomeLabel || existingName.replace(/\w+: (\w+)/, "$1") === outcomeLabel;
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/initializeGitHubRepository/labels/getExistingEquivalentLabel.ts"],"sourcesContent":["const aliases = new Map([\n\t[\"enhancement\", \"type: feature\"],\n\t[\"help wanted\", \"status: accepting prs\"],\n]);\n\nexport function getExistingEquivalentLabel(\n\texistingLabels:
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/initializeGitHubRepository/labels/getExistingEquivalentLabel.ts"],"sourcesContent":["const aliases = new Map([\n\t[\"enhancement\", \"type: feature\"],\n\t[\"help wanted\", \"status: accepting prs\"],\n]);\n\nexport interface GhLabelData {\n\tcolor: string;\n\tdescription: string;\n\tname: string;\n}\n\nexport function getExistingEquivalentLabel(\n\texistingLabels: GhLabelData[],\n\toutcomeLabel: string,\n) {\n\tconst outcomeTrimmed = outcomeLabel.replace(/\\w+: (\\w+)/, \"$1\");\n\n\treturn existingLabels.find(({ name: existingName }) => {\n\t\treturn (\n\t\t\texistingName === outcomeLabel ||\n\t\t\texistingName === outcomeTrimmed ||\n\t\t\taliases.get(existingName) === outcomeLabel ||\n\t\t\texistingName.replace(/\\w+: (\\w+)/, \"$1\") === outcomeLabel\n\t\t);\n\t});\n}\n"],"mappings":"AAAA,MAAM,UAAU,oBAAI,IAAI;AAAA,EACvB,CAAC,eAAe,eAAe;AAAA,EAC/B,CAAC,eAAe,uBAAuB;AACxC,CAAC;AAQM,SAAS,2BACf,gBACA,cACC;AACD,QAAM,iBAAiB,aAAa,QAAQ,cAAc,IAAI;AAE9D,SAAO,eAAe,KAAK,CAAC,EAAE,MAAM,aAAa,MAAM;AACtD,WACC,iBAAiB,gBACjB,iBAAiB,kBACjB,QAAQ,IAAI,YAAY,MAAM,gBAC9B,aAAa,QAAQ,cAAc,IAAI,MAAM;AAAA,EAE/C,CAAC;AACF;","names":[]}
|
|
@@ -1,29 +1,25 @@
|
|
|
1
1
|
import { $ } from "execa";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
getExistingEquivalentLabel
|
|
4
|
+
} from "./getExistingEquivalentLabel.js";
|
|
3
5
|
import { outcomeLabels } from "./outcomeLabels.js";
|
|
4
6
|
async function initializeRepositoryLabels() {
|
|
5
|
-
const getLabelName = (label) => label.name;
|
|
6
7
|
const existingLabels = JSON.parse(
|
|
7
|
-
(await $`gh label list --json name`).stdout || "[]"
|
|
8
|
-
)
|
|
9
|
-
const allowedLabels = new Set(outcomeLabels.map(getLabelName));
|
|
8
|
+
(await $`gh label list --json color,description,name`).stdout || "[]"
|
|
9
|
+
);
|
|
10
10
|
for (const outcome of outcomeLabels) {
|
|
11
11
|
const existingEquivalent = getExistingEquivalentLabel(
|
|
12
12
|
existingLabels,
|
|
13
13
|
outcome.name
|
|
14
14
|
);
|
|
15
15
|
if (existingEquivalent) {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
if (outcome.color !== existingEquivalent.color || outcome.description !== existingEquivalent.description) {
|
|
17
|
+
await $`gh label edit ${existingEquivalent.name} --color ${outcome.color} --description ${outcome.description} --name ${outcome.name}`;
|
|
18
|
+
}
|
|
18
19
|
} else {
|
|
19
20
|
await $`gh label create ${outcome.name} --color ${outcome.color} --description ${outcome.description}`;
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
|
-
for (const existingLabel of existingLabels) {
|
|
23
|
-
if (!allowedLabels.has(existingLabel)) {
|
|
24
|
-
await $`gh label delete ${existingLabel} --yes`;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
23
|
}
|
|
28
24
|
export {
|
|
29
25
|
initializeRepositoryLabels
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nimport {\n\tGhLabelData,\n\tgetExistingEquivalentLabel,\n} from \"./getExistingEquivalentLabel.js\";\nimport { outcomeLabels } from \"./outcomeLabels.js\";\n\nexport async function initializeRepositoryLabels() {\n\tconst existingLabels = JSON.parse(\n\t\t(await $`gh label list --json color,description,name`).stdout || \"[]\",\n\t) as GhLabelData[];\n\n\tfor (const outcome of outcomeLabels) {\n\t\tconst existingEquivalent = getExistingEquivalentLabel(\n\t\t\texistingLabels,\n\t\t\toutcome.name,\n\t\t);\n\n\t\tif (existingEquivalent) {\n\t\t\tif (\n\t\t\t\toutcome.color !== existingEquivalent.color ||\n\t\t\t\toutcome.description !== existingEquivalent.description\n\t\t\t) {\n\t\t\t\tawait $`gh label edit ${existingEquivalent.name} --color ${outcome.color} --description ${outcome.description} --name ${outcome.name}`;\n\t\t\t}\n\t\t} else {\n\t\t\tawait $`gh label create ${outcome.name} --color ${outcome.color} --description ${outcome.description}`;\n\t\t}\n\t}\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAElB;AAAA,EAEC;AAAA,OACM;AACP,SAAS,qBAAqB;AAE9B,eAAsB,6BAA6B;AAClD,QAAM,iBAAiB,KAAK;AAAA,KAC1B,MAAM,gDAAgD,UAAU;AAAA,EAClE;AAEA,aAAW,WAAW,eAAe;AACpC,UAAM,qBAAqB;AAAA,MAC1B;AAAA,MACA,QAAQ;AAAA,IACT;AAEA,QAAI,oBAAoB;AACvB,UACC,QAAQ,UAAU,mBAAmB,SACrC,QAAQ,gBAAgB,mBAAmB,aAC1C;AACD,cAAM,kBAAkB,mBAAmB,IAAI,YAAY,QAAQ,KAAK,kBAAkB,QAAQ,WAAW,WAAW,QAAQ,IAAI;AAAA,MACrI;AAAA,IACD,OAAO;AACN,YAAM,oBAAoB,QAAQ,IAAI,YAAY,QAAQ,KAAK,kBAAkB,QAAQ,WAAW;AAAA,IACrG;AAAA,EACD;AACD;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/writing/creation/createESLintRC.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\n\nexport async function createESLintRC(options: Options) {\n\treturn await formatTypeScript(`/*\nš Hi! This ESLint configuration contains a lot more stuff than many repos'!\nYou can read from it to see all sorts of linting goodness, but don't worry -\nit's not something you need to exhaustively understand immediately. š\n\nIf you're interested in learning more, see the 'getting started' docs on:\n- ESLint: https://eslint.org\n- typescript-eslint: https://typescript-eslint.io\n*/\n\n/** @type {import(\"@types/eslint\").Linter.Config} */\nmodule.exports = {\n\tenv: {\n\t\tes2022: true,\n\t\tnode: true,\n\t},\n\textends: [\n\t\t\"eslint:recommended\",\n\t\t\"plugin:eslint-comments/recommended\",\n\t\t\"plugin:n/recommended\",${\n\t\t\toptions.excludeLintPerfectionist\n\t\t\t\t? \"\"\n\t\t\t\t: `\n\t\t\"plugin:perfectionist/recommended-natural\",`\n\t\t}\n\t\t\"plugin:regexp/recommended\",\n\t\t\"prettier\",\n\t],\n\toverrides: [${\n\t\toptions.excludeLintMd\n\t\t\t? \"\"\n\t\t\t: `\n\t\t{\n\t\t\textends: [\"plugin:markdown/recommended\"],\n\t\t\tfiles: [\"**/*.md\"],\n\t\t\tprocessor: \"markdown/markdown\",\n\t\t},`\n\t}\n\t\t{\n\t\t\textends: [\n\t\t\t\t\"plugin:jsdoc/recommended-typescript-error\",\n\t\t\t\t\"plugin:@typescript-eslint/strict\",\n\t\t\t\t\"plugin:@typescript-eslint/stylistic\",\n\t\t\t],\n\t\t\tfiles: [\"**/*.ts\"],\n\t\t\tparser: \"@typescript-eslint/parser\",\n\t\t\trules: {\n\t\t\t\t// These off-by-default rules work well for this repo and we like them on.\n\t\t\t\t\"jsdoc/informative-docs\": \"error\",\n\t\t\t\t\"logical-assignment-operators\": [\n\t\t\t\t\t\"error\",\n\t\t\t\t\t\"always\",\n\t\t\t\t\t{ enforceForIfStatements: true },\n\t\t\t\t],\n\t\t\t\t\"operator-assignment\": \"error\",\n\n\t\t\t\t// These on-by-default rules don't work well for this repo and we like them off.\n\t\t\t\t\"jsdoc/require-jsdoc\": \"off\",\n\t\t\t\t\"jsdoc/require-param\": \"off\",\n\t\t\t\t\"jsdoc/require-property\": \"off\",\n\t\t\t\t\"jsdoc/require-returns\": \"off\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t${\n\t\t\t\toptions.excludeLintMd\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `excludedFiles: [\"**/*.md/*.ts\"],\n\t\t\t`\n\t\t\t}extends: [\n\t\t\t\t\"plugin:@typescript-eslint/strict-type-checked\",\n\t\t\t\t\"plugin:@typescript-eslint/stylistic-type-checked\",\n\t\t\t],\n\t\t\tfiles: [\"**/*.ts\"],\n\t\t\tparser: \"@typescript-eslint/parser\",\n\t\t\tparserOptions: {\n\t\t\t\tproject: \"./tsconfig.eslint.json\",\n\t\t\t},\n\t\t\trules: {\n\t\t\t\t// These off-by-default rules work well for this repo and we like them on.\n\t\t\t\t\"deprecation/deprecation\": \"error\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\texcludedFiles: [\"package.json\"],\n\t\t\textends: [\"plugin:jsonc/recommended-with-json\"],\n\t\t\tfiles: [\"*.json\", \"*.jsonc\"],\n\t\t\tparser: \"jsonc-eslint-parser\",\n\t\t\trules: {\n\t\t\t\t\"jsonc/sort-keys\": \"error\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: [\"*.jsonc\"],\n\t\t\trules: {\n\t\t\t\t\"jsonc/no-comments\": \"off\",\n\t\t\t},\n\t\t},${\n\t\t\toptions.excludeTests\n\t\t\t\t? \"\"\n\t\t\t\t: `\\n{\n\t\t\tfiles: \"**/*.test.ts\",\n\t\t\trules: {\n\t\t\t\t// These on-by-default rules aren't useful in test files.\n\t\t\t\t\"@typescript-eslint/no-unsafe-assignment\": \"off\",\n\t\t\t\t\"@typescript-eslint/no-unsafe-call\": \"off\",\n\t\t\t},\n\t\t},`\n\t\t}${\n\t\t\toptions.excludeLintYml\n\t\t\t\t? \"\"\n\t\t\t\t: `\\n\n\t\t{\n\t\t\textends: [\"plugin:yml/standard\", \"plugin:yml/prettier\"],\n\t\t\tfiles: [\"**/*.{yml,yaml}\"],\n\t\t\tparser: \"yaml-eslint-parser\",\n\t\t\trules: {\n\t\t\t\t\"yml/file-extension\": [\"error\", { extension: \"yml\" }],\n\t\t\t\t\"yml/sort-keys\": [\n\t\t\t\t\t\"error\",\n\t\t\t\t\t{\n\t\t\t\t\t\torder: { type: \"asc\" },\n\t\t\t\t\t\tpathPattern: \"^.*$\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\t\"yml/sort-sequence-values\": [\n\t\t\t\t\t\"error\",\n\t\t\t\t\t{\n\t\t\t\t\t\torder: { type: \"asc\" },\n\t\t\t\t\t\tpathPattern: \"^.*$\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t`\n\t\t}],\n\tparser: \"@typescript-eslint/parser\",\n\tplugins: [\n\t\t\"@typescript-eslint\",\n\t\t\"deprecation\",\n\t\t\"import\",\n\t\t\"jsdoc\",${options.excludeTests ? \"\" : `\"no-only-tests\",`}${\n\t\t\toptions.excludeLintPerfectionist ? \"\" : `\"perfectionist\",`\n\t\t}\n\t\t\"regexp\",${options.excludeTests ? \"\" : `\\n\"vitest\",`}\n\t],\n\troot: true,\n\trules: {\n\t\t// These off/less-strict-by-default rules work well for this repo and we like them on.\n\t\t\"@typescript-eslint/no-unused-vars\": [\"error\", { caughtErrors: \"all\" }],\n\t\t\"import/extensions\": [\"error\", \"ignorePackages\"],${\n\t\t\toptions.excludeTests ? \"\" : `\\n\"no-only-tests/no-only-tests\": \"error\",`\n\t\t}\n\n\t\t// These on-by-default rules don't work well for this repo and we like them off.\n\t\t\"n/no-missing-import\": \"off\",\n\t\t\"no-case-declarations\": \"off\",\n\t\t\"no-constant-condition\": \"off\",\n\t\t\"no-inner-declarations\": \"off\",\n\n\t\t// Stylistic concerns that don't interfere with Prettier\n\t\t\"@typescript-eslint/padding-line-between-statements\": [\n\t\t\t\"error\",\n\t\t\t{ blankLine: \"always\", next: \"*\", prev: \"block-like\" },\n\t\t],\n\t\t\"perfectionist/sort-objects\": [\n\t\t\t\"error\",\n\t\t\t{\n\t\t\t\torder: \"asc\",\n\t\t\t\t\"partition-by-comment\": true,\n\t\t\t\ttype: \"natural\",\n\t\t\t},\n\t\t],\n\t},\n};\n`);\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AAEjC,eAAsB,eAAe,SAAkB;AACtD,SAAO,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAoB5B,QAAQ,2BACL,KACA;AAAA,8CAEJ;AAAA;AAAA;AAAA;AAAA,eAKA,QAAQ,gBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA,KAMJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KA4BG,QAAQ,gBACL,KACA;AAAA,IAEJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MA6BA,QAAQ,eACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAQJ,GACC,QAAQ,iBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwBJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAMU,QAAQ,eAAe,KAAK,kBAAkB,GACvD,QAAQ,2BAA2B,KAAK,kBACzC;AAAA,aACW,QAAQ,eAAe,KAAK;AAAA,UAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/writing/creation/createESLintRC.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\n\nexport async function createESLintRC(options: Options) {\n\treturn await formatTypeScript(`/*\nš Hi! This ESLint configuration contains a lot more stuff than many repos'!\nYou can read from it to see all sorts of linting goodness, but don't worry -\nit's not something you need to exhaustively understand immediately. š\n\nIf you're interested in learning more, see the 'getting started' docs on:\n- ESLint: https://eslint.org\n- typescript-eslint: https://typescript-eslint.io\n*/\n\n/** @type {import(\"@types/eslint\").Linter.Config} */\nmodule.exports = {\n\tenv: {\n\t\tes2022: true,\n\t\tnode: true,\n\t},\n\textends: [\n\t\t\"eslint:recommended\",\n\t\t\"plugin:eslint-comments/recommended\",\n\t\t\"plugin:n/recommended\",${\n\t\t\toptions.excludeLintPerfectionist\n\t\t\t\t? \"\"\n\t\t\t\t: `\n\t\t\"plugin:perfectionist/recommended-natural\",`\n\t\t}\n\t\t\"plugin:regexp/recommended\",\n\t\t\"prettier\",\n\t],\n\toverrides: [${\n\t\toptions.excludeLintMd\n\t\t\t? \"\"\n\t\t\t: `\n\t\t{\n\t\t\textends: [\"plugin:markdown/recommended\"],\n\t\t\tfiles: [\"**/*.md\"],\n\t\t\tprocessor: \"markdown/markdown\",\n\t\t},`\n\t}\n\t\t{\n\t\t\textends: [\n\t\t\t\t\"plugin:jsdoc/recommended-typescript-error\",\n\t\t\t\t\"plugin:@typescript-eslint/strict\",\n\t\t\t\t\"plugin:@typescript-eslint/stylistic\",\n\t\t\t],\n\t\t\tfiles: [\"**/*.ts\"],\n\t\t\tparser: \"@typescript-eslint/parser\",\n\t\t\trules: {\n\t\t\t\t// These off-by-default rules work well for this repo and we like them on.\n\t\t\t\t\"jsdoc/informative-docs\": \"error\",\n\t\t\t\t\"logical-assignment-operators\": [\n\t\t\t\t\t\"error\",\n\t\t\t\t\t\"always\",\n\t\t\t\t\t{ enforceForIfStatements: true },\n\t\t\t\t],\n\t\t\t\t\"operator-assignment\": \"error\",\n\n\t\t\t\t// These on-by-default rules don't work well for this repo and we like them off.\n\t\t\t\t\"jsdoc/require-jsdoc\": \"off\",\n\t\t\t\t\"jsdoc/require-param\": \"off\",\n\t\t\t\t\"jsdoc/require-property\": \"off\",\n\t\t\t\t\"jsdoc/require-returns\": \"off\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t${\n\t\t\t\toptions.excludeLintMd\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `excludedFiles: [\"**/*.md/*.ts\"],\n\t\t\t`\n\t\t\t}extends: [\n\t\t\t\t\"plugin:@typescript-eslint/strict-type-checked\",\n\t\t\t\t\"plugin:@typescript-eslint/stylistic-type-checked\",\n\t\t\t],\n\t\t\tfiles: [\"**/*.ts\"],\n\t\t\tparser: \"@typescript-eslint/parser\",\n\t\t\tparserOptions: {\n\t\t\t\tproject: \"./tsconfig.eslint.json\",\n\t\t\t},\n\t\t\trules: {\n\t\t\t\t// These off-by-default rules work well for this repo and we like them on.\n\t\t\t\t\"deprecation/deprecation\": \"error\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\texcludedFiles: [\"package.json\"],\n\t\t\textends: [\"plugin:jsonc/recommended-with-json\"],\n\t\t\tfiles: [\"*.json\", \"*.jsonc\"],\n\t\t\tparser: \"jsonc-eslint-parser\",\n\t\t\trules: {\n\t\t\t\t\"jsonc/sort-keys\": \"error\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: [\"*.jsonc\"],\n\t\t\trules: {\n\t\t\t\t\"jsonc/no-comments\": \"off\",\n\t\t\t},\n\t\t},${\n\t\t\toptions.excludeTests\n\t\t\t\t? \"\"\n\t\t\t\t: `\\n{\n\t\t\tfiles: \"**/*.test.ts\",\n\t\t\trules: {\n\t\t\t\t// These on-by-default rules aren't useful in test files.\n\t\t\t\t\"@typescript-eslint/no-unsafe-assignment\": \"off\",\n\t\t\t\t\"@typescript-eslint/no-unsafe-call\": \"off\",\n\t\t\t},\n\t\t},`\n\t\t}${\n\t\t\toptions.excludeLintYml\n\t\t\t\t? \"\"\n\t\t\t\t: `\\n\n\t\t{\n\t\t\textends: [\"plugin:yml/standard\", \"plugin:yml/prettier\"],\n\t\t\tfiles: [\"**/*.{yml,yaml}\"],\n\t\t\tparser: \"yaml-eslint-parser\",\n\t\t\trules: {\n\t\t\t\t\"yml/file-extension\": [\"error\", { extension: \"yml\" }],\n\t\t\t\t\"yml/sort-keys\": [\n\t\t\t\t\t\"error\",\n\t\t\t\t\t{\n\t\t\t\t\t\torder: { type: \"asc\" },\n\t\t\t\t\t\tpathPattern: \"^.*$\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\t\"yml/sort-sequence-values\": [\n\t\t\t\t\t\"error\",\n\t\t\t\t\t{\n\t\t\t\t\t\torder: { type: \"asc\" },\n\t\t\t\t\t\tpathPattern: \"^.*$\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t`\n\t\t}],\n\tparser: \"@typescript-eslint/parser\",\n\tplugins: [\n\t\t\"@typescript-eslint\",\n\t\t\"deprecation\",\n\t\t\"import\",\n\t\t\"jsdoc\",${options.excludeTests ? \"\" : `\"no-only-tests\",`}${\n\t\t\toptions.excludeLintPerfectionist ? \"\" : `\"perfectionist\",`\n\t\t}\n\t\t\"regexp\",${options.excludeTests ? \"\" : `\\n\"vitest\",`}\n\t],\n\treportUnusedDisableDirectives: true,\n\troot: true,\n\trules: {\n\t\t// These off/less-strict-by-default rules work well for this repo and we like them on.\n\t\t\"@typescript-eslint/no-unused-vars\": [\"error\", { caughtErrors: \"all\" }],\n\t\t\"import/extensions\": [\"error\", \"ignorePackages\"],${\n\t\t\toptions.excludeTests ? \"\" : `\\n\"no-only-tests/no-only-tests\": \"error\",`\n\t\t}\n\n\t\t// These on-by-default rules don't work well for this repo and we like them off.\n\t\t\"n/no-missing-import\": \"off\",\n\t\t\"no-case-declarations\": \"off\",\n\t\t\"no-constant-condition\": \"off\",\n\t\t\"no-inner-declarations\": \"off\",\n\n\t\t// Stylistic concerns that don't interfere with Prettier\n\t\t\"@typescript-eslint/padding-line-between-statements\": [\n\t\t\t\"error\",\n\t\t\t{ blankLine: \"always\", next: \"*\", prev: \"block-like\" },\n\t\t],\n\t\t\"perfectionist/sort-objects\": [\n\t\t\t\"error\",\n\t\t\t{\n\t\t\t\torder: \"asc\",\n\t\t\t\t\"partition-by-comment\": true,\n\t\t\t\ttype: \"natural\",\n\t\t\t},\n\t\t],\n\t},\n};\n`);\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AAEjC,eAAsB,eAAe,SAAkB;AACtD,SAAO,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAoB5B,QAAQ,2BACL,KACA;AAAA,8CAEJ;AAAA;AAAA;AAAA;AAAA,eAKA,QAAQ,gBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA,KAMJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KA4BG,QAAQ,gBACL,KACA;AAAA,IAEJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MA6BA,QAAQ,eACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAQJ,GACC,QAAQ,iBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwBJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAMU,QAAQ,eAAe,KAAK,kBAAkB,GACvD,QAAQ,2BAA2B,KAAK,kBACzC;AAAA,aACW,QAAQ,eAAe,KAAK;AAAA,UAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qDAQnD,QAAQ,eAAe,KAAK;AAAA,wCAC7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAuBD;AACD;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-typescript-app",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.16",
|
|
4
4
|
"description": "A quickstart-friendly TypeScript template with comprehensive formatting, linting, releases, testing, and other great tooling built-in. āØ",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"format:write": "pnpm format --write",
|
|
29
29
|
"initialize": "tsx ./src/bin/index.js --mode initialize",
|
|
30
30
|
"initialize:test": "node script/initialize-test-e2e.js",
|
|
31
|
-
"lint": "eslint . .*js --max-warnings 0
|
|
31
|
+
"lint": "eslint . .*js --max-warnings 0",
|
|
32
32
|
"lint:knip": "knip",
|
|
33
33
|
"lint:md": "markdownlint \"**/*.md\" \".github/**/*.md\" --rules sentences-per-line",
|
|
34
34
|
"lint:package-json": "npmPkgJsonLint .",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"globby": "^13.2.2",
|
|
88
88
|
"husky": "^8.0.3",
|
|
89
89
|
"jsonc-eslint-parser": "^2.3.0",
|
|
90
|
-
"knip": "2.20.
|
|
90
|
+
"knip": "2.20.2",
|
|
91
91
|
"lint-staged": "^14.0.1",
|
|
92
92
|
"markdownlint": "^0.30.0",
|
|
93
93
|
"markdownlint-cli": "^0.35.0",
|