create-typescript-app 1.68.0 → 1.69.0

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.
@@ -37,8 +37,8 @@ async function finalizeDependencies(options) {
37
37
  ...options.excludeReleases ? [] : ["@release-it/conventional-changelog", "release-it"],
38
38
  ...options.excludeTests ? [] : [
39
39
  "@vitest/coverage-v8",
40
+ "@vitest/eslint-plugin",
40
41
  "console-fail-test",
41
- "eslint-plugin-vitest",
42
42
  "vitest"
43
43
  ]
44
44
  ].filter(Boolean).sort().map((packageName) => `${packageName}@latest`).join(" ");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/steps/finalizeDependencies.ts"],"sourcesContent":["import { execaCommand } from \"execa\";\n\nimport { readPackageData, removeDependencies } from \"../shared/packages.js\";\nimport { Options } from \"../shared/types.js\";\n\nexport async function finalizeDependencies(options: Options) {\n\tconst devDependencies = [\n\t\t\"@eslint/js\",\n\t\t\"@eslint-community/eslint-plugin-eslint-comments\",\n\t\t\"@types/eslint-plugin-markdown\",\n\t\t\"@types/eslint__js\",\n\t\t\"@types/node\",\n\t\t\"eslint\",\n\t\t\"eslint-plugin-jsdoc\",\n\t\t\"eslint-plugin-n\",\n\t\t\"eslint-plugin-regexp\",\n\t\t\"husky\",\n\t\t\"lint-staged\",\n\t\t\"prettier\",\n\t\t\"prettier-plugin-curly\",\n\t\t\"prettier-plugin-sh\",\n\t\t\"prettier-plugin-packagejson\",\n\t\t\"tsup\",\n\t\t\"typescript\",\n\t\t\"typescript-eslint\",\n\t\t...(options.excludeAllContributors ? [] : [\"all-contributors-cli\"]),\n\t\t...(options.excludeLintJson ? [] : [\"eslint-plugin-jsonc\"]),\n\t\t...(options.excludeLintJson && options.excludeLintPackageJson\n\t\t\t? []\n\t\t\t: [\"jsonc-eslint-parser\"]),\n\t\t...(options.excludeLintKnip ? [] : [\"knip\"]),\n\t\t...(options.excludeLintMd\n\t\t\t? []\n\t\t\t: [\n\t\t\t\t\t\"eslint-plugin-markdown\",\n\t\t\t\t\t\"markdownlint\",\n\t\t\t\t\t\"markdownlint-cli\",\n\t\t\t\t\t\"sentences-per-line\",\n\t\t\t\t]),\n\t\t...(options.excludeLintPackageJson ? [] : [\"eslint-plugin-package-json\"]),\n\t\t...(options.excludeLintPerfectionist\n\t\t\t? []\n\t\t\t: [\"eslint-plugin-perfectionist\"]),\n\t\t...(options.excludeLintSpelling ? [] : [\"cspell\"]),\n\t\t...(options.excludeLintYml ? [] : [\"eslint-plugin-yml\"]),\n\t\t...(options.excludeReleases\n\t\t\t? []\n\t\t\t: [\"@release-it/conventional-changelog\", \"release-it\"]),\n\t\t...(options.excludeTests\n\t\t\t? []\n\t\t\t: [\n\t\t\t\t\t\"@vitest/coverage-v8\",\n\t\t\t\t\t\"console-fail-test\",\n\t\t\t\t\t\"eslint-plugin-vitest\",\n\t\t\t\t\t\"vitest\",\n\t\t\t\t]),\n\t]\n\t\t.filter(Boolean)\n\t\t.sort()\n\t\t.map((packageName) => `${packageName}@latest`)\n\t\t.join(\" \");\n\n\tawait execaCommand(\n\t\t`pnpm add ${devDependencies} -D${options.offline ? \" --offline\" : \"\"}`,\n\t);\n\n\tif (!options.excludeAllContributors) {\n\t\tawait execaCommand(`npx all-contributors-cli generate`);\n\t\tawait removeDependencies(\n\t\t\t[\"all-contributors-cli\", \"all-contributors-for-repository\"],\n\t\t\t(await readPackageData()).devDependencies,\n\t\t\t\"-D\",\n\t\t);\n\t}\n\n\tawait execaCommand(`pnpm dedupe --offline`);\n}\n"],"mappings":"AAAA,SAAS,oBAAoB;AAE7B,SAAS,iBAAiB,0BAA0B;AAGpD,eAAsB,qBAAqB,SAAkB;AAC5D,QAAM,kBAAkB;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAI,QAAQ,yBAAyB,CAAC,IAAI,CAAC,sBAAsB;AAAA,IACjE,GAAI,QAAQ,kBAAkB,CAAC,IAAI,CAAC,qBAAqB;AAAA,IACzD,GAAI,QAAQ,mBAAmB,QAAQ,yBACpC,CAAC,IACD,CAAC,qBAAqB;AAAA,IACzB,GAAI,QAAQ,kBAAkB,CAAC,IAAI,CAAC,MAAM;AAAA,IAC1C,GAAI,QAAQ,gBACT,CAAC,IACD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACF,GAAI,QAAQ,yBAAyB,CAAC,IAAI,CAAC,4BAA4B;AAAA,IACvE,GAAI,QAAQ,2BACT,CAAC,IACD,CAAC,6BAA6B;AAAA,IACjC,GAAI,QAAQ,sBAAsB,CAAC,IAAI,CAAC,QAAQ;AAAA,IAChD,GAAI,QAAQ,iBAAiB,CAAC,IAAI,CAAC,mBAAmB;AAAA,IACtD,GAAI,QAAQ,kBACT,CAAC,IACD,CAAC,sCAAsC,YAAY;AAAA,IACtD,GAAI,QAAQ,eACT,CAAC,IACD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACH,EACE,OAAO,OAAO,EACd,KAAK,EACL,IAAI,CAAC,gBAAgB,GAAG,WAAW,SAAS,EAC5C,KAAK,GAAG;AAEV,QAAM;AAAA,IACL,YAAY,eAAe,MAAM,QAAQ,UAAU,eAAe,EAAE;AAAA,EACrE;AAEA,MAAI,CAAC,QAAQ,wBAAwB;AACpC,UAAM,aAAa,mCAAmC;AACtD,UAAM;AAAA,MACL,CAAC,wBAAwB,iCAAiC;AAAA,OACzD,MAAM,gBAAgB,GAAG;AAAA,MAC1B;AAAA,IACD;AAAA,EACD;AAEA,QAAM,aAAa,uBAAuB;AAC3C;","names":[]}
1
+ {"version":3,"sources":["../../src/steps/finalizeDependencies.ts"],"sourcesContent":["import { execaCommand } from \"execa\";\n\nimport { readPackageData, removeDependencies } from \"../shared/packages.js\";\nimport { Options } from \"../shared/types.js\";\n\nexport async function finalizeDependencies(options: Options) {\n\tconst devDependencies = [\n\t\t\"@eslint/js\",\n\t\t\"@eslint-community/eslint-plugin-eslint-comments\",\n\t\t\"@types/eslint-plugin-markdown\",\n\t\t\"@types/eslint__js\",\n\t\t\"@types/node\",\n\t\t\"eslint\",\n\t\t\"eslint-plugin-jsdoc\",\n\t\t\"eslint-plugin-n\",\n\t\t\"eslint-plugin-regexp\",\n\t\t\"husky\",\n\t\t\"lint-staged\",\n\t\t\"prettier\",\n\t\t\"prettier-plugin-curly\",\n\t\t\"prettier-plugin-sh\",\n\t\t\"prettier-plugin-packagejson\",\n\t\t\"tsup\",\n\t\t\"typescript\",\n\t\t\"typescript-eslint\",\n\t\t...(options.excludeAllContributors ? [] : [\"all-contributors-cli\"]),\n\t\t...(options.excludeLintJson ? [] : [\"eslint-plugin-jsonc\"]),\n\t\t...(options.excludeLintJson && options.excludeLintPackageJson\n\t\t\t? []\n\t\t\t: [\"jsonc-eslint-parser\"]),\n\t\t...(options.excludeLintKnip ? [] : [\"knip\"]),\n\t\t...(options.excludeLintMd\n\t\t\t? []\n\t\t\t: [\n\t\t\t\t\t\"eslint-plugin-markdown\",\n\t\t\t\t\t\"markdownlint\",\n\t\t\t\t\t\"markdownlint-cli\",\n\t\t\t\t\t\"sentences-per-line\",\n\t\t\t\t]),\n\t\t...(options.excludeLintPackageJson ? [] : [\"eslint-plugin-package-json\"]),\n\t\t...(options.excludeLintPerfectionist\n\t\t\t? []\n\t\t\t: [\"eslint-plugin-perfectionist\"]),\n\t\t...(options.excludeLintSpelling ? [] : [\"cspell\"]),\n\t\t...(options.excludeLintYml ? [] : [\"eslint-plugin-yml\"]),\n\t\t...(options.excludeReleases\n\t\t\t? []\n\t\t\t: [\"@release-it/conventional-changelog\", \"release-it\"]),\n\t\t...(options.excludeTests\n\t\t\t? []\n\t\t\t: [\n\t\t\t\t\t\"@vitest/coverage-v8\",\n\t\t\t\t\t\"@vitest/eslint-plugin\",\n\t\t\t\t\t\"console-fail-test\",\n\t\t\t\t\t\"vitest\",\n\t\t\t\t]),\n\t]\n\t\t.filter(Boolean)\n\t\t.sort()\n\t\t.map((packageName) => `${packageName}@latest`)\n\t\t.join(\" \");\n\n\tawait execaCommand(\n\t\t`pnpm add ${devDependencies} -D${options.offline ? \" --offline\" : \"\"}`,\n\t);\n\n\tif (!options.excludeAllContributors) {\n\t\tawait execaCommand(`npx all-contributors-cli generate`);\n\t\tawait removeDependencies(\n\t\t\t[\"all-contributors-cli\", \"all-contributors-for-repository\"],\n\t\t\t(await readPackageData()).devDependencies,\n\t\t\t\"-D\",\n\t\t);\n\t}\n\n\tawait execaCommand(`pnpm dedupe --offline`);\n}\n"],"mappings":"AAAA,SAAS,oBAAoB;AAE7B,SAAS,iBAAiB,0BAA0B;AAGpD,eAAsB,qBAAqB,SAAkB;AAC5D,QAAM,kBAAkB;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAI,QAAQ,yBAAyB,CAAC,IAAI,CAAC,sBAAsB;AAAA,IACjE,GAAI,QAAQ,kBAAkB,CAAC,IAAI,CAAC,qBAAqB;AAAA,IACzD,GAAI,QAAQ,mBAAmB,QAAQ,yBACpC,CAAC,IACD,CAAC,qBAAqB;AAAA,IACzB,GAAI,QAAQ,kBAAkB,CAAC,IAAI,CAAC,MAAM;AAAA,IAC1C,GAAI,QAAQ,gBACT,CAAC,IACD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACF,GAAI,QAAQ,yBAAyB,CAAC,IAAI,CAAC,4BAA4B;AAAA,IACvE,GAAI,QAAQ,2BACT,CAAC,IACD,CAAC,6BAA6B;AAAA,IACjC,GAAI,QAAQ,sBAAsB,CAAC,IAAI,CAAC,QAAQ;AAAA,IAChD,GAAI,QAAQ,iBAAiB,CAAC,IAAI,CAAC,mBAAmB;AAAA,IACtD,GAAI,QAAQ,kBACT,CAAC,IACD,CAAC,sCAAsC,YAAY;AAAA,IACtD,GAAI,QAAQ,eACT,CAAC,IACD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACH,EACE,OAAO,OAAO,EACd,KAAK,EACL,IAAI,CAAC,gBAAgB,GAAG,WAAW,SAAS,EAC5C,KAAK,GAAG;AAEV,QAAM;AAAA,IACL,YAAY,eAAe,MAAM,QAAQ,UAAU,eAAe,EAAE;AAAA,EACrE;AAEA,MAAI,CAAC,QAAQ,wBAAwB;AACpC,UAAM,aAAa,mCAAmC;AACtD,UAAM;AAAA,MACL,CAAC,wBAAwB,iCAAiC;AAAA,OACzD,MAAM,gBAAgB,GAAG;AAAA,MAC1B;AAAA,IACD;AAAA,EACD;AAEA,QAAM,aAAa,uBAAuB;AAC3C;","names":[]}
@@ -4,6 +4,7 @@ async function createESLintConfig(options) {
4
4
  const imports = [
5
5
  `import eslint from "@eslint/js";`,
6
6
  !options.excludeLintESLint && `import comments from "@eslint-community/eslint-plugin-eslint-comments/configs";`,
7
+ !options.excludeTests && `import vitest from "@vitest/eslint-plugin";`,
7
8
  !options.excludeLintJSDoc && `import jsdoc from "eslint-plugin-jsdoc";`,
8
9
  !options.excludeLintJson && `import jsonc from "eslint-plugin-jsonc";`,
9
10
  !options.excludeLintMd && `import markdown from "eslint-plugin-markdown";`,
@@ -11,7 +12,6 @@ async function createESLintConfig(options) {
11
12
  !options.excludeLintPackageJson && `import packageJson from "eslint-plugin-package-json/configs/recommended";`,
12
13
  !options.excludeLintPerfectionist && `import perfectionist from "eslint-plugin-perfectionist";`,
13
14
  !options.excludeLintRegex && `import * as regexp from "eslint-plugin-regexp";`,
14
- !options.excludeTests && `import vitest from "eslint-plugin-vitest";`,
15
15
  !options.excludeLintYml && `import yml from "eslint-plugin-yml";`,
16
16
  `import tseslint from "typescript-eslint";`
17
17
  ].filter(Boolean);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/steps/writing/creation/createESLintConfig.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\n\nexport async function createESLintConfig(options: Options) {\n\tconst tseslintBase = options.excludeLintStrict ? \"recommended\" : \"strict\";\n\n\tconst imports = [\n\t\t`import eslint from \"@eslint/js\";`,\n\t\t!options.excludeLintESLint &&\n\t\t\t`import comments from \"@eslint-community/eslint-plugin-eslint-comments/configs\";`,\n\t\t!options.excludeLintJSDoc && `import jsdoc from \"eslint-plugin-jsdoc\";`,\n\t\t!options.excludeLintJson && `import jsonc from \"eslint-plugin-jsonc\";`,\n\t\t!options.excludeLintMd && `import markdown from \"eslint-plugin-markdown\";`,\n\t\t`import n from \"eslint-plugin-n\";`,\n\t\t!options.excludeLintPackageJson &&\n\t\t\t`import packageJson from \"eslint-plugin-package-json/configs/recommended\";`,\n\t\t!options.excludeLintPerfectionist &&\n\t\t\t`import perfectionist from \"eslint-plugin-perfectionist\";`,\n\t\t!options.excludeLintRegex &&\n\t\t\t`import * as regexp from \"eslint-plugin-regexp\";`,\n\t\t!options.excludeTests && `import vitest from \"eslint-plugin-vitest\";`,\n\t\t!options.excludeLintYml && `import yml from \"eslint-plugin-yml\";`,\n\t\t`import tseslint from \"typescript-eslint\";`,\n\t].filter(Boolean);\n\n\tconst elements = [\n\t\t`eslint.configs.recommended,`,\n\t\t!options.excludeLintJson &&\n\t\t\t`\t...jsonc.configs[\"flat/recommended-with-json\"],`,\n\t\t!options.excludeLintMd && `\t...markdown.configs.recommended,`,\n\t\t!options.excludeLintYml && `\t...yml.configs[\"flat/recommended\"],`,\n\t\t!options.excludeLintYml && `\t...yml.configs[\"flat/prettier\"],`,\n\t\t!options.excludeLintESLint && `\tcomments.recommended,`,\n\t\t!options.excludeLintJSDoc &&\n\t\t\t`\tjsdoc.configs[\"flat/contents-typescript-error\"],\n\tjsdoc.configs[\"flat/logical-typescript-error\"],\n\tjsdoc.configs[\"flat/stylistic-typescript-error\"],`,\n\t\t`\tn.configs[\"flat/recommended\"],`,\n\t\t!options.excludeLintPackageJson && `\tpackageJson,`,\n\t\t!options.excludeLintPerfectionist &&\n\t\t\t`\tperfectionist.configs[\"recommended-natural\"],`,\n\t\t!options.excludeLintRegex && `\tregexp.configs[\"flat/recommended\"],`,\n\t].filter(Boolean);\n\n\treturn await formatTypeScript(`${imports.join(\"\\n\")}\n\nexport default tseslint.config(\n\t{\n\t\tignores: [${\n\t\t\toptions.excludeTests\n\t\t\t\t? \"\"\n\t\t\t\t: `\n\t\t\t\"coverage*\",`\n\t\t}\n\t\t\t\"lib\",\n\t\t\t\"node_modules\",\n\t\t\t\"pnpm-lock.yaml\",\n\t\t\t\"**/*.snap\",\n\t\t],\n\t},\n\t{\n\t\tlinterOptions: {\n\t\t\treportUnusedDisableDirectives: \"error\",\n\t\t},\n\t},\n\t${elements.join(\"\\n\")}\n\t...tseslint.config({\n\t\textends: ${\n\t\t\toptions.excludeLintStylistic\n\t\t\t\t? `tseslint.configs.${tseslintBase}TypeChecked`\n\t\t\t\t: `[\n\t\t\t...tseslint.configs.${tseslintBase}TypeChecked,\n\t\t\t...tseslint.configs.stylisticTypeChecked,\n\t\t]`\n\t\t},\n\t\tfiles: [\"**/*.js\", \"**/*.ts\"],\n\t\tlanguageOptions: {\n\t\t\tparserOptions: {\n\t\t\t\tprojectService: {\n\t\t\t\t\tallowDefaultProject: [\"*.*s\", \"eslint.config.js\"],\n\t\t\t\t\tdefaultProject: \"./tsconfig.json\",\n\t\t\t\t},\n\t\t\t\ttsconfigRootDir: import.meta.dirname\n\t\t\t},\n\t\t},\n\t\trules: {\n\t\t\t${\n\t\t\t\t!options.excludeLintJSDoc || !options.excludeLintStylistic\n\t\t\t\t\t? \"// These off-by-default rules work well for this repo and we like them on.\"\n\t\t\t\t\t: \"\"\n\t\t\t}${\n\t\t\t\toptions.excludeLintStylistic\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"logical-assignment-operators\": [\n\t\t\t\t\"error\",\n\t\t\t\t\"always\",\n\t\t\t\t{ enforceForIfStatements: true },\n\t\t\t],\n\t\t\t\"operator-assignment\": \"error\",`\n\t\t\t}\n\n\t\t\t// These on-by-default rules don't work well for this repo and we like them off.${\n\t\t\t\toptions.excludeLintJSDoc\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"jsdoc/lines-before-block\": \"off\",`\n\t\t\t}\n\t\t\t\"no-constant-condition\": \"off\",\n\n\t\t\t// These on-by-default rules work well for this repo if configured\n\t\t\t\"@typescript-eslint/no-unused-vars\": [\"error\", { caughtErrors: \"all\" }],${\n\t\t\t\toptions.excludeLintPerfectionist\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"n/no-unsupported-features/node-builtins\": [\n\t\t\t\t\"error\",\n\t\t\t\t{ allowExperimental: true },\n\t\t\t],\n\t\t\t\"perfectionist/sort-objects\": [\n\t\t\t\t\"error\",\n\t\t\t\t{\n\t\t\t\t\torder: \"asc\",\n\t\t\t\t\tpartitionByComment: true,\n\t\t\t\t\ttype: \"natural\",\n\t\t\t\t},\n\t\t\t],`\n\t\t\t}${\n\t\t\t\toptions.excludeLintStylistic\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\n\t\t\t// Stylistic concerns that don't interfere with Prettier\n\t\t\t\"no-useless-rename\": \"error\",\n\t\t\t\"object-shorthand\": \"error\",`\n\t\t\t}\n\t\t},\n\t}),\n\t{\n\t\tfiles: [\"*.jsonc\"],\n\t\trules: {\n\t\t\t\"jsonc/comma-dangle\": \"off\",\n\t\t\t\"jsonc/no-comments\": \"off\",\n\t\t\t\"jsonc/sort-keys\": \"error\",\n\t\t},\n\t},\n\t{\n\t\textends: [tseslint.configs.disableTypeChecked],\n\t\tfiles: [\"**/*.md/*.ts\"],\n\t\trules: {\n\t\t\t\"n/no-missing-import\": [\n\t\t\t\t\"error\",\n\t\t\t\t{ allowModules: [\"${options.repository}\"] },\n\t\t\t],\n\t\t},\n\t},${\n\t\toptions.excludeTests\n\t\t\t? \"\"\n\t\t\t: `\n\t{\n\t\tfiles: [\"**/*.test.*\"],\n\t\tlanguageOptions: {\n\t\t\tglobals: vitest.environments.env.globals,\n\t\t},\n\t\tplugins: { vitest, },\n\t\trules: {\n\t\t\t...vitest.configs.recommended.rules,\n\n\t\t\t// These on-by-default rules aren't useful in test files.\n\t\t\t\"@typescript-eslint/no-unsafe-assignment\": \"off\",\n\t\t\t\"@typescript-eslint/no-unsafe-call\": \"off\",\n\t\t},\n\t},`\n\t}${\n\t\toptions.excludeLintYml\n\t\t\t? \"\"\n\t\t\t: `\n\t{\n\t\tfiles: [\"**/*.{yml,yaml}\"],\n\t\trules: {\n\t\t\t\"yml/file-extension\": [\"error\", { extension: \"yml\" }],\n\t\t\t\"yml/sort-keys\": [\n\t\t\t\t\"error\",\n\t\t\t\t{\n\t\t\t\t\torder: { type: \"asc\" },\n\t\t\t\t\tpathPattern: \"^.*$\",\n\t\t\t\t},\n\t\t\t],\n\t\t\t\"yml/sort-sequence-values\": [\n\t\t\t\t\"error\",\n\t\t\t\t{\n\t\t\t\t\torder: { type: \"asc\" },\n\t\t\t\t\tpathPattern: \"^.*$\",\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},`\n\t}\n);\n`);\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AAEjC,eAAsB,mBAAmB,SAAkB;AAC1D,QAAM,eAAe,QAAQ,oBAAoB,gBAAgB;AAEjE,QAAM,UAAU;AAAA,IACf;AAAA,IACA,CAAC,QAAQ,qBACR;AAAA,IACD,CAAC,QAAQ,oBAAoB;AAAA,IAC7B,CAAC,QAAQ,mBAAmB;AAAA,IAC5B,CAAC,QAAQ,iBAAiB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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAaJ,GACC,QAAQ,uBACL,KACA;AAAA;AAAA;AAAA;AAAA,gCAKJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAiBqB,QAAQ,UAAU;AAAA;AAAA;AAAA,KAIxC,QAAQ,eACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAeJ,GACC,QAAQ,iBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAqBJ;AAAA;AAAA,CAEA;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../src/steps/writing/creation/createESLintConfig.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\n\nexport async function createESLintConfig(options: Options) {\n\tconst tseslintBase = options.excludeLintStrict ? \"recommended\" : \"strict\";\n\n\tconst imports = [\n\t\t`import eslint from \"@eslint/js\";`,\n\t\t!options.excludeLintESLint &&\n\t\t\t`import comments from \"@eslint-community/eslint-plugin-eslint-comments/configs\";`,\n\t\t!options.excludeTests && `import vitest from \"@vitest/eslint-plugin\";`,\n\t\t!options.excludeLintJSDoc && `import jsdoc from \"eslint-plugin-jsdoc\";`,\n\t\t!options.excludeLintJson && `import jsonc from \"eslint-plugin-jsonc\";`,\n\t\t!options.excludeLintMd && `import markdown from \"eslint-plugin-markdown\";`,\n\t\t`import n from \"eslint-plugin-n\";`,\n\t\t!options.excludeLintPackageJson &&\n\t\t\t`import packageJson from \"eslint-plugin-package-json/configs/recommended\";`,\n\t\t!options.excludeLintPerfectionist &&\n\t\t\t`import perfectionist from \"eslint-plugin-perfectionist\";`,\n\t\t!options.excludeLintRegex &&\n\t\t\t`import * as regexp from \"eslint-plugin-regexp\";`,\n\t\t!options.excludeLintYml && `import yml from \"eslint-plugin-yml\";`,\n\t\t`import tseslint from \"typescript-eslint\";`,\n\t].filter(Boolean);\n\n\tconst elements = [\n\t\t`eslint.configs.recommended,`,\n\t\t!options.excludeLintJson &&\n\t\t\t`\t...jsonc.configs[\"flat/recommended-with-json\"],`,\n\t\t!options.excludeLintMd && `\t...markdown.configs.recommended,`,\n\t\t!options.excludeLintYml && `\t...yml.configs[\"flat/recommended\"],`,\n\t\t!options.excludeLintYml && `\t...yml.configs[\"flat/prettier\"],`,\n\t\t!options.excludeLintESLint && `\tcomments.recommended,`,\n\t\t!options.excludeLintJSDoc &&\n\t\t\t`\tjsdoc.configs[\"flat/contents-typescript-error\"],\n\tjsdoc.configs[\"flat/logical-typescript-error\"],\n\tjsdoc.configs[\"flat/stylistic-typescript-error\"],`,\n\t\t`\tn.configs[\"flat/recommended\"],`,\n\t\t!options.excludeLintPackageJson && `\tpackageJson,`,\n\t\t!options.excludeLintPerfectionist &&\n\t\t\t`\tperfectionist.configs[\"recommended-natural\"],`,\n\t\t!options.excludeLintRegex && `\tregexp.configs[\"flat/recommended\"],`,\n\t].filter(Boolean);\n\n\treturn await formatTypeScript(`${imports.join(\"\\n\")}\n\nexport default tseslint.config(\n\t{\n\t\tignores: [${\n\t\t\toptions.excludeTests\n\t\t\t\t? \"\"\n\t\t\t\t: `\n\t\t\t\"coverage*\",`\n\t\t}\n\t\t\t\"lib\",\n\t\t\t\"node_modules\",\n\t\t\t\"pnpm-lock.yaml\",\n\t\t\t\"**/*.snap\",\n\t\t],\n\t},\n\t{\n\t\tlinterOptions: {\n\t\t\treportUnusedDisableDirectives: \"error\",\n\t\t},\n\t},\n\t${elements.join(\"\\n\")}\n\t...tseslint.config({\n\t\textends: ${\n\t\t\toptions.excludeLintStylistic\n\t\t\t\t? `tseslint.configs.${tseslintBase}TypeChecked`\n\t\t\t\t: `[\n\t\t\t...tseslint.configs.${tseslintBase}TypeChecked,\n\t\t\t...tseslint.configs.stylisticTypeChecked,\n\t\t]`\n\t\t},\n\t\tfiles: [\"**/*.js\", \"**/*.ts\"],\n\t\tlanguageOptions: {\n\t\t\tparserOptions: {\n\t\t\t\tprojectService: {\n\t\t\t\t\tallowDefaultProject: [\"*.*s\", \"eslint.config.js\"],\n\t\t\t\t\tdefaultProject: \"./tsconfig.json\",\n\t\t\t\t},\n\t\t\t\ttsconfigRootDir: import.meta.dirname\n\t\t\t},\n\t\t},\n\t\trules: {\n\t\t\t${\n\t\t\t\t!options.excludeLintJSDoc || !options.excludeLintStylistic\n\t\t\t\t\t? \"// These off-by-default rules work well for this repo and we like them on.\"\n\t\t\t\t\t: \"\"\n\t\t\t}${\n\t\t\t\toptions.excludeLintStylistic\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"logical-assignment-operators\": [\n\t\t\t\t\"error\",\n\t\t\t\t\"always\",\n\t\t\t\t{ enforceForIfStatements: true },\n\t\t\t],\n\t\t\t\"operator-assignment\": \"error\",`\n\t\t\t}\n\n\t\t\t// These on-by-default rules don't work well for this repo and we like them off.${\n\t\t\t\toptions.excludeLintJSDoc\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"jsdoc/lines-before-block\": \"off\",`\n\t\t\t}\n\t\t\t\"no-constant-condition\": \"off\",\n\n\t\t\t// These on-by-default rules work well for this repo if configured\n\t\t\t\"@typescript-eslint/no-unused-vars\": [\"error\", { caughtErrors: \"all\" }],${\n\t\t\t\toptions.excludeLintPerfectionist\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"n/no-unsupported-features/node-builtins\": [\n\t\t\t\t\"error\",\n\t\t\t\t{ allowExperimental: true },\n\t\t\t],\n\t\t\t\"perfectionist/sort-objects\": [\n\t\t\t\t\"error\",\n\t\t\t\t{\n\t\t\t\t\torder: \"asc\",\n\t\t\t\t\tpartitionByComment: true,\n\t\t\t\t\ttype: \"natural\",\n\t\t\t\t},\n\t\t\t],`\n\t\t\t}${\n\t\t\t\toptions.excludeLintStylistic\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\n\t\t\t// Stylistic concerns that don't interfere with Prettier\n\t\t\t\"no-useless-rename\": \"error\",\n\t\t\t\"object-shorthand\": \"error\",`\n\t\t\t}\n\t\t},\n\t}),\n\t{\n\t\tfiles: [\"*.jsonc\"],\n\t\trules: {\n\t\t\t\"jsonc/comma-dangle\": \"off\",\n\t\t\t\"jsonc/no-comments\": \"off\",\n\t\t\t\"jsonc/sort-keys\": \"error\",\n\t\t},\n\t},\n\t{\n\t\textends: [tseslint.configs.disableTypeChecked],\n\t\tfiles: [\"**/*.md/*.ts\"],\n\t\trules: {\n\t\t\t\"n/no-missing-import\": [\n\t\t\t\t\"error\",\n\t\t\t\t{ allowModules: [\"${options.repository}\"] },\n\t\t\t],\n\t\t},\n\t},${\n\t\toptions.excludeTests\n\t\t\t? \"\"\n\t\t\t: `\n\t{\n\t\tfiles: [\"**/*.test.*\"],\n\t\tlanguageOptions: {\n\t\t\tglobals: vitest.environments.env.globals,\n\t\t},\n\t\tplugins: { vitest, },\n\t\trules: {\n\t\t\t...vitest.configs.recommended.rules,\n\n\t\t\t// These on-by-default rules aren't useful in test files.\n\t\t\t\"@typescript-eslint/no-unsafe-assignment\": \"off\",\n\t\t\t\"@typescript-eslint/no-unsafe-call\": \"off\",\n\t\t},\n\t},`\n\t}${\n\t\toptions.excludeLintYml\n\t\t\t? \"\"\n\t\t\t: `\n\t{\n\t\tfiles: [\"**/*.{yml,yaml}\"],\n\t\trules: {\n\t\t\t\"yml/file-extension\": [\"error\", { extension: \"yml\" }],\n\t\t\t\"yml/sort-keys\": [\n\t\t\t\t\"error\",\n\t\t\t\t{\n\t\t\t\t\torder: { type: \"asc\" },\n\t\t\t\t\tpathPattern: \"^.*$\",\n\t\t\t\t},\n\t\t\t],\n\t\t\t\"yml/sort-sequence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I,CAAC;AAAA;AAAA,aAGnB,QAAQ,uBACL,oBAAoB,YAAY,gBAChC;AAAA,yBACmB,YAAY;AAAA;AAAA,IAGnC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAaE,CAAC,QAAQ,oBAAoB,CAAC,QAAQ,uBACnC,+EACA,EACJ,GACC,QAAQ,uBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mCAOJ;AAAA;AAAA,qFAGC,QAAQ,mBACL,KACA;AAAA,sCAEJ;AAAA;AAAA;AAAA;AAAA,6EAKC,QAAQ,2BACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAaJ,GACC,QAAQ,uBACL,KACA;AAAA;AAAA;AAAA;AAAA,gCAKJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAiBqB,QAAQ,UAAU;AAAA;AAAA;AAAA,KAIxC,QAAQ,eACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAeJ,GACC,QAAQ,iBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAqBJ;AAAA;AAAA,CAEA;AACD;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-typescript-app",
3
- "version": "1.68.0",
3
+ "version": "1.69.0",
4
4
  "description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 💝",
5
5
  "repository": {
6
6
  "type": "git",
@@ -72,6 +72,7 @@
72
72
  "@types/node": "^22.1.0",
73
73
  "@types/parse-author": "^2.0.3",
74
74
  "@vitest/coverage-v8": "^2.0.5",
75
+ "@vitest/eslint-plugin": "^1.0.1",
75
76
  "c8": "^10.1.2",
76
77
  "console-fail-test": "^0.4.4",
77
78
  "cspell": "^8.13.1",
@@ -83,7 +84,6 @@
83
84
  "eslint-plugin-package-json": "^0.15.2",
84
85
  "eslint-plugin-perfectionist": "^3.1.3",
85
86
  "eslint-plugin-regexp": "^2.6.0",
86
- "eslint-plugin-vitest": "^0.5.4",
87
87
  "eslint-plugin-yml": "^1.14.0",
88
88
  "globby": "^14.0.2",
89
89
  "husky": "^9.1.4",