@zayne-labs/eslint-config 0.10.2 → 0.10.3
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/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +16 -20
- package/dist/index.js +85 -72
- package/dist/index.js.map +1 -1
- package/dist/{src-DwSufEpw.js → src-ZlDTU7nv.js} +24 -16
- package/dist/{src-DwSufEpw.js.map → src-ZlDTU7nv.js.map} +1 -1
- package/package.json +11 -11
package/dist/cli/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { };
|
package/dist/cli/index.js
CHANGED
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["frameworkOptions: Array<PromItem<FrameworkOptionUnion>>","frameworks: FrameworkOptionUnion[]","extraOptions: Array<PromItem<ExtraLibrariesOptionUnion>>","eslintIgnores: string[]","configLines: string[]","eslintConfigContent: string","addedPackages: string[]","dotVscodePath: string","settingsPath: string","result: PromptResult"],"sources":["../../package.json","../../src/cli/constants.ts","../../src/cli/utils.ts","../../src/cli/stages/update-eslint-files.ts","../../src/cli/constants-generated.ts","../../src/cli/stages/update-package-json.ts","../../src/cli/stages/update-vscode-settings.ts","../../src/cli/run.ts","../../src/cli/index.ts"],"sourcesContent":["{\n\t\"name\": \"@zayne-labs/eslint-config\",\n\t\"type\": \"module\",\n\t\"version\": \"0.10.2\",\n\t\"description\": \"Zayne Labs' ESLint config preset\",\n\t\"author\": \"Ryan Zayne\",\n\t\"license\": \"MIT\",\n\t\"homepage\": \"https://github.com/zayne-labs/config#readme\",\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"git+https://github.com/zayne-labs/config.git\"\n\t},\n\t\"bugs\": {\n\t\t\"url\": \"https://github.com/zayne-labs/config/issues\"\n\t},\n\t\"keywords\": [],\n\t\"sideEffects\": false,\n\t\"exports\": {\n\t\t\".\": \"./dist/index.js\"\n\t},\n\t\"bin\": \"./bin/index.js\",\n\t\"files\": [\n\t\t\"bin\",\n\t\t\"dist\"\n\t],\n\t\"engines\": {\n\t\t\"node\": \">=20.x\"\n\t},\n\t\"scripts\": {\n\t\t\"build\": \"pnpm typegen && tsdown\",\n\t\t\"build:dev\": \"pnpm typegen && cross-env NODE_ENV=development tsdown\",\n\t\t\"dev\": \"pnpm build:dev --watch\",\n\t\t\"lint:attw\": \"attw --pack . --ignore-rules=cjs-resolves-to-esm\",\n\t\t\"lint:eslint\": \"eslint . --max-warnings 0\",\n\t\t\"lint:format\": \"prettier --write .\",\n\t\t\"lint:packages\": \"pnpm dedupe --check\",\n\t\t\"lint:publint\": \"publint --strict .\",\n\t\t\"lint:type-check\": \"pnpm typegen && tsc --pretty -p tsconfig.json\",\n\t\t\"release\": \"pnpm publish --no-git-checks\",\n\t\t\"release:test\": \"pnpx pkg-pr-new publish\",\n\t\t\"typegen\": \"tsx scripts/typegen.ts\",\n\t\t\"version-package\": \"changeset version\"\n\t},\n\t\"peerDependencies\": {\n\t\t\"@eslint-react/eslint-plugin\": \"2.x.x\",\n\t\t\"@next/eslint-plugin-next\": \"15.x.x\",\n\t\t\"@tanstack/eslint-plugin-query\": \"5.x.x\",\n\t\t\"@tanstack/eslint-plugin-router\": \"1.x.x\",\n\t\t\"astro-eslint-parser\": \"1.x.x\",\n\t\t\"eslint\": \"9.x.x\",\n\t\t\"eslint-config-expo\": \"10.x.x\",\n\t\t\"eslint-plugin-astro\": \"1.x.x\",\n\t\t\"eslint-plugin-better-tailwindcss\": \"3.x.x\",\n\t\t\"eslint-plugin-depend\": \"1.x.x\",\n\t\t\"eslint-plugin-pnpm\": \"1.x.x\",\n\t\t\"eslint-plugin-react-hooks\": \"5.x.x\",\n\t\t\"eslint-plugin-react-refresh\": \"0.x.x\",\n\t\t\"eslint-plugin-solid\": \"0.x.x\",\n\t\t\"eslint-plugin-svelte\": \"3.x.x\",\n\t\t\"eslint-plugin-vue\": \"10.x.x\",\n\t\t\"eslint-processor-vue-blocks\": \"2.x.x\",\n\t\t\"vue-eslint-parser\": \"10.x.x\"\n\t},\n\t\"peerDependenciesMeta\": {\n\t\t\"@eslint-react/eslint-plugin\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"@next/eslint-plugin-next\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"@tanstack/eslint-plugin-query\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"@tanstack/eslint-plugin-router\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"astro-eslint-parser\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-config-expo\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-plugin-astro\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-plugin-better-tailwindcss\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-plugin-depend\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-plugin-pnpm\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-plugin-react-hooks\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-plugin-react-refresh\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-plugin-react-you-might-not-need-an-effect\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-plugin-solid\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-plugin-svelte\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-plugin-vue\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-processor-vue-blocks\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"vue-eslint-parser\": {\n\t\t\t\"optional\": true\n\t\t}\n\t},\n\t\"dependencies\": {\n\t\t\"@antfu/install-pkg\": \"1.1.0\",\n\t\t\"@clack/prompts\": \"0.11.0\",\n\t\t\"@eslint-community/eslint-plugin-eslint-comments\": \"4.5.0\",\n\t\t\"@eslint/compat\": \"1.4.0\",\n\t\t\"@eslint/js\": \"9.36.0\",\n\t\t\"@stylistic/eslint-plugin\": \"5.4.0\",\n\t\t\"@zayne-labs/toolkit-type-helpers\": \"0.11.16\",\n\t\t\"ansis\": \"4.1.0\",\n\t\t\"cac\": \"6.7.14\",\n\t\t\"eslint-config-flat-gitignore\": \"2.1.0\",\n\t\t\"eslint-flat-config-utils\": \"2.1.4\",\n\t\t\"eslint-import-resolver-typescript\": \"4.4.4\",\n\t\t\"eslint-merge-processors\": \"2.0.0\",\n\t\t\"eslint-plugin-import-x\": \"4.16.1\",\n\t\t\"eslint-plugin-jsdoc\": \"60.4.0\",\n\t\t\"eslint-plugin-jsonc\": \"2.20.1\",\n\t\t\"eslint-plugin-n\": \"17.23.1\",\n\t\t\"eslint-plugin-perfectionist\": \"4.15.0\",\n\t\t\"eslint-plugin-security\": \"3.0.1\",\n\t\t\"eslint-plugin-toml\": \"^0.12.0\",\n\t\t\"eslint-plugin-unicorn\": \"61.0.2\",\n\t\t\"eslint-plugin-yml\": \"^1.17.0\",\n\t\t\"globals\": \"16.4.0\",\n\t\t\"jsonc-eslint-parser\": \"2.4.1\",\n\t\t\"local-pkg\": \"1.1.2\",\n\t\t\"parse-gitignore\": \"2.0.0\",\n\t\t\"toml-eslint-parser\": \"0.10.0\",\n\t\t\"typescript-eslint\": \"8.44.1\",\n\t\t\"yaml-eslint-parser\": \"1.3.0\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@arethetypeswrong/cli\": \"0.18.2\",\n\t\t\"@changesets/cli\": \"2.29.7\",\n\t\t\"@eslint-react/eslint-plugin\": \"2.0.0\",\n\t\t\"@next/eslint-plugin-next\": \"15.5.4\",\n\t\t\"@tanstack/eslint-plugin-query\": \"5.90.1\",\n\t\t\"@tanstack/eslint-plugin-router\": \"1.132.0\",\n\t\t\"@total-typescript/ts-reset\": \"0.6.1\",\n\t\t\"@types/eslint-plugin-security\": \"3.0.0\",\n\t\t\"@types/node\": \"24.5.2\",\n\t\t\"@zayne-labs/tsconfig\": \"workspace:*\",\n\t\t\"astro-eslint-parser\": \"1.2.2\",\n\t\t\"concurrently\": \"9.2.1\",\n\t\t\"cross-env\": \"10.0.0\",\n\t\t\"eslint\": \"9.36.0\",\n\t\t\"eslint-config-expo\": \"^10.0.0\",\n\t\t\"eslint-plugin-astro\": \"1.3.1\",\n\t\t\"eslint-plugin-better-tailwindcss\": \"3.7.9\",\n\t\t\"eslint-plugin-depend\": \"1.3.1\",\n\t\t\"eslint-plugin-pnpm\": \"1.1.2\",\n\t\t\"eslint-plugin-react-hooks\": \"5.2.0\",\n\t\t\"eslint-plugin-react-refresh\": \"0.4.22\",\n\t\t\"eslint-plugin-react-you-might-not-need-an-effect\": \"0.5.3\",\n\t\t\"eslint-plugin-solid\": \"0.14.5\",\n\t\t\"eslint-plugin-svelte\": \"3.12.4\",\n\t\t\"eslint-plugin-vue\": \"10.5.0\",\n\t\t\"eslint-processor-vue-blocks\": \"2.0.0\",\n\t\t\"eslint-typegen\": \"2.3.0\",\n\t\t\"husky\": \"9.1.7\",\n\t\t\"lint-staged\": \"16.2.1\",\n\t\t\"pkg-pr-new\": \"0.0.60\",\n\t\t\"prettier\": \"3.6.2\",\n\t\t\"publint\": \"0.3.13\",\n\t\t\"tailwindcss\": \"^4.1.13\",\n\t\t\"tsdown\": \"^0.14.2\",\n\t\t\"tsx\": \"4.20.6\",\n\t\t\"typescript\": \"5.9.2\",\n\t\t\"vue-eslint-parser\": \"10.2.0\"\n\t},\n\t\"publishConfig\": {\n\t\t\"access\": \"public\",\n\t\t\"registry\": \"https://registry.npmjs.org/\",\n\t\t\"provenance\": true\n\t}\n}\n","import { defineEnumDeep } from \"@zayne-labs/toolkit-type-helpers\";\nimport c from \"ansis\";\nimport type { ExtraLibrariesOptionUnion, FrameworkOptionUnion, PromItem } from \"./types\";\n\nexport const vscodeSettingsString = `\n // Auto fix\n // \"editor.codeActionsOnSave\": {\n // \"source.fixAll.eslint\": \"explicit\",\n // },\n\n // Enable eslint for all supported languages\n \"eslint.validate\": [\n \"javascript\",\n \"javascriptreact\",\n \"typescript\",\n \"typescriptreact\",\n \"vue\",\n \"html\",\n \"markdown\",\n \"json\",\n \"json5\",\n \"jsonc\",\n \"yaml\",\n \"toml\",\n \"xml\",\n \"gql\",\n \"graphql\",\n \"astro\",\n \"svelte\",\n \"css\",\n \"less\",\n \"scss\",\n \"postcss\"\n ]\n`;\n\nexport const frameworkOptions: Array<PromItem<FrameworkOptionUnion>> = [\n\t{\n\t\tlabel: c.green(\"Vue\"),\n\t\tvalue: \"vue\",\n\t},\n\t{\n\t\tlabel: c.cyan(\"React\"),\n\t\tvalue: \"react\",\n\t},\n\t{\n\t\tlabel: c.red(\"Svelte\"),\n\t\tvalue: \"svelte\",\n\t},\n\t{\n\t\tlabel: c.magenta(\"Astro\"),\n\t\tvalue: \"astro\",\n\t},\n\t{\n\t\tlabel: c.cyan(\"Solid\"),\n\t\tvalue: \"solid\",\n\t},\n];\n\nexport const frameworks: FrameworkOptionUnion[] = frameworkOptions.map(({ value }) => value);\n\nexport const extraOptions: Array<PromItem<ExtraLibrariesOptionUnion>> = [\n\t{\n\t\tlabel: c.cyan(\"TailwindCSS (Better)\"),\n\t\tvalue: \"tailwindcssBetter\",\n\t},\n];\n\nexport const extra = extraOptions.map(({ value }) => value);\n\nexport const dependenciesMap = defineEnumDeep({\n\tastro: [\"eslint-plugin-astro\", \"astro-eslint-parser\"],\n\treact: [\"@eslint-react/eslint-plugin\", \"eslint-plugin-react-hooks\", \"eslint-plugin-react-refresh\"],\n\tsolid: [\"eslint-plugin-solid\"],\n\tsvelte: [\"eslint-plugin-svelte\", \"svelte-eslint-parser\"],\n\ttailwindcssBetter: [\"eslint-plugin-better-tailwindcss\"],\n\tvue: [\"eslint-plugin-vue\", \"eslint-processor-vue-blocks\", \"vue-eslint-parser\"],\n}) satisfies Record<ExtraLibrariesOptionUnion | FrameworkOptionUnion, string[]>;\n","import { execSync } from \"node:child_process\";\n\nexport function isGitClean(): boolean {\n\ttry {\n\t\texecSync(\"git diff-index --quiet HEAD --\");\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport function getEslintConfigContent(mainConfig: string, additionalConfigs?: string[]): string {\n\tconst additionalConfigsStr = additionalConfigs?.map((config) => `,{\\n${config}\\n}`);\n\n\treturn `\nimport { zayne } from '@zayne-labs/eslint-config'\n\nexport default zayne({\n${mainConfig}\n}${additionalConfigsStr})\n`.trimStart();\n}\n","/* eslint-disable max-depth -- Allow */\nimport fs from \"node:fs\";\nimport fsp from \"node:fs/promises\";\nimport path from \"node:path\";\nimport process from \"node:process\";\nimport * as p from \"@clack/prompts\";\nimport c from \"ansis\";\n// @ts-expect-error missing types\nimport parse from \"parse-gitignore\";\nimport type { PromptResult } from \"../types\";\nimport { getEslintConfigContent } from \"../utils\";\n\nexport async function updateEslintFiles(result: PromptResult): Promise<void> {\n\tconst cwd = process.cwd();\n\tconst pathESLintIgnore = path.join(cwd, \".eslintignore\");\n\tconst pathPackageJSON = path.join(cwd, \"package.json\");\n\n\tconst pkgContent = await fsp.readFile(pathPackageJSON, \"utf8\");\n\tconst pkg = JSON.parse(pkgContent) as Record<string, unknown>;\n\n\tconst configFileName = pkg.type === \"module\" ? \"eslint.config.js\" : \"eslint.config.mjs\";\n\tconst pathFlatConfig = path.join(cwd, configFileName);\n\n\tconst eslintIgnores: string[] = [];\n\n\tif (fs.existsSync(pathESLintIgnore)) {\n\t\tp.log.step(c.cyan`Migrating existing .eslintignore`);\n\n\t\tconst content = await fsp.readFile(pathESLintIgnore, \"utf8\");\n\t\tconst parsed = parse(content);\n\t\tconst globs = parsed.globs();\n\n\t\tfor (const glob of globs) {\n\t\t\tif (glob.type === \"ignore\") {\n\t\t\t\teslintIgnores.push(...(glob.patterns as string[]));\n\t\t\t}\n\n\t\t\tif (glob.type === \"unignore\") {\n\t\t\t\teslintIgnores.push(...(glob.patterns.map((pattern: string) => `!${pattern}`) as string[]));\n\t\t\t}\n\t\t}\n\t}\n\n\tconst configLines: string[] = [];\n\n\tif (eslintIgnores.length > 0) {\n\t\tconfigLines.push(`ignores: ${JSON.stringify(eslintIgnores)},`);\n\t}\n\n\tif (result.extra.includes(\"tailwindcssBetter\")) {\n\t\tconfigLines.push(`tailwindcssBetter: true,`);\n\t}\n\n\tfor (const framework of result.frameworks) {\n\t\tconfigLines.push(`${framework}: true,`);\n\t}\n\n\tconst mainConfig = configLines.map((line) => ` ${line}`).join(\"\\n\");\n\n\tconst additionalConfig: string[] = [];\n\n\tconst eslintConfigContent: string = getEslintConfigContent(mainConfig, additionalConfig);\n\n\tawait fsp.writeFile(pathFlatConfig, eslintConfigContent);\n\n\tp.log.success(c.green`Created ${configFileName}`);\n}\n","export const versionsMap = {\n\t\"@eslint-react/eslint-plugin\": \"^1.38.4\",\n\t\"astro-eslint-parser\": \"^1.2.2\",\n\teslint: \"^9.24.0\",\n\t\"eslint-plugin-astro\": \"^1.3.1\",\n\t\"eslint-plugin-better-tailwindcss\": \"^3.7.6\",\n\t\"eslint-plugin-react-hooks\": \"^5.2.0\",\n\t\"eslint-plugin-react-refresh\": \"^0.4.19\",\n\t\"eslint-plugin-solid\": \"^0.14.5\",\n\t\"eslint-plugin-svelte\": \"^3.3.3\",\n\t\"svelte-eslint-parser\": \"^1.1.0\",\n};\n","import fsp from \"node:fs/promises\";\nimport path from \"node:path\";\nimport process from \"node:process\";\nimport * as p from \"@clack/prompts\";\nimport c from \"ansis\";\nimport { version } from \"../../../package.json\";\nimport { dependenciesMap } from \"../constants\";\nimport { versionsMap } from \"../constants-generated\";\nimport type { PromptResult } from \"../types\";\n\nexport async function updatePackageJson(result: PromptResult): Promise<void> {\n\tconst cwd = process.cwd();\n\n\tconst pathPackageJSON = path.join(cwd, \"package.json\");\n\n\tp.log.step(c.cyan`Bumping @zayne-labs/eslint-config to v${version}`);\n\n\tconst pkgContent = await fsp.readFile(pathPackageJSON, \"utf8\");\n\tconst pkg = JSON.parse(pkgContent) as Record<string, Record<string, string | undefined> | undefined>;\n\n\tpkg.devDependencies ??= {};\n\tpkg.devDependencies[\"@zayne-labs/eslint-config\"] = `^${version}`;\n\tpkg.devDependencies.eslint ??= versionsMap.eslint;\n\n\tconst addedPackages: string[] = [];\n\n\tfor (const item of result.extra) {\n\t\tswitch (item) {\n\t\t\t// eslint-disable-next-line ts-eslint/no-unnecessary-condition -- Ignore for now\n\t\t\tcase \"tailwindcssBetter\": {\n\t\t\t\tdependenciesMap.tailwindcssBetter.forEach((f) => {\n\t\t\t\t\tpkg.devDependencies\n\t\t\t\t\t\t&& (pkg.devDependencies[f] = versionsMap[f as keyof typeof versionsMap]);\n\n\t\t\t\t\taddedPackages.push(f);\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdefault: {\n\t\t\t\titem satisfies never;\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (const framework of result.frameworks) {\n\t\tconst dependencies = dependenciesMap[framework];\n\n\t\t// eslint-disable-next-line ts-eslint/no-unnecessary-condition -- Allow\n\t\tif (!dependencies) continue;\n\n\t\tdependencies.forEach((dependency) => {\n\t\t\tif (!pkg.devDependencies) return;\n\n\t\t\tpkg.devDependencies[dependency] = versionsMap[dependency as keyof typeof versionsMap];\n\t\t\taddedPackages.push(dependency);\n\t\t});\n\t}\n\n\tif (addedPackages.length > 0) {\n\t\tp.note(c.dim(addedPackages.join(\", \")), \"Added packages\");\n\t}\n\n\tawait fsp.writeFile(pathPackageJSON, JSON.stringify(pkg, null, 2));\n\n\tp.log.success(c.green`Changes wrote to package.json`);\n}\n","import fs from \"node:fs\";\nimport fsp from \"node:fs/promises\";\nimport path from \"node:path\";\nimport process from \"node:process\";\nimport * as p from \"@clack/prompts\";\nimport { green } from \"ansis\";\nimport { vscodeSettingsString } from \"../constants\";\nimport type { PromptResult } from \"../types\";\n\nexport async function updateVscodeSettings(result: PromptResult): Promise<void> {\n\tconst cwd = process.cwd();\n\n\tif (!result.updateVscodeSettings) return;\n\n\tconst dotVscodePath: string = path.join(cwd, \".vscode\");\n\tconst settingsPath: string = path.join(dotVscodePath, \"settings.json\");\n\n\tif (!fs.existsSync(dotVscodePath)) await fsp.mkdir(dotVscodePath, { recursive: true });\n\n\tif (!fs.existsSync(settingsPath)) {\n\t\tawait fsp.writeFile(settingsPath, `{${vscodeSettingsString}}\\n`, \"utf8\");\n\t\tp.log.success(green`Created .vscode/settings.json`);\n\t} else {\n\t\tlet settingsContent = await fsp.readFile(settingsPath, \"utf8\");\n\n\t\tsettingsContent = settingsContent.trim().replace(/\\s*\\}$/, \"\");\n\t\tsettingsContent += settingsContent.endsWith(\",\") || settingsContent.endsWith(\"{\") ? \"\" : \",\";\n\t\tsettingsContent += `${vscodeSettingsString}}\\n`;\n\n\t\tawait fsp.writeFile(settingsPath, settingsContent, \"utf8\");\n\t\tp.log.success(green`Updated .vscode/settings.json`);\n\t}\n}\n","/* eslint-disable perfectionist/sort-objects -- Ignore */\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport process from \"node:process\";\nimport * as p from \"@clack/prompts\";\nimport c from \"ansis\";\nimport { extra, extraOptions, frameworkOptions, frameworks } from \"./constants\";\nimport { updateEslintFiles } from \"./stages/update-eslint-files\";\nimport { updatePackageJson } from \"./stages/update-package-json\";\nimport { updateVscodeSettings } from \"./stages/update-vscode-settings\";\nimport type { ExtraLibrariesOptionUnion, FrameworkOptionUnion, PromptResult } from \"./types\";\nimport { isGitClean } from \"./utils\";\n\nexport type CliRunOptions = {\n\t/**\n\t * Use the extra utils: formatter / perfectionist / unocss\n\t */\n\textra?: string[];\n\t/**\n\t * Use the framework template for optimal customization: vue / react / svelte / astro\n\t */\n\tframeworks?: string[];\n\t/**\n\t * Skip prompts and use default values\n\t */\n\tyes?: boolean;\n};\n\nexport async function run(options: CliRunOptions = {}): Promise<void> {\n\tconst argSkipPrompt = Boolean(process.env.SKIP_PROMPT) || options.yes;\n\tconst argTemplate = options.frameworks?.map((m) => m.trim()).filter(Boolean);\n\tconst argExtra = options.extra?.map((m) => m.trim()).filter(Boolean);\n\n\tif (fs.existsSync(path.join(process.cwd(), \"eslint.config.js\"))) {\n\t\tp.log.warn(c.yellow`eslint.config.js already exists, migration wizard exited.`);\n\n\t\treturn process.exit(1);\n\t}\n\n\t// Set default value for promptResult if `argSkipPrompt` is enabled\n\tlet result: PromptResult = {\n\t\textra: (argExtra ?? []) as ExtraLibrariesOptionUnion[],\n\t\tframeworks: (argTemplate ?? []) as FrameworkOptionUnion[],\n\t\tuncommittedConfirmed: false,\n\t\tupdateVscodeSettings: true,\n\t};\n\n\tif (!argSkipPrompt) {\n\t\tresult = (await p.group(\n\t\t\t{\n\t\t\t\tuncommittedConfirmed: () => {\n\t\t\t\t\tif (isGitClean()) {\n\t\t\t\t\t\treturn Promise.resolve(true);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn p.confirm({\n\t\t\t\t\t\tinitialValue: false,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\"There are uncommitted changes in the current repository, are you sure to continue?\",\n\t\t\t\t\t});\n\t\t\t\t},\n\n\t\t\t\tframeworks: ({ results }) => {\n\t\t\t\t\tconst isArgTemplateValid =\n\t\t\t\t\t\t(argTemplate?.length ?? 0) > 0\n\t\t\t\t\t\t&& (argTemplate ?? []).filter((element) => !frameworks.includes(element)).length === 0;\n\n\t\t\t\t\tif (!results.uncommittedConfirmed || isArgTemplateValid) return;\n\n\t\t\t\t\tconst message =\n\t\t\t\t\t\targTemplate ?\n\t\t\t\t\t\t\t`\"${argTemplate}\" isn't a valid template. Please choose from below: `\n\t\t\t\t\t\t:\t\"Select a framework:\";\n\n\t\t\t\t\treturn p.multiselect<FrameworkOptionUnion>({\n\t\t\t\t\t\tmessage: c.reset(message),\n\t\t\t\t\t\toptions: frameworkOptions,\n\t\t\t\t\t\trequired: false,\n\t\t\t\t\t});\n\t\t\t\t},\n\n\t\t\t\textra: ({ results }) => {\n\t\t\t\t\tconst isArgExtraValid =\n\t\t\t\t\t\t(argExtra?.length ?? 0) > 0\n\t\t\t\t\t\t&& (argExtra ?? []).filter((element) => !extra.includes(element)).length === 0;\n\n\t\t\t\t\tif (!results.uncommittedConfirmed || isArgExtraValid) return;\n\n\t\t\t\t\tconst message =\n\t\t\t\t\t\targExtra ?\n\t\t\t\t\t\t\t`\"${argExtra}\" isn't a valid extra util. Please choose from below: `\n\t\t\t\t\t\t:\t\"Select an extra util:\";\n\n\t\t\t\t\treturn p.multiselect<ExtraLibrariesOptionUnion>({\n\t\t\t\t\t\tmessage: c.reset(message),\n\t\t\t\t\t\toptions: extraOptions,\n\t\t\t\t\t\trequired: false,\n\t\t\t\t\t});\n\t\t\t\t},\n\n\t\t\t\tupdateVscodeSettings: ({ results }) => {\n\t\t\t\t\tif (!results.uncommittedConfirmed) return;\n\n\t\t\t\t\treturn p.confirm({\n\t\t\t\t\t\tinitialValue: true,\n\t\t\t\t\t\tmessage: \"Update .vscode/settings.json for better VS Code experience?\",\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tonCancel: () => {\n\t\t\t\t\tp.cancel(\"Operation cancelled.\");\n\t\t\t\t\tprocess.exit(0);\n\t\t\t\t},\n\t\t\t}\n\t\t)) as PromptResult;\n\n\t\tif (!result.uncommittedConfirmed) {\n\t\t\treturn process.exit(1);\n\t\t}\n\t}\n\n\tawait updatePackageJson(result);\n\tawait updateEslintFiles(result);\n\tawait updateVscodeSettings(result);\n\n\tp.log.success(c.green`Setup completed`);\n\n\tp.outro(\n\t\t`Now you can update the dependencies by running ${c.blue(\"pnpm install\")} and also ${c.blue(\"eslint --fix\")}\\n`\n\t);\n}\n","import process from \"node:process\";\nimport * as p from \"@clack/prompts\";\nimport c from \"ansis\";\nimport { cac } from \"cac\";\nimport { version } from \"../../package.json\";\nimport { type CliRunOptions, run } from \"./run\";\n\nfunction header(): void {\n\tp.intro(`${c.green`@zayne-labs/eslint-config `}${c.dim`v${version}`}`);\n}\n\nconst cli = cac(\"@zayne-labs/eslint-config\");\n\ncli.command(\"\", \"Run the initialization or migration\")\n\t.option(\"--yes, -y\", \"Skip prompts and use default values\", { default: false })\n\t.option(\n\t\t\"--template, -t <template>\",\n\t\t\"Use the framework template for optimal customization: vue / react / svelte / astro\",\n\t\t{ type: [] }\n\t)\n\t.option(\"--extra, -e <extra>\", \"Use the extra utils: perfectionist / tailwindcss\", { type: [] })\n\t.action(async (options: CliRunOptions) => {\n\t\theader();\n\t\ttry {\n\t\t\tawait run(options);\n\t\t} catch (error) {\n\t\t\tp.log.error(c.inverse.red(\" Failed to migrate \"));\n\t\t\tp.log.error(c.red`✘ ${String(error)}`);\n\t\t\tprocess.exit(1);\n\t\t}\n\t});\n\ncli.help();\ncli.version(version);\ncli.parse();\n"],"mappings":";;;;;;;;;;;;cAGY;;;;ACCZ,MAAa,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCpC,MAAaA,mBAA0D;CACtE;EACC,OAAO,EAAE,MAAM,MAAM;EACrB,OAAO;EACP;CACD;EACC,OAAO,EAAE,KAAK,QAAQ;EACtB,OAAO;EACP;CACD;EACC,OAAO,EAAE,IAAI,SAAS;EACtB,OAAO;EACP;CACD;EACC,OAAO,EAAE,QAAQ,QAAQ;EACzB,OAAO;EACP;CACD;EACC,OAAO,EAAE,KAAK,QAAQ;EACtB,OAAO;EACP;CACD;AAED,MAAaC,aAAqC,iBAAiB,KAAK,EAAE,YAAY,MAAM;AAE5F,MAAaC,eAA2D,CACvE;CACC,OAAO,EAAE,KAAK,uBAAuB;CACrC,OAAO;CACP,CACD;AAED,MAAa,QAAQ,aAAa,KAAK,EAAE,YAAY,MAAM;AAE3D,MAAa,kBAAkB,eAAe;CAC7C,OAAO,CAAC,uBAAuB,sBAAsB;CACrD,OAAO;EAAC;EAA+B;EAA6B;EAA8B;CAClG,OAAO,CAAC,sBAAsB;CAC9B,QAAQ,CAAC,wBA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KAAK,EAAE;KAEhB,CACD;AAED,MAAI,CAAC,OAAO,qBACX,QAAO,QAAQ,KAAK,EAAE;;AAIxB,OAAM,kBAAkB,OAAO;AAC/B,OAAM,kBAAkB,OAAO;AAC/B,OAAM,qBAAqB,OAAO;AAElC,GAAE,IAAI,QAAQ,EAAE,KAAK,kBAAkB;AAEvC,GAAE,MACD,kDAAkD,EAAE,KAAK,eAAe,CAAC,YAAY,EAAE,KAAK,eAAe,CAAC,IAC5G;;;;;AC3HF,SAAS,SAAe;AACvB,GAAE,MAAM,GAAG,EAAE,KAAK,+BAA+B,EAAE,GAAG,IAAI,YAAY;;AAGvE,MAAM,MAAM,IAAI,4BAA4B;AAE5C,IAAI,QAAQ,IAAI,sCAAsC,CACpD,OAAO,aAAa,uCAAuC,EAAE,SAAS,OAAO,CAAC,CAC9E,OACA,6BACA,sFACA,EAAE,MAAM,EAAE,EAAE,CACZ,CACA,OAAO,uBAAuB,oDAAoD,EAAE,MAAM,EAAE,EAAE,CAAC,CAC/F,OAAO,OAAO,YAA2B;AACzC,SAAQ;AACR,KAAI;AACH,QAAM,IAAI,QAAQ;UACV,OAAO;AACf,IAAE,IAAI,MAAM,EAAE,QAAQ,IAAI,sBAAsB,CAAC;AACjD,IAAE,IAAI,MAAM,EAAE,GAAG,KAAK,OAAO,MAAM,GAAG;AACtC,UAAQ,KAAK,EAAE;;EAEf;AAEH,IAAI,MAAM;AACV,IAAI,QAAQ,QAAQ;AACpB,IAAI,OAAO"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["frameworkOptions: Array<PromItem<FrameworkOptionUnion>>","frameworks: FrameworkOptionUnion[]","extraOptions: Array<PromItem<ExtraLibrariesOptionUnion>>","eslintIgnores: string[]","configLines: string[]","eslintConfigContent: string","addedPackages: string[]","dotVscodePath: string","settingsPath: string","result: PromptResult"],"sources":["../../package.json","../../src/cli/constants.ts","../../src/cli/utils.ts","../../src/cli/stages/update-eslint-files.ts","../../src/cli/constants-generated.ts","../../src/cli/stages/update-package-json.ts","../../src/cli/stages/update-vscode-settings.ts","../../src/cli/run.ts","../../src/cli/index.ts"],"sourcesContent":["{\n\t\"name\": \"@zayne-labs/eslint-config\",\n\t\"type\": \"module\",\n\t\"version\": \"0.10.3\",\n\t\"description\": \"Zayne Labs' ESLint config preset\",\n\t\"author\": \"Ryan Zayne\",\n\t\"license\": \"MIT\",\n\t\"homepage\": \"https://github.com/zayne-labs/config#readme\",\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"git+https://github.com/zayne-labs/config.git\"\n\t},\n\t\"bugs\": {\n\t\t\"url\": \"https://github.com/zayne-labs/config/issues\"\n\t},\n\t\"keywords\": [],\n\t\"sideEffects\": false,\n\t\"exports\": {\n\t\t\".\": \"./dist/index.js\"\n\t},\n\t\"bin\": \"./bin/index.js\",\n\t\"files\": [\n\t\t\"bin\",\n\t\t\"dist\"\n\t],\n\t\"engines\": {\n\t\t\"node\": \">=20.x\"\n\t},\n\t\"scripts\": {\n\t\t\"build\": \"pnpm typegen && tsdown\",\n\t\t\"build:dev\": \"pnpm typegen && cross-env NODE_ENV=development tsdown\",\n\t\t\"dev\": \"pnpm build:dev --watch\",\n\t\t\"lint:attw\": \"attw --pack . --ignore-rules=cjs-resolves-to-esm\",\n\t\t\"lint:eslint\": \"eslint . --max-warnings 0\",\n\t\t\"lint:format\": \"prettier --write .\",\n\t\t\"lint:packages\": \"pnpm dedupe --check\",\n\t\t\"lint:publint\": \"publint --strict .\",\n\t\t\"lint:type-check\": \"pnpm typegen && tsc --pretty -p tsconfig.json\",\n\t\t\"release\": \"pnpm publish --no-git-checks\",\n\t\t\"release:test\": \"pnpx pkg-pr-new publish\",\n\t\t\"typegen\": \"tsx scripts/typegen.ts\",\n\t\t\"version-package\": \"changeset version\"\n\t},\n\t\"peerDependencies\": {\n\t\t\"@eslint-react/eslint-plugin\": \"2.x.x\",\n\t\t\"@next/eslint-plugin-next\": \"15.x.x\",\n\t\t\"@tanstack/eslint-plugin-query\": \"5.x.x\",\n\t\t\"@tanstack/eslint-plugin-router\": \"1.x.x\",\n\t\t\"astro-eslint-parser\": \"1.x.x\",\n\t\t\"eslint\": \"9.x.x\",\n\t\t\"eslint-config-expo\": \"10.x.x\",\n\t\t\"eslint-plugin-astro\": \"1.x.x\",\n\t\t\"eslint-plugin-better-tailwindcss\": \"3.x.x\",\n\t\t\"eslint-plugin-depend\": \"1.x.x\",\n\t\t\"eslint-plugin-pnpm\": \"1.x.x\",\n\t\t\"eslint-plugin-react-hooks\": \"5.x.x\",\n\t\t\"eslint-plugin-react-refresh\": \"0.x.x\",\n\t\t\"eslint-plugin-solid\": \"0.x.x\",\n\t\t\"eslint-plugin-svelte\": \"3.x.x\",\n\t\t\"eslint-plugin-vue\": \"10.x.x\",\n\t\t\"eslint-processor-vue-blocks\": \"2.x.x\",\n\t\t\"vue-eslint-parser\": \"10.x.x\"\n\t},\n\t\"peerDependenciesMeta\": {\n\t\t\"@eslint-react/eslint-plugin\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"@next/eslint-plugin-next\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"@tanstack/eslint-plugin-query\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"@tanstack/eslint-plugin-router\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"astro-eslint-parser\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-config-expo\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-plugin-astro\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-plugin-better-tailwindcss\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-plugin-depend\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-plugin-pnpm\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-plugin-react-hooks\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-plugin-react-refresh\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-plugin-react-you-might-not-need-an-effect\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-plugin-solid\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-plugin-svelte\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-plugin-vue\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eslint-processor-vue-blocks\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"vue-eslint-parser\": {\n\t\t\t\"optional\": true\n\t\t}\n\t},\n\t\"dependencies\": {\n\t\t\"@antfu/install-pkg\": \"1.1.0\",\n\t\t\"@clack/prompts\": \"0.11.0\",\n\t\t\"@eslint-community/eslint-plugin-eslint-comments\": \"4.5.0\",\n\t\t\"@eslint/compat\": \"1.4.0\",\n\t\t\"@eslint/js\": \"9.36.0\",\n\t\t\"@stylistic/eslint-plugin\": \"5.4.0\",\n\t\t\"@zayne-labs/toolkit-type-helpers\": \"0.11.17\",\n\t\t\"ansis\": \"4.2.0\",\n\t\t\"cac\": \"6.7.14\",\n\t\t\"eslint-config-flat-gitignore\": \"2.1.0\",\n\t\t\"eslint-flat-config-utils\": \"2.1.4\",\n\t\t\"eslint-import-resolver-typescript\": \"4.4.4\",\n\t\t\"eslint-merge-processors\": \"2.0.0\",\n\t\t\"eslint-plugin-import-x\": \"4.16.1\",\n\t\t\"eslint-plugin-jsdoc\": \"60.5.0\",\n\t\t\"eslint-plugin-jsonc\": \"2.20.1\",\n\t\t\"eslint-plugin-n\": \"17.23.1\",\n\t\t\"eslint-plugin-perfectionist\": \"4.15.0\",\n\t\t\"eslint-plugin-security\": \"3.0.1\",\n\t\t\"eslint-plugin-toml\": \"^0.12.0\",\n\t\t\"eslint-plugin-unicorn\": \"61.0.2\",\n\t\t\"eslint-plugin-yml\": \"^1.17.0\",\n\t\t\"globals\": \"16.4.0\",\n\t\t\"jsonc-eslint-parser\": \"2.4.1\",\n\t\t\"local-pkg\": \"1.1.2\",\n\t\t\"parse-gitignore\": \"2.0.0\",\n\t\t\"toml-eslint-parser\": \"0.10.0\",\n\t\t\"typescript-eslint\": \"8.44.1\",\n\t\t\"yaml-eslint-parser\": \"1.3.0\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@arethetypeswrong/cli\": \"0.18.2\",\n\t\t\"@changesets/cli\": \"2.29.7\",\n\t\t\"@eslint-react/eslint-plugin\": \"2.0.2\",\n\t\t\"@next/eslint-plugin-next\": \"15.5.4\",\n\t\t\"@tanstack/eslint-plugin-query\": \"5.91.0\",\n\t\t\"@tanstack/eslint-plugin-router\": \"1.132.21\",\n\t\t\"@total-typescript/ts-reset\": \"0.6.1\",\n\t\t\"@types/eslint-plugin-security\": \"3.0.0\",\n\t\t\"@types/node\": \"24.5.2\",\n\t\t\"@zayne-labs/tsconfig\": \"workspace:*\",\n\t\t\"astro-eslint-parser\": \"1.2.2\",\n\t\t\"concurrently\": \"9.2.1\",\n\t\t\"cross-env\": \"10.0.0\",\n\t\t\"eslint\": \"9.36.0\",\n\t\t\"eslint-config-expo\": \"^10.0.0\",\n\t\t\"eslint-plugin-astro\": \"1.3.1\",\n\t\t\"eslint-plugin-better-tailwindcss\": \"3.7.9\",\n\t\t\"eslint-plugin-depend\": \"1.3.1\",\n\t\t\"eslint-plugin-pnpm\": \"1.1.2\",\n\t\t\"eslint-plugin-react-hooks\": \"5.2.0\",\n\t\t\"eslint-plugin-react-refresh\": \"0.4.22\",\n\t\t\"eslint-plugin-react-you-might-not-need-an-effect\": \"0.5.4\",\n\t\t\"eslint-plugin-solid\": \"0.14.5\",\n\t\t\"eslint-plugin-svelte\": \"3.12.4\",\n\t\t\"eslint-plugin-vue\": \"10.5.0\",\n\t\t\"eslint-processor-vue-blocks\": \"2.0.0\",\n\t\t\"eslint-typegen\": \"2.3.0\",\n\t\t\"husky\": \"9.1.7\",\n\t\t\"lint-staged\": \"16.2.3\",\n\t\t\"pkg-pr-new\": \"0.0.60\",\n\t\t\"prettier\": \"3.6.2\",\n\t\t\"publint\": \"0.3.13\",\n\t\t\"tailwindcss\": \"^4.1.13\",\n\t\t\"tsdown\": \"^0.15.5\",\n\t\t\"tsx\": \"4.20.6\",\n\t\t\"typescript\": \"5.9.2\",\n\t\t\"vue-eslint-parser\": \"10.2.0\"\n\t},\n\t\"publishConfig\": {\n\t\t\"access\": \"public\",\n\t\t\"registry\": \"https://registry.npmjs.org/\",\n\t\t\"provenance\": true\n\t}\n}\n","import { defineEnumDeep } from \"@zayne-labs/toolkit-type-helpers\";\nimport c from \"ansis\";\nimport type { ExtraLibrariesOptionUnion, FrameworkOptionUnion, PromItem } from \"./types\";\n\nexport const vscodeSettingsString = `\n // Auto fix\n // \"editor.codeActionsOnSave\": {\n // \"source.fixAll.eslint\": \"explicit\",\n // },\n\n // Enable eslint for all supported languages\n \"eslint.validate\": [\n \"javascript\",\n \"javascriptreact\",\n \"typescript\",\n \"typescriptreact\",\n \"vue\",\n \"html\",\n \"markdown\",\n \"json\",\n \"json5\",\n \"jsonc\",\n \"yaml\",\n \"toml\",\n \"xml\",\n \"gql\",\n \"graphql\",\n \"astro\",\n \"svelte\",\n \"css\",\n \"less\",\n \"scss\",\n \"postcss\"\n ]\n`;\n\nexport const frameworkOptions: Array<PromItem<FrameworkOptionUnion>> = [\n\t{\n\t\tlabel: c.green(\"Vue\"),\n\t\tvalue: \"vue\",\n\t},\n\t{\n\t\tlabel: c.cyan(\"React\"),\n\t\tvalue: \"react\",\n\t},\n\t{\n\t\tlabel: c.red(\"Svelte\"),\n\t\tvalue: \"svelte\",\n\t},\n\t{\n\t\tlabel: c.magenta(\"Astro\"),\n\t\tvalue: \"astro\",\n\t},\n\t{\n\t\tlabel: c.cyan(\"Solid\"),\n\t\tvalue: \"solid\",\n\t},\n];\n\nexport const frameworks: FrameworkOptionUnion[] = frameworkOptions.map(({ value }) => value);\n\nexport const extraOptions: Array<PromItem<ExtraLibrariesOptionUnion>> = [\n\t{\n\t\tlabel: c.cyan(\"TailwindCSS (Better)\"),\n\t\tvalue: \"tailwindcssBetter\",\n\t},\n];\n\nexport const extra = extraOptions.map(({ value }) => value);\n\nexport const dependenciesMap = defineEnumDeep({\n\tastro: [\"eslint-plugin-astro\", \"astro-eslint-parser\"],\n\treact: [\"@eslint-react/eslint-plugin\", \"eslint-plugin-react-hooks\", \"eslint-plugin-react-refresh\"],\n\tsolid: [\"eslint-plugin-solid\"],\n\tsvelte: [\"eslint-plugin-svelte\", \"svelte-eslint-parser\"],\n\ttailwindcssBetter: [\"eslint-plugin-better-tailwindcss\"],\n\tvue: [\"eslint-plugin-vue\", \"eslint-processor-vue-blocks\", \"vue-eslint-parser\"],\n}) satisfies Record<ExtraLibrariesOptionUnion | FrameworkOptionUnion, string[]>;\n","import { execSync } from \"node:child_process\";\n\nexport function isGitClean(): boolean {\n\ttry {\n\t\texecSync(\"git diff-index --quiet HEAD --\");\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport function getEslintConfigContent(mainConfig: string, additionalConfigs?: string[]): string {\n\tconst additionalConfigsStr = additionalConfigs?.map((config) => `,{\\n${config}\\n}`);\n\n\treturn `\nimport { zayne } from '@zayne-labs/eslint-config'\n\nexport default zayne({\n${mainConfig}\n}${additionalConfigsStr})\n`.trimStart();\n}\n","/* eslint-disable max-depth -- Allow */\nimport fs from \"node:fs\";\nimport fsp from \"node:fs/promises\";\nimport path from \"node:path\";\nimport process from \"node:process\";\nimport * as p from \"@clack/prompts\";\nimport c from \"ansis\";\n// @ts-expect-error missing types\nimport parse from \"parse-gitignore\";\nimport type { PromptResult } from \"../types\";\nimport { getEslintConfigContent } from \"../utils\";\n\nexport async function updateEslintFiles(result: PromptResult): Promise<void> {\n\tconst cwd = process.cwd();\n\tconst pathESLintIgnore = path.join(cwd, \".eslintignore\");\n\tconst pathPackageJSON = path.join(cwd, \"package.json\");\n\n\tconst pkgContent = await fsp.readFile(pathPackageJSON, \"utf8\");\n\tconst pkg = JSON.parse(pkgContent) as Record<string, unknown>;\n\n\tconst configFileName = pkg.type === \"module\" ? \"eslint.config.js\" : \"eslint.config.mjs\";\n\tconst pathFlatConfig = path.join(cwd, configFileName);\n\n\tconst eslintIgnores: string[] = [];\n\n\tif (fs.existsSync(pathESLintIgnore)) {\n\t\tp.log.step(c.cyan`Migrating existing .eslintignore`);\n\n\t\tconst content = await fsp.readFile(pathESLintIgnore, \"utf8\");\n\t\tconst parsed = parse(content);\n\t\tconst globs = parsed.globs();\n\n\t\tfor (const glob of globs) {\n\t\t\tif (glob.type === \"ignore\") {\n\t\t\t\teslintIgnores.push(...(glob.patterns as string[]));\n\t\t\t}\n\n\t\t\tif (glob.type === \"unignore\") {\n\t\t\t\teslintIgnores.push(...(glob.patterns.map((pattern: string) => `!${pattern}`) as string[]));\n\t\t\t}\n\t\t}\n\t}\n\n\tconst configLines: string[] = [];\n\n\tif (eslintIgnores.length > 0) {\n\t\tconfigLines.push(`ignores: ${JSON.stringify(eslintIgnores)},`);\n\t}\n\n\tif (result.extra.includes(\"tailwindcssBetter\")) {\n\t\tconfigLines.push(`tailwindcssBetter: true,`);\n\t}\n\n\tfor (const framework of result.frameworks) {\n\t\tconfigLines.push(`${framework}: true,`);\n\t}\n\n\tconst mainConfig = configLines.map((line) => ` ${line}`).join(\"\\n\");\n\n\tconst additionalConfig: string[] = [];\n\n\tconst eslintConfigContent: string = getEslintConfigContent(mainConfig, additionalConfig);\n\n\tawait fsp.writeFile(pathFlatConfig, eslintConfigContent);\n\n\tp.log.success(c.green`Created ${configFileName}`);\n}\n","export const versionsMap = {\n\t\"@eslint-react/eslint-plugin\": \"^1.38.4\",\n\t\"astro-eslint-parser\": \"^1.2.2\",\n\teslint: \"^9.24.0\",\n\t\"eslint-plugin-astro\": \"^1.3.1\",\n\t\"eslint-plugin-better-tailwindcss\": \"^3.7.6\",\n\t\"eslint-plugin-react-hooks\": \"^5.2.0\",\n\t\"eslint-plugin-react-refresh\": \"^0.4.19\",\n\t\"eslint-plugin-solid\": \"^0.14.5\",\n\t\"eslint-plugin-svelte\": \"^3.3.3\",\n\t\"svelte-eslint-parser\": \"^1.1.0\",\n};\n","import fsp from \"node:fs/promises\";\nimport path from \"node:path\";\nimport process from \"node:process\";\nimport * as p from \"@clack/prompts\";\nimport c from \"ansis\";\nimport { version } from \"../../../package.json\";\nimport { dependenciesMap } from \"../constants\";\nimport { versionsMap } from \"../constants-generated\";\nimport type { PromptResult } from \"../types\";\n\nexport async function updatePackageJson(result: PromptResult): Promise<void> {\n\tconst cwd = process.cwd();\n\n\tconst pathPackageJSON = path.join(cwd, \"package.json\");\n\n\tp.log.step(c.cyan`Bumping @zayne-labs/eslint-config to v${version}`);\n\n\tconst pkgContent = await fsp.readFile(pathPackageJSON, \"utf8\");\n\tconst pkg = JSON.parse(pkgContent) as Record<string, Record<string, string | undefined> | undefined>;\n\n\tpkg.devDependencies ??= {};\n\tpkg.devDependencies[\"@zayne-labs/eslint-config\"] = `^${version}`;\n\tpkg.devDependencies.eslint ??= versionsMap.eslint;\n\n\tconst addedPackages: string[] = [];\n\n\tfor (const item of result.extra) {\n\t\tswitch (item) {\n\t\t\t// eslint-disable-next-line ts-eslint/no-unnecessary-condition -- Ignore for now\n\t\t\tcase \"tailwindcssBetter\": {\n\t\t\t\tdependenciesMap.tailwindcssBetter.forEach((f) => {\n\t\t\t\t\tpkg.devDependencies\n\t\t\t\t\t\t&& (pkg.devDependencies[f] = versionsMap[f as keyof typeof versionsMap]);\n\n\t\t\t\t\taddedPackages.push(f);\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdefault: {\n\t\t\t\titem satisfies never;\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (const framework of result.frameworks) {\n\t\tconst dependencies = dependenciesMap[framework];\n\n\t\t// eslint-disable-next-line ts-eslint/no-unnecessary-condition -- Allow\n\t\tif (!dependencies) continue;\n\n\t\tdependencies.forEach((dependency) => {\n\t\t\tif (!pkg.devDependencies) return;\n\n\t\t\tpkg.devDependencies[dependency] = versionsMap[dependency as keyof typeof versionsMap];\n\t\t\taddedPackages.push(dependency);\n\t\t});\n\t}\n\n\tif (addedPackages.length > 0) {\n\t\tp.note(c.dim(addedPackages.join(\", \")), \"Added packages\");\n\t}\n\n\tawait fsp.writeFile(pathPackageJSON, JSON.stringify(pkg, null, 2));\n\n\tp.log.success(c.green`Changes wrote to package.json`);\n}\n","import fs from \"node:fs\";\nimport fsp from \"node:fs/promises\";\nimport path from \"node:path\";\nimport process from \"node:process\";\nimport * as p from \"@clack/prompts\";\nimport { green } from \"ansis\";\nimport { vscodeSettingsString } from \"../constants\";\nimport type { PromptResult } from \"../types\";\n\nexport async function updateVscodeSettings(result: PromptResult): Promise<void> {\n\tconst cwd = process.cwd();\n\n\tif (!result.updateVscodeSettings) return;\n\n\tconst dotVscodePath: string = path.join(cwd, \".vscode\");\n\tconst settingsPath: string = path.join(dotVscodePath, \"settings.json\");\n\n\tif (!fs.existsSync(dotVscodePath)) await fsp.mkdir(dotVscodePath, { recursive: true });\n\n\tif (!fs.existsSync(settingsPath)) {\n\t\tawait fsp.writeFile(settingsPath, `{${vscodeSettingsString}}\\n`, \"utf8\");\n\t\tp.log.success(green`Created .vscode/settings.json`);\n\t} else {\n\t\tlet settingsContent = await fsp.readFile(settingsPath, \"utf8\");\n\n\t\tsettingsContent = settingsContent.trim().replace(/\\s*\\}$/, \"\");\n\t\tsettingsContent += settingsContent.endsWith(\",\") || settingsContent.endsWith(\"{\") ? \"\" : \",\";\n\t\tsettingsContent += `${vscodeSettingsString}}\\n`;\n\n\t\tawait fsp.writeFile(settingsPath, settingsContent, \"utf8\");\n\t\tp.log.success(green`Updated .vscode/settings.json`);\n\t}\n}\n","/* eslint-disable perfectionist/sort-objects -- Ignore */\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport process from \"node:process\";\nimport * as p from \"@clack/prompts\";\nimport c from \"ansis\";\nimport { extra, extraOptions, frameworkOptions, frameworks } from \"./constants\";\nimport { updateEslintFiles } from \"./stages/update-eslint-files\";\nimport { updatePackageJson } from \"./stages/update-package-json\";\nimport { updateVscodeSettings } from \"./stages/update-vscode-settings\";\nimport type { ExtraLibrariesOptionUnion, FrameworkOptionUnion, PromptResult } from \"./types\";\nimport { isGitClean } from \"./utils\";\n\nexport type CliRunOptions = {\n\t/**\n\t * Use the extra utils: formatter / perfectionist / unocss\n\t */\n\textra?: string[];\n\t/**\n\t * Use the framework template for optimal customization: vue / react / svelte / astro\n\t */\n\tframeworks?: string[];\n\t/**\n\t * Skip prompts and use default values\n\t */\n\tyes?: boolean;\n};\n\nexport async function run(options: CliRunOptions = {}): Promise<void> {\n\tconst argSkipPrompt = Boolean(process.env.SKIP_PROMPT) || options.yes;\n\tconst argTemplate = options.frameworks?.map((m) => m.trim()).filter(Boolean);\n\tconst argExtra = options.extra?.map((m) => m.trim()).filter(Boolean);\n\n\tif (fs.existsSync(path.join(process.cwd(), \"eslint.config.js\"))) {\n\t\tp.log.warn(c.yellow`eslint.config.js already exists, migration wizard exited.`);\n\n\t\treturn process.exit(1);\n\t}\n\n\t// Set default value for promptResult if `argSkipPrompt` is enabled\n\tlet result: PromptResult = {\n\t\textra: (argExtra ?? []) as ExtraLibrariesOptionUnion[],\n\t\tframeworks: (argTemplate ?? []) as FrameworkOptionUnion[],\n\t\tuncommittedConfirmed: false,\n\t\tupdateVscodeSettings: true,\n\t};\n\n\tif (!argSkipPrompt) {\n\t\tresult = (await p.group(\n\t\t\t{\n\t\t\t\tuncommittedConfirmed: () => {\n\t\t\t\t\tif (isGitClean()) {\n\t\t\t\t\t\treturn Promise.resolve(true);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn p.confirm({\n\t\t\t\t\t\tinitialValue: false,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\"There are uncommitted changes in the current repository, are you sure to continue?\",\n\t\t\t\t\t});\n\t\t\t\t},\n\n\t\t\t\tframeworks: ({ results }) => {\n\t\t\t\t\tconst isArgTemplateValid =\n\t\t\t\t\t\t(argTemplate?.length ?? 0) > 0\n\t\t\t\t\t\t&& (argTemplate ?? []).filter((element) => !frameworks.includes(element)).length === 0;\n\n\t\t\t\t\tif (!results.uncommittedConfirmed || isArgTemplateValid) return;\n\n\t\t\t\t\tconst message =\n\t\t\t\t\t\targTemplate ?\n\t\t\t\t\t\t\t`\"${argTemplate}\" isn't a valid template. Please choose from below: `\n\t\t\t\t\t\t:\t\"Select a framework:\";\n\n\t\t\t\t\treturn p.multiselect<FrameworkOptionUnion>({\n\t\t\t\t\t\tmessage: c.reset(message),\n\t\t\t\t\t\toptions: frameworkOptions,\n\t\t\t\t\t\trequired: false,\n\t\t\t\t\t});\n\t\t\t\t},\n\n\t\t\t\textra: ({ results }) => {\n\t\t\t\t\tconst isArgExtraValid =\n\t\t\t\t\t\t(argExtra?.length ?? 0) > 0\n\t\t\t\t\t\t&& (argExtra ?? []).filter((element) => !extra.includes(element)).length === 0;\n\n\t\t\t\t\tif (!results.uncommittedConfirmed || isArgExtraValid) return;\n\n\t\t\t\t\tconst message =\n\t\t\t\t\t\targExtra ?\n\t\t\t\t\t\t\t`\"${argExtra}\" isn't a valid extra util. Please choose from below: `\n\t\t\t\t\t\t:\t\"Select an extra util:\";\n\n\t\t\t\t\treturn p.multiselect<ExtraLibrariesOptionUnion>({\n\t\t\t\t\t\tmessage: c.reset(message),\n\t\t\t\t\t\toptions: extraOptions,\n\t\t\t\t\t\trequired: false,\n\t\t\t\t\t});\n\t\t\t\t},\n\n\t\t\t\tupdateVscodeSettings: ({ results }) => {\n\t\t\t\t\tif (!results.uncommittedConfirmed) return;\n\n\t\t\t\t\treturn p.confirm({\n\t\t\t\t\t\tinitialValue: true,\n\t\t\t\t\t\tmessage: \"Update .vscode/settings.json for better VS Code experience?\",\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tonCancel: () => {\n\t\t\t\t\tp.cancel(\"Operation cancelled.\");\n\t\t\t\t\tprocess.exit(0);\n\t\t\t\t},\n\t\t\t}\n\t\t)) as PromptResult;\n\n\t\tif (!result.uncommittedConfirmed) {\n\t\t\treturn process.exit(1);\n\t\t}\n\t}\n\n\tawait updatePackageJson(result);\n\tawait updateEslintFiles(result);\n\tawait updateVscodeSettings(result);\n\n\tp.log.success(c.green`Setup completed`);\n\n\tp.outro(\n\t\t`Now you can update the dependencies by running ${c.blue(\"pnpm install\")} and also ${c.blue(\"eslint --fix\")}\\n`\n\t);\n}\n","import process from \"node:process\";\nimport * as p from \"@clack/prompts\";\nimport c from \"ansis\";\nimport { cac } from \"cac\";\nimport { version } from \"../../package.json\";\nimport { type CliRunOptions, run } from \"./run\";\n\nfunction header(): void {\n\tp.intro(`${c.green`@zayne-labs/eslint-config `}${c.dim`v${version}`}`);\n}\n\nconst cli = cac(\"@zayne-labs/eslint-config\");\n\ncli.command(\"\", \"Run the initialization or migration\")\n\t.option(\"--yes, -y\", \"Skip prompts and use default values\", { default: false })\n\t.option(\n\t\t\"--template, -t <template>\",\n\t\t\"Use the framework template for optimal customization: vue / react / svelte / astro\",\n\t\t{ type: [] }\n\t)\n\t.option(\"--extra, -e <extra>\", \"Use the extra utils: perfectionist / tailwindcss\", { type: [] })\n\t.action(async (options: CliRunOptions) => {\n\t\theader();\n\t\ttry {\n\t\t\tawait run(options);\n\t\t} catch (error) {\n\t\t\tp.log.error(c.inverse.red(\" Failed to migrate \"));\n\t\t\tp.log.error(c.red`✘ ${String(error)}`);\n\t\t\tprocess.exit(1);\n\t\t}\n\t});\n\ncli.help();\ncli.version(version);\ncli.parse();\n"],"mappings":";;;;;;;;;;;;cAGY;;;;ACCZ,MAAa,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCpC,MAAaA,mBAA0D;CACtE;EACC,OAAO,EAAE,MAAM,MAAM;EACrB,OAAO;EACP;CACD;EACC,OAAO,EAAE,KAAK,QAAQ;EACtB,OAAO;EACP;CACD;EACC,OAAO,EAAE,IAAI,SAAS;EACtB,OAAO;EACP;CACD;EACC,OAAO,EAAE,QAAQ,QA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AG;AACtC,UAAQ,KAAK,EAAE;;EAEf;AAEH,IAAI,MAAM;AACV,IAAI,QAAQ,QAAQ;AACpB,IAAI,OAAO"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1141,6 +1141,11 @@ interface Rules {
|
|
|
1141
1141
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template.md#repos-sticky-header
|
|
1142
1142
|
*/
|
|
1143
1143
|
'jsdoc/require-template'?: Linter.RuleEntry<JsdocRequireTemplate>;
|
|
1144
|
+
/**
|
|
1145
|
+
* Requires a description for `@template` tags
|
|
1146
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template-description.md#repos-sticky-header
|
|
1147
|
+
*/
|
|
1148
|
+
'jsdoc/require-template-description'?: Linter.RuleEntry<[]>;
|
|
1144
1149
|
/**
|
|
1145
1150
|
* Requires that throw statements are documented with `@throws` tags.
|
|
1146
1151
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-throws.md#repos-sticky-header
|
|
@@ -3397,7 +3402,7 @@ interface Rules {
|
|
|
3397
3402
|
*/
|
|
3398
3403
|
'react-x/no-unused-class-component-members'?: Linter.RuleEntry<[]>;
|
|
3399
3404
|
/**
|
|
3400
|
-
* Warns
|
|
3405
|
+
* Warns component props that are defined but never used.
|
|
3401
3406
|
* @see https://eslint-react.xyz/docs/rules/no-unused-props
|
|
3402
3407
|
*/
|
|
3403
3408
|
'react-x/no-unused-props'?: Linter.RuleEntry<[]>;
|
|
@@ -7270,7 +7275,6 @@ interface Rules {
|
|
|
7270
7275
|
*/
|
|
7271
7276
|
'yoda'?: Linter.RuleEntry<Yoda>;
|
|
7272
7277
|
}
|
|
7273
|
-
|
|
7274
7278
|
/* ======= Declarations ======= */
|
|
7275
7279
|
// ----- accessor-pairs -----
|
|
7276
7280
|
type AccessorPairs = [] | [{
|
|
@@ -7902,6 +7906,7 @@ type JsdocCheckPropertyNames = [] | [{
|
|
|
7902
7906
|
type JsdocCheckTagNames = [] | [{
|
|
7903
7907
|
definedTags?: string[];
|
|
7904
7908
|
enableFixer?: boolean;
|
|
7909
|
+
inlineTags?: string[];
|
|
7905
7910
|
jsxTags?: boolean;
|
|
7906
7911
|
typed?: boolean;
|
|
7907
7912
|
}];
|
|
@@ -16334,7 +16339,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
16334
16339
|
}];
|
|
16335
16340
|
|
|
16336
16341
|
// Names of all the configs
|
|
16337
|
-
type ConfigNames = "zayne/js-eslint/setup" | "zayne/js-eslint/recommended" | "zayne/js-eslint/rules" | "zayne/unicorn/recommended" | "zayne/unicorn/rules" | "zayne/ts-eslint/setup
|
|
16342
|
+
type ConfigNames = "zayne/js-eslint/setup" | "zayne/js-eslint/recommended" | "zayne/js-eslint/rules" | "zayne/unicorn/recommended" | "zayne/unicorn/rules" | "zayne/ts-eslint/setup" | "zayne/ts-eslint/setup/parser-type-aware" | "zayne/ts-eslint/recommended-strict-type-checked" | "zayne/ts-eslint/recommended-stylistic-type-checked" | "zayne/ts-eslint/rules" | "zayne/perfectionist/rules" | "zayne/stylistic/rules" | "zayne/import/setup" | "zayne/import/recommended" | "zayne/import/rules" | "zayne/jsdoc/rules" | "zayne/jsonc/setup" | "zayne/jsonc/rules" | "zayne/react/setup" | "zayne/react/recommended-type-checked" | "zayne/react/rules" | "zayne/react/refresh/rules" | "zayne/react/you-might-not-need-an-effect/recommended" | "zayne/react/you-might-not-need-an-effect/rules" | "zayne/react/compiler/rules" | "zayne/react/nextjs/recommended" | "zayne/react/nextjs/rules" | "zayne/node/recommended" | "zayne/node/rules" | "zayne/node/security/recommended" | "zayne/tanstack-query/recommended" | "zayne/tanstack-query/rules" | "zayne/tanstack-router/recommended" | "zayne/tanstack-router/rules" | "zayne/eslint-comments/rules" | "zayne/toml/setup" | "zayne/toml/rules" | "zayne/yaml/setup" | "zayne/yaml/rules" | "zayne/vue/setup" | "zayne/vue/setup/parser" | "zayne/vue/recommended" | "zayne/vue/rules" | "zayne/solid/setup" | "zayne/solid/recommended" | "zayne/solid/rules" | "zayne/pnpm/setup" | "zayne/pnpm/rules/package-json" | "zayne/pnpm/rules/pnpm-workspace-yaml" | "zayne/astro/setup" | "zayne/astro/recommended" | "zayne/astro/rules" | "zayne/depend/setup" | "zayne/depend/recommended" | "zayne/depend/recommended/package-json" | "zayne/tailwindcss-better/setup" | "zayne/tailwindcss-better/recommended" | "zayne/tailwindcss-better/rules" | "zayne/expo/recommended" | "zayne/expo/recommended" | "zayne/expo/rules";
|
|
16338
16343
|
//#endregion
|
|
16339
16344
|
//#region src/types/eslint-config-types/parser-options.d.ts
|
|
16340
16345
|
// Some types copied from `@types/eslint` `Linter.ParserOptions`
|
|
@@ -16349,12 +16354,10 @@ type ConfigNames = "zayne/js-eslint/setup" | "zayne/js-eslint/recommended" | "za
|
|
|
16349
16354
|
* @see https://typescript-eslint.io/architecture/parser/#ecmaversion
|
|
16350
16355
|
*/
|
|
16351
16356
|
type EcmaVersion = Linter.EcmaVersion;
|
|
16352
|
-
|
|
16353
16357
|
/**
|
|
16354
16358
|
* Set to "script" (default) or "module" if your code is in ECMAScript modules.
|
|
16355
16359
|
*/
|
|
16356
16360
|
type SourceType = Linter.SourceType;
|
|
16357
|
-
|
|
16358
16361
|
/**
|
|
16359
16362
|
* An object indicating which additional language features you'd like to use.
|
|
16360
16363
|
*
|
|
@@ -16381,9 +16384,6 @@ type Parser = Linter.Parser | {
|
|
|
16381
16384
|
meta?: Linter.Parser["meta"];
|
|
16382
16385
|
parseForESLint(text: string, options?: any): ESLintParseResult;
|
|
16383
16386
|
};
|
|
16384
|
-
|
|
16385
|
-
/** Lib. */
|
|
16386
|
-
|
|
16387
16387
|
/**
|
|
16388
16388
|
* Parser options.
|
|
16389
16389
|
*
|
|
@@ -16615,6 +16615,13 @@ interface OptionsTypeScriptParserOptions {
|
|
|
16615
16615
|
* @see https://typescript-eslint.io/packages/parser#projectserviceoptions
|
|
16616
16616
|
*/
|
|
16617
16617
|
allowDefaultProject?: [string?, string?, string?, string?, string?, string?, string?, string?];
|
|
16618
|
+
/**
|
|
16619
|
+
* Additional parser options for TypeScript.
|
|
16620
|
+
* @see https://typescript-eslint.io/packages/parser
|
|
16621
|
+
*/
|
|
16622
|
+
parserOptions?: Partial<ParserOptions>;
|
|
16623
|
+
}
|
|
16624
|
+
interface OptionsTypeScriptWithTypes {
|
|
16618
16625
|
/**
|
|
16619
16626
|
* Glob patterns for files that should be type aware.
|
|
16620
16627
|
* @default ['**\/*.{ts,tsx}']
|
|
@@ -16625,13 +16632,6 @@ interface OptionsTypeScriptParserOptions {
|
|
|
16625
16632
|
* @default ['**\/*.md\/**', '**\/*.astro/*.ts']
|
|
16626
16633
|
*/
|
|
16627
16634
|
ignoresTypeAware?: string[];
|
|
16628
|
-
/**
|
|
16629
|
-
* Additional parser options for TypeScript.
|
|
16630
|
-
* @see https://typescript-eslint.io/packages/parser
|
|
16631
|
-
*/
|
|
16632
|
-
parserOptions?: Partial<ParserOptions>;
|
|
16633
|
-
}
|
|
16634
|
-
interface OptionsTypeScriptWithTypes {
|
|
16635
16635
|
/**
|
|
16636
16636
|
* Whether type aware rules are enabled or not.
|
|
16637
16637
|
* @default depends on the `tsconfigPath` option or if the `typescript` option is set to true
|
|
@@ -16871,7 +16871,7 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
16871
16871
|
*
|
|
16872
16872
|
* @default auto-detect based on the dependencies
|
|
16873
16873
|
*/
|
|
16874
|
-
react?: (OptionsFiles & OptionsHasTypeScript & OptionsOverrides & OptionsReact & Pick<
|
|
16874
|
+
react?: (OptionsFiles & OptionsHasTypeScript & OptionsOverrides & OptionsReact & Pick<OptionsTypeScriptWithTypes, "filesTypeAware" | "ignoresTypeAware">) | boolean;
|
|
16875
16875
|
/**
|
|
16876
16876
|
* Enable regexp rules.
|
|
16877
16877
|
* @see https://ota-meshi.github.io/eslint-plugin-regexp/
|
|
@@ -17037,10 +17037,6 @@ declare const stylistic: (options?: ExtractOptions<OptionsConfig["stylistic"]>)
|
|
|
17037
17037
|
//#endregion
|
|
17038
17038
|
//#region src/configs/tailwindcss.d.ts
|
|
17039
17039
|
declare const tailwindcssBetter: (options?: ExtractOptions<OptionsConfig["tailwindcssBetter"]>) => Promise<TypedFlatConfigItem[]>;
|
|
17040
|
-
/**
|
|
17041
|
-
* @description tailwindcss v4 is not supported yet
|
|
17042
|
-
* @deprecated until `eslint-plugin-tailwindcss` supports tailwindcss v4
|
|
17043
|
-
*/
|
|
17044
17040
|
//#endregion
|
|
17045
17041
|
//#region src/configs/tanstack.d.ts
|
|
17046
17042
|
declare const tanstack: (options?: ExtractOptions<OptionsConfig["tanstack"]>) => Promise<TypedFlatConfigItem[]>;
|
package/dist/index.js
CHANGED
|
@@ -300,24 +300,30 @@ const depend = async (options = {}) => {
|
|
|
300
300
|
const { files = [GLOB_SRC], overrides } = options;
|
|
301
301
|
await ensurePackages(["eslint-plugin-depend"]);
|
|
302
302
|
const [eslintPluginDepend, jsoncParser] = await Promise.all([interopDefault(import("eslint-plugin-depend")), interopDefault(import("jsonc-eslint-parser"))]);
|
|
303
|
-
return [
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
303
|
+
return [
|
|
304
|
+
{
|
|
305
|
+
name: "zayne/depend/setup",
|
|
306
|
+
plugins: { depend: eslintPluginDepend }
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
files,
|
|
310
|
+
name: "zayne/depend/recommended",
|
|
311
|
+
rules: {
|
|
312
|
+
...eslintPluginDepend.configs["flat/recommended"]?.rules,
|
|
313
|
+
...overrides
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
files: ["package.json", "**/package.json"],
|
|
318
|
+
languageOptions: { parser: jsoncParser },
|
|
319
|
+
name: "zayne/depend/recommended/package-json",
|
|
320
|
+
plugins: { depend: eslintPluginDepend },
|
|
321
|
+
rules: {
|
|
322
|
+
...eslintPluginDepend.configs["flat/recommended"]?.rules,
|
|
323
|
+
...overrides
|
|
324
|
+
}
|
|
319
325
|
}
|
|
320
|
-
|
|
326
|
+
];
|
|
321
327
|
};
|
|
322
328
|
|
|
323
329
|
//#endregion
|
|
@@ -941,28 +947,33 @@ async function pnpm(options = {}) {
|
|
|
941
947
|
interopDefault(import("yaml-eslint-parser")),
|
|
942
948
|
interopDefault(import("jsonc-eslint-parser"))
|
|
943
949
|
]);
|
|
944
|
-
return [
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
"
|
|
951
|
-
|
|
952
|
-
"pnpm/json
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
"pnpm
|
|
962
|
-
|
|
963
|
-
|
|
950
|
+
return [
|
|
951
|
+
{
|
|
952
|
+
name: "zayne/pnpm/setup",
|
|
953
|
+
plugins: { pnpm: eslintPluginPnpm }
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
files: ["package.json", "**/package.json"],
|
|
957
|
+
languageOptions: { parser: jsoncParser },
|
|
958
|
+
name: "zayne/pnpm/rules/package-json",
|
|
959
|
+
rules: {
|
|
960
|
+
"pnpm/json-enforce-catalog": "error",
|
|
961
|
+
"pnpm/json-prefer-workspace-settings": "error",
|
|
962
|
+
"pnpm/json-valid-catalog": "error",
|
|
963
|
+
...overrides?.json
|
|
964
|
+
}
|
|
965
|
+
},
|
|
966
|
+
{
|
|
967
|
+
files: ["pnpm-workspace.yaml"],
|
|
968
|
+
languageOptions: { parser: yamlParser },
|
|
969
|
+
name: "zayne/pnpm/rules/pnpm-workspace-yaml",
|
|
970
|
+
rules: {
|
|
971
|
+
"pnpm/yaml-no-duplicate-catalog-item": "error",
|
|
972
|
+
"pnpm/yaml-no-unused-catalog-item": "error",
|
|
973
|
+
...overrides?.yaml
|
|
974
|
+
}
|
|
964
975
|
}
|
|
965
|
-
|
|
976
|
+
];
|
|
966
977
|
}
|
|
967
978
|
|
|
968
979
|
//#endregion
|
|
@@ -1036,13 +1047,12 @@ const react = async (options = {}) => {
|
|
|
1036
1047
|
enableReact ? interopDefault(import("@eslint-react/eslint-plugin")) : void 0,
|
|
1037
1048
|
enableReact ? interopDefault(import("eslint-plugin-react-hooks")) : void 0,
|
|
1038
1049
|
refresh ? interopDefault(import("eslint-plugin-react-refresh")) : void 0,
|
|
1039
|
-
youMightNotNeedAnEffect ? interopDefault(import("./src-
|
|
1050
|
+
youMightNotNeedAnEffect ? interopDefault(import("./src-ZlDTU7nv.js")) : void 0,
|
|
1040
1051
|
nextjs ? interopDefault(import("@next/eslint-plugin-next")) : void 0
|
|
1041
1052
|
]);
|
|
1042
1053
|
const recommendedReactConfig = eslintPluginReact?.configs[typescript$1 ? "recommended-type-checked" : "recommended"];
|
|
1043
1054
|
const config = [];
|
|
1044
1055
|
if (enableReact && recommendedReactConfig && eslintReactHooks) config.push({
|
|
1045
|
-
files,
|
|
1046
1056
|
languageOptions: { parserOptions: {
|
|
1047
1057
|
ecmaFeatures: { jsx: true },
|
|
1048
1058
|
sourceType: "module"
|
|
@@ -1578,40 +1588,33 @@ const typescript = async (options = {}) => {
|
|
|
1578
1588
|
}
|
|
1579
1589
|
}
|
|
1580
1590
|
});
|
|
1581
|
-
const
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
allowNullish: true,
|
|
1590
|
-
allowNumber: true
|
|
1591
|
-
}],
|
|
1592
|
-
"ts-eslint/return-await": ["error", "in-try-catch"]
|
|
1593
|
-
};
|
|
1591
|
+
const recommendedRules = tsEslint.configs[isTypeAware ? "strictTypeChecked" : "strict"].map((config) => config.rules).reduce((accumulator, rules) => ({
|
|
1592
|
+
...accumulator,
|
|
1593
|
+
...rules
|
|
1594
|
+
}), {});
|
|
1595
|
+
const recommendedStylisticRules = tsEslint.configs[isTypeAware ? "stylisticTypeChecked" : "stylistic"].map((config) => config.rules).reduce((accumulator, rules) => ({
|
|
1596
|
+
...accumulator,
|
|
1597
|
+
...rules
|
|
1598
|
+
}), {});
|
|
1594
1599
|
return [
|
|
1595
1600
|
{
|
|
1596
|
-
name:
|
|
1601
|
+
name: "zayne/ts-eslint/setup",
|
|
1602
|
+
plugins: { "ts-eslint": tsEslint.plugin }
|
|
1603
|
+
},
|
|
1604
|
+
{
|
|
1605
|
+
name: `zayne/ts-eslint/${isTypeAware ? "setup/parser-type-aware" : "setup/parser"}`,
|
|
1597
1606
|
...isTypeAware ? makeParser(filesTypeAware, ignoresTypeAware) : makeParser(files)
|
|
1598
1607
|
},
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
overrides: {
|
|
1610
|
-
files: isTypeAware ? filesTypeAware : files,
|
|
1611
|
-
name: `zayne/ts-eslint/${selectedStylisticRuleSet}`
|
|
1612
|
-
},
|
|
1613
|
-
renameMap: { "@typescript-eslint": "ts-eslint" }
|
|
1614
|
-
}) : [],
|
|
1608
|
+
{
|
|
1609
|
+
files: isTypeAware ? filesTypeAware : files,
|
|
1610
|
+
name: `zayne/ts-eslint/recommended-${isTypeAware ? "strict-type-checked" : "strict"}`,
|
|
1611
|
+
rules: renameRules(recommendedRules, defaultPluginRenameMap)
|
|
1612
|
+
},
|
|
1613
|
+
...stylistic$1 ? [{
|
|
1614
|
+
files: isTypeAware ? filesTypeAware : files,
|
|
1615
|
+
name: `zayne/ts-eslint/recommended-${isTypeAware ? "stylistic-type-checked" : "stylistic"}`,
|
|
1616
|
+
rules: renameRules(recommendedStylisticRules, defaultPluginRenameMap)
|
|
1617
|
+
}] : [],
|
|
1615
1618
|
{
|
|
1616
1619
|
files: isTypeAware ? filesTypeAware : files,
|
|
1617
1620
|
name: "zayne/ts-eslint/rules",
|
|
@@ -1646,7 +1649,17 @@ const typescript = async (options = {}) => {
|
|
|
1646
1649
|
"ts-eslint/no-use-before-define": "off",
|
|
1647
1650
|
"ts-eslint/no-useless-constructor": "error",
|
|
1648
1651
|
"ts-eslint/no-useless-empty-export": "error",
|
|
1649
|
-
...isTypeAware &&
|
|
1652
|
+
...isTypeAware && {
|
|
1653
|
+
"ts-eslint/no-unnecessary-type-parameters": "off",
|
|
1654
|
+
"ts-eslint/non-nullable-type-assertion-style": "off",
|
|
1655
|
+
"ts-eslint/prefer-nullish-coalescing": ["error", { ignoreConditionalTests: true }],
|
|
1656
|
+
"ts-eslint/restrict-template-expressions": ["error", {
|
|
1657
|
+
allowBoolean: true,
|
|
1658
|
+
allowNullish: true,
|
|
1659
|
+
allowNumber: true
|
|
1660
|
+
}],
|
|
1661
|
+
"ts-eslint/return-await": ["error", "in-try-catch"]
|
|
1662
|
+
},
|
|
1650
1663
|
...overrides
|
|
1651
1664
|
}
|
|
1652
1665
|
}
|
|
@@ -1729,7 +1742,7 @@ const vue = async (options = {}) => {
|
|
|
1729
1742
|
...typescript$1 && { parser: tsEslint?.parser }
|
|
1730
1743
|
}
|
|
1731
1744
|
},
|
|
1732
|
-
name: "zayne/vue/setup/
|
|
1745
|
+
name: "zayne/vue/setup/parser",
|
|
1733
1746
|
processor: sfcBlocks === false ? pluginVue.processors[".vue"] : mergeProcessors([pluginVue.processors[".vue"], processorVueBlocks?.({
|
|
1734
1747
|
...resolveOptions(sfcBlocks),
|
|
1735
1748
|
blocks: {
|