create-typescript-app 1.74.1 → 1.75.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.
|
@@ -30,12 +30,7 @@ async function createESLintConfig(options) {
|
|
|
30
30
|
!options.excludeLintPerfectionist && ` perfectionist.configs["recommended-natural"],`,
|
|
31
31
|
!options.excludeLintRegex && ` regexp.configs["flat/recommended"],`
|
|
32
32
|
].filter(Boolean);
|
|
33
|
-
const rules = `{
|
|
34
|
-
${options.excludeLintJSDoc ? "" : `
|
|
35
|
-
|
|
36
|
-
// These on-by-default rules don't work well for this repo and we like them off.
|
|
37
|
-
"jsdoc/lines-before-block": "off",`}${options.excludeLintStylistic ? "" : `
|
|
38
|
-
|
|
33
|
+
const rules = !options.excludeLintStylistic && `{
|
|
39
34
|
// Stylistic concerns that don't interfere with Prettier
|
|
40
35
|
"logical-assignment-operators": [
|
|
41
36
|
"error",
|
|
@@ -44,7 +39,7 @@ async function createESLintConfig(options) {
|
|
|
44
39
|
],
|
|
45
40
|
"no-useless-rename": "error",
|
|
46
41
|
"object-shorthand": "error",
|
|
47
|
-
"operator-assignment": "error"
|
|
42
|
+
"operator-assignment": "error",
|
|
48
43
|
}`;
|
|
49
44
|
return await formatTypeScript(`${imports.join("\n")}
|
|
50
45
|
|
|
@@ -77,8 +72,8 @@ export default tseslint.config(
|
|
|
77
72
|
},
|
|
78
73
|
tsconfigRootDir: import.meta.dirname
|
|
79
74
|
},
|
|
80
|
-
},${rules
|
|
81
|
-
rules: ${rules},`}${options.excludeLintPerfectionist ? "" : `
|
|
75
|
+
},${rules ? `
|
|
76
|
+
rules: ${rules},` : ""}${options.excludeLintPerfectionist ? "" : `
|
|
82
77
|
settings: {
|
|
83
78
|
perfectionist: {
|
|
84
79
|
partitionByComment: true,
|
|
@@ -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.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\tconst rules
|
|
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\tconst rules =\n\t\t!options.excludeLintStylistic &&\n\t\t`{\n\t\t\t// Stylistic concerns that don't interfere with Prettier\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\"no-useless-rename\": \"error\",\n\t\t\t\"object-shorthand\": \"error\",\n\t\t\t\"operator-assignment\": \"error\",\n\t\t}`;\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\toptions.excludeTests\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\t\"**/*.snap\",`\n\t\t\t}\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{\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: [\"*.config.*s\"],\n\t\t\t\t},\n\t\t\t\ttsconfigRootDir: import.meta.dirname\n\t\t\t},\n\t\t},${\n\t\t\trules\n\t\t\t\t? `\n\t\trules: ${rules},`\n\t\t\t\t: \"\"\n\t\t}${\n\t\t\toptions.excludeLintPerfectionist\n\t\t\t\t? \"\"\n\t\t\t\t: `\n\t\tsettings: {\n\t\t\tperfectionist: {\n\t\t\t\tpartitionByComment: true,\n\t\t\t\ttype: \"natural\",\n\t\t\t},\n\t\t},`\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\textends: [vitest.configs.recommended],\n\t\trules: {\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\"y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AA,gBAEJ;AAAA;AAAA;AAAA,sBAIE,QAAQ,eACL,KACA;AAAA,iBAEJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQA,SAAS,KAAK,IAAI,CAAC;AAAA;AAAA,aAGnB,QAAQ,uBACL,oBAAoB,YAAY,gBAChC;AAAA,yBACmB,YAAY;AAAA;AAAA,IAGnC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAUC,QACG;AAAA,WACK,KAAK,MACV,EACJ,GACC,QAAQ,2BACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAOJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAQsB,QAAQ,UAAU;AAAA;AAAA;AAAA,KAIxC,QAAQ,eACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAUJ,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.
|
|
3
|
+
"version": "1.75.0",
|
|
4
4
|
"description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 💝",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"console-fail-test": "^0.5.0",
|
|
78
78
|
"cspell": "^8.14.2",
|
|
79
79
|
"eslint": "^9.9.0",
|
|
80
|
-
"eslint-plugin-jsdoc": "^50.
|
|
80
|
+
"eslint-plugin-jsdoc": "^50.6.0",
|
|
81
81
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
82
82
|
"eslint-plugin-markdown": "^5.1.0",
|
|
83
83
|
"eslint-plugin-n": "^17.12.0",
|