@zayne-labs/eslint-config 0.13.1 → 0.13.4

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.js CHANGED
@@ -10,7 +10,7 @@ import fsp from "node:fs/promises";
10
10
  import parse from "parse-gitignore";
11
11
  import { execSync } from "node:child_process";
12
12
  //#region package.json
13
- var version = "0.13.1";
13
+ var version = "0.13.4";
14
14
  //#endregion
15
15
  //#region src/cli/constants.ts
16
16
  const vscodeSettingsString = `
@@ -139,15 +139,15 @@ const updateEslintFiles = async (result) => {
139
139
  const versionsMap = defineEnum({
140
140
  "@eslint-react/eslint-plugin": "^4.2.3",
141
141
  "astro-eslint-parser": "^1.4.0",
142
- eslint: "^10.2.0",
142
+ eslint: "^10.2.1",
143
143
  "eslint-plugin-astro": "^1.7.0",
144
- "eslint-plugin-better-tailwindcss": "^4.4.0",
145
- "eslint-plugin-react-hooks": "^7.0.1",
144
+ "eslint-plugin-better-tailwindcss": "^4.4.1",
145
+ "eslint-plugin-react-hooks": "^7.1.1",
146
146
  "eslint-plugin-react-refresh": "^0.5.2",
147
147
  "eslint-plugin-react-you-might-not-need-an-effect": "^0.9.3",
148
148
  "eslint-plugin-solid": "^0.14.5",
149
- "eslint-plugin-svelte": "^3.17.0",
150
- "eslint-plugin-vue": "^10.8.0",
149
+ "eslint-plugin-svelte": "^3.17.1",
150
+ "eslint-plugin-vue": "^10.9.0",
151
151
  "eslint-processor-vue-blocks": "^2.0.0",
152
152
  "svelte-eslint-parser": "^1.6.0",
153
153
  "vue-eslint-parser": "^10.4.0"
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"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":["","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: \"tailwindcss-better\",\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: [\n\t\t\"@eslint-react/eslint-plugin\",\n\t\t\"eslint-plugin-react-hooks\",\n\t\t\"eslint-plugin-react-refresh\",\n\t\t\"eslint-plugin-react-you-might-not-need-an-effect\",\n\t],\n\tsolid: [\"eslint-plugin-solid\"],\n\tsvelte: [\"eslint-plugin-svelte\", \"svelte-eslint-parser\"],\n\t\"tailwindcss-better\": [\"eslint-plugin-better-tailwindcss\"],\n\tvue: [\"eslint-plugin-vue\", \"eslint-processor-vue-blocks\", \"vue-eslint-parser\"],\n}) satisfies Record<ExtraLibrariesOptionUnion | FrameworkOptionUnion, string[]>;\n","/* eslint-disable ts-eslint/restrict-template-expressions -- Ignore */\nimport { execSync } from \"node:child_process\";\n\nexport const 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 const 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 const updateEslintFiles = async (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","import { defineEnum } from \"@zayne-labs/toolkit-type-helpers\";\n\nexport const versionsMap = defineEnum({\n\t\"@eslint-react/eslint-plugin\": \"^4.2.3\",\n\t\"astro-eslint-parser\": \"^1.4.0\",\n\teslint: \"^10.2.0\",\n\t\"eslint-plugin-astro\": \"^1.7.0\",\n\t\"eslint-plugin-better-tailwindcss\": \"^4.4.0\",\n\t\"eslint-plugin-react-hooks\": \"^7.0.1\",\n\t\"eslint-plugin-react-refresh\": \"^0.5.2\",\n\t\"eslint-plugin-react-you-might-not-need-an-effect\": \"^0.9.3\",\n\t\"eslint-plugin-solid\": \"^0.14.5\",\n\t\"eslint-plugin-svelte\": \"^3.17.0\",\n\t\"eslint-plugin-vue\": \"^10.8.0\",\n\t\"eslint-processor-vue-blocks\": \"^2.0.0\",\n\t\"svelte-eslint-parser\": \"^1.6.0\",\n\t\"vue-eslint-parser\": \"^10.4.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 const updatePackageJson = async (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\n\t\t\tcase \"tailwindcss-better\": {\n\t\t\t\tdependenciesMap[\"tailwindcss-better\"].forEach((depName) => {\n\t\t\t\t\tpkg.devDependencies\n\t\t\t\t\t\t&& (pkg.devDependencies[depName] = versionsMap[depName as keyof typeof versionsMap]);\n\n\t\t\t\t\taddedPackages.push(depName);\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 * as ansis from \"ansis\";\nimport { vscodeSettingsString } from \"../constants\";\nimport type { PromptResult } from \"../types\";\n\nexport const updateVscodeSettings = async (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(ansis.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(ansis.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 const runCli = async (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`\"${JSON.stringify(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`\"${JSON.stringify(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 { runCli, type CliRunOptions } from \"./run\";\n\nconst header = () => {\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: tailwindcss\", { type: [] })\n\t.action(async (options: CliRunOptions) => {\n\t\theader();\n\t\ttry {\n\t\t\tawait runCli(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":";;;;;;;;;;;;;;;ACIA,MAAa,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCpC,MAAa,mBAA0D;CACtE;EACC,OAAO,EAAE,MAAM,MAAM;EACrB,OAAO;EACP;CACD;EACC,OAAO,EAAE,KAAK,QAAQ;EACtB,OAAO;EACP;CACD;EACC,OAAO,E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;UACb,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":[],"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":["","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: \"tailwindcss-better\",\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: [\n\t\t\"@eslint-react/eslint-plugin\",\n\t\t\"eslint-plugin-react-hooks\",\n\t\t\"eslint-plugin-react-refresh\",\n\t\t\"eslint-plugin-react-you-might-not-need-an-effect\",\n\t],\n\tsolid: [\"eslint-plugin-solid\"],\n\tsvelte: [\"eslint-plugin-svelte\", \"svelte-eslint-parser\"],\n\t\"tailwindcss-better\": [\"eslint-plugin-better-tailwindcss\"],\n\tvue: [\"eslint-plugin-vue\", \"eslint-processor-vue-blocks\", \"vue-eslint-parser\"],\n}) satisfies Record<ExtraLibrariesOptionUnion | FrameworkOptionUnion, string[]>;\n","/* eslint-disable ts-eslint/restrict-template-expressions -- Ignore */\nimport { execSync } from \"node:child_process\";\n\nexport const 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 const 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 const updateEslintFiles = async (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","import { defineEnum } from \"@zayne-labs/toolkit-type-helpers\";\n\nexport const versionsMap = defineEnum({\n\t\"@eslint-react/eslint-plugin\": \"^4.2.3\",\n\t\"astro-eslint-parser\": \"^1.4.0\",\n\teslint: \"^10.2.1\",\n\t\"eslint-plugin-astro\": \"^1.7.0\",\n\t\"eslint-plugin-better-tailwindcss\": \"^4.4.1\",\n\t\"eslint-plugin-react-hooks\": \"^7.1.1\",\n\t\"eslint-plugin-react-refresh\": \"^0.5.2\",\n\t\"eslint-plugin-react-you-might-not-need-an-effect\": \"^0.9.3\",\n\t\"eslint-plugin-solid\": \"^0.14.5\",\n\t\"eslint-plugin-svelte\": \"^3.17.1\",\n\t\"eslint-plugin-vue\": \"^10.9.0\",\n\t\"eslint-processor-vue-blocks\": \"^2.0.0\",\n\t\"svelte-eslint-parser\": \"^1.6.0\",\n\t\"vue-eslint-parser\": \"^10.4.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 const updatePackageJson = async (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\n\t\t\tcase \"tailwindcss-better\": {\n\t\t\t\tdependenciesMap[\"tailwindcss-better\"].forEach((depName) => {\n\t\t\t\t\tpkg.devDependencies\n\t\t\t\t\t\t&& (pkg.devDependencies[depName] = versionsMap[depName as keyof typeof versionsMap]);\n\n\t\t\t\t\taddedPackages.push(depName);\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 * as ansis from \"ansis\";\nimport { vscodeSettingsString } from \"../constants\";\nimport type { PromptResult } from \"../types\";\n\nexport const updateVscodeSettings = async (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(ansis.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(ansis.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 const runCli = async (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`\"${JSON.stringify(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`\"${JSON.stringify(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 { runCli, type CliRunOptions } from \"./run\";\n\nconst header = () => {\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: tailwindcss\", { type: [] })\n\t.action(async (options: CliRunOptions) => {\n\t\theader();\n\t\ttry {\n\t\t\tawait runCli(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":";;;;;;;;;;;;;;;ACIA,MAAa,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCpC,MAAa,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,MAAa,aAAqC,iBAAiB,KAAK,EAAE,YAAY,MAAM;AAE5F,MAAa,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;EACN;EACA;EACA;EACA;EACA;CACD,OAAO,CAAC,sBAAsB;CAC9B,QAAQ,CAAC,wBAAwB,uBAAuB;CACxD,sBAAsB,CAAC,mCAAmC;CAC1D,KAAK;EAAC;EAAqB;EAA+B;EAAoB;CAC9E,CAAC;;;AC/EF,MAAa,mBAA4B;AACxC,KAAI;AACH,WAAS,iCAAiC;AAC1C,SAAO;SACA;AACP,SAAO;;;AAIT,MAAa,0BAA0B,YAAoB,sBAAyC;AAGnG,QAAO;;;;EAIN,WAAW;GANiB,mBAAmB,KAAK,WAAW,OAAO,OAAO,KAAK,CAO5D;EACtB,WAAW;;;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eAAe,CAAC,YAAY,EAAE,KAAK,eAAe,CAAC,IAC5G;;;;AC3HF,MAAM,eAAe;AACpB,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,oCAAoC,EAAE,MAAM,EAAE,EAAE,CAAC,CAC/E,OAAO,OAAO,YAA2B;AACzC,SAAQ;AACR,KAAI;AACH,QAAM,OAAO,QAAQ;UACb,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"}
@@ -3369,24 +3369,24 @@ interface RuleOptions {
3369
3369
  * @see https://eslint.org/docs/latest/rules/radix
3370
3370
  */
3371
3371
  'radix'?: Linter.RuleEntry<Radix>;
3372
- /**
3373
- * Verifies that automatic effect dependencies are compiled if opted-in
3374
- */
3375
- 'react-hooks/automatic-effect-dependencies'?: Linter.RuleEntry<ReactHooksAutomaticEffectDependencies>;
3376
3372
  /**
3377
3373
  * Validates against calling capitalized functions/methods instead of using JSX
3374
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/capitalized-calls
3378
3375
  */
3379
3376
  'react-hooks/capitalized-calls'?: Linter.RuleEntry<ReactHooksCapitalizedCalls>;
3380
3377
  /**
3381
- * Validates against higher order functions defining nested components or hooks. Components and hooks should be defined at the module level
3378
+ * Deprecated: this rule has been removed in 7.1.0.
3379
+ * @deprecated
3382
3380
  */
3383
- 'react-hooks/component-hook-factories'?: Linter.RuleEntry<ReactHooksComponentHookFactories>;
3381
+ 'react-hooks/component-hook-factories'?: Linter.RuleEntry<[]>;
3384
3382
  /**
3385
3383
  * Validates the compiler configuration options
3384
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/config
3386
3385
  */
3387
3386
  'react-hooks/config'?: Linter.RuleEntry<ReactHooksConfig>;
3388
3387
  /**
3389
3388
  * Validates usage of error boundaries instead of try/catch for errors in child components
3389
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/error-boundaries
3390
3390
  */
3391
3391
  'react-hooks/error-boundaries'?: Linter.RuleEntry<ReactHooksErrorBoundaries>;
3392
3392
  /**
@@ -3395,59 +3395,78 @@ interface RuleOptions {
3395
3395
  */
3396
3396
  'react-hooks/exhaustive-deps'?: Linter.RuleEntry<ReactHooksExhaustiveDeps>;
3397
3397
  /**
3398
- * Validates usage of fbt
3398
+ * Validates that effect dependencies are exhaustive and without extraneous values
3399
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/exhaustive-effect-dependencies
3399
3400
  */
3400
- 'react-hooks/fbt'?: Linter.RuleEntry<ReactHooksFbt>;
3401
+ 'react-hooks/exhaustive-effect-dependencies'?: Linter.RuleEntry<ReactHooksExhaustiveEffectDependencies>;
3401
3402
  /**
3402
- * Validates usage of `fire`
3403
+ * Validates usage of fbt
3404
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/fbt
3403
3405
  */
3404
- 'react-hooks/fire'?: Linter.RuleEntry<ReactHooksFire>;
3406
+ 'react-hooks/fbt'?: Linter.RuleEntry<ReactHooksFbt>;
3405
3407
  /**
3406
3408
  * Validates configuration of [gating mode](https://react.dev/reference/react-compiler/gating)
3409
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/gating
3407
3410
  */
3408
3411
  'react-hooks/gating'?: Linter.RuleEntry<ReactHooksGating>;
3409
3412
  /**
3410
3413
  * Validates against assignment/mutation of globals during render, part of ensuring that [side effects must render outside of render](https://react.dev/reference/rules/components-and-hooks-must-be-pure#side-effects-must-run-outside-of-render)
3414
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/globals
3411
3415
  */
3412
3416
  'react-hooks/globals'?: Linter.RuleEntry<ReactHooksGlobals>;
3413
3417
  /**
3414
3418
  * Validates the rules of hooks
3419
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/hooks
3415
3420
  */
3416
3421
  'react-hooks/hooks'?: Linter.RuleEntry<ReactHooksHooks>;
3417
3422
  /**
3418
3423
  * Validates against mutating props, state, and other values that [are immutable](https://react.dev/reference/rules/components-and-hooks-must-be-pure#props-and-state-are-immutable)
3424
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/immutability
3419
3425
  */
3420
3426
  'react-hooks/immutability'?: Linter.RuleEntry<ReactHooksImmutability>;
3421
3427
  /**
3422
3428
  * Validates against usage of libraries which are incompatible with memoization (manual or automatic)
3429
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/incompatible-library
3423
3430
  */
3424
3431
  'react-hooks/incompatible-library'?: Linter.RuleEntry<ReactHooksIncompatibleLibrary>;
3425
3432
  /**
3426
3433
  * Internal invariants
3434
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/invariant
3427
3435
  */
3428
3436
  'react-hooks/invariant'?: Linter.RuleEntry<ReactHooksInvariant>;
3437
+ /**
3438
+ * Validates that useMemo() and useCallback() specify comprehensive dependencies without extraneous values. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
3439
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/memo-dependencies
3440
+ */
3441
+ 'react-hooks/memo-dependencies'?: Linter.RuleEntry<ReactHooksMemoDependencies>;
3429
3442
  /**
3430
3443
  * Validates that effect dependencies are memoized
3444
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/memoized-effect-dependencies
3431
3445
  */
3432
3446
  'react-hooks/memoized-effect-dependencies'?: Linter.RuleEntry<ReactHooksMemoizedEffectDependencies>;
3433
3447
  /**
3434
3448
  * Validates against deriving values from state in an effect
3449
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/no-deriving-state-in-effects
3435
3450
  */
3436
3451
  'react-hooks/no-deriving-state-in-effects'?: Linter.RuleEntry<ReactHooksNoDerivingStateInEffects>;
3437
3452
  /**
3438
3453
  * Validates that existing manual memoized is preserved by the compiler. React Compiler will only compile components and hooks if its inference [matches or exceeds the existing manual memoization](https://react.dev/learn/react-compiler/introduction#what-should-i-do-about-usememo-usecallback-and-reactmemo)
3454
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/preserve-manual-memoization
3439
3455
  */
3440
3456
  'react-hooks/preserve-manual-memoization'?: Linter.RuleEntry<ReactHooksPreserveManualMemoization>;
3441
3457
  /**
3442
3458
  * Validates that [components/hooks are pure](https://react.dev/reference/rules/components-and-hooks-must-be-pure) by checking that they do not call known-impure functions
3459
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/purity
3443
3460
  */
3444
3461
  'react-hooks/purity'?: Linter.RuleEntry<ReactHooksPurity>;
3445
3462
  /**
3446
3463
  * Validates correct usage of refs, not reading/writing during render. See the "pitfalls" section in [`useRef()` usage](https://react.dev/reference/react/useRef#usage)
3464
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/refs
3447
3465
  */
3448
3466
  'react-hooks/refs'?: Linter.RuleEntry<ReactHooksRefs>;
3449
3467
  /**
3450
3468
  * Validates against suppression of other rules
3469
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/rule-suppression
3451
3470
  */
3452
3471
  'react-hooks/rule-suppression'?: Linter.RuleEntry<ReactHooksRuleSuppression>;
3453
3472
  /**
@@ -3456,35 +3475,43 @@ interface RuleOptions {
3456
3475
  */
3457
3476
  'react-hooks/rules-of-hooks'?: Linter.RuleEntry<ReactHooksRulesOfHooks>;
3458
3477
  /**
3459
- * Validates against calling setState synchronously in an effect, which can lead to re-renders that degrade performance
3478
+ * Validates against calling setState synchronously in an effect. This can indicate non-local derived data, a derived event pattern, or improper external data synchronization.
3479
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/set-state-in-effect
3460
3480
  */
3461
3481
  'react-hooks/set-state-in-effect'?: Linter.RuleEntry<ReactHooksSetStateInEffect>;
3462
3482
  /**
3463
3483
  * Validates against setting state during render, which can trigger additional renders and potential infinite render loops
3484
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/set-state-in-render
3464
3485
  */
3465
3486
  'react-hooks/set-state-in-render'?: Linter.RuleEntry<ReactHooksSetStateInRender>;
3466
3487
  /**
3467
3488
  * Validates that components are static, not recreated every render. Components that are recreated dynamically can reset state and trigger excessive re-rendering
3489
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/static-components
3468
3490
  */
3469
3491
  'react-hooks/static-components'?: Linter.RuleEntry<ReactHooksStaticComponents>;
3470
3492
  /**
3471
3493
  * Validates against invalid syntax
3494
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/syntax
3472
3495
  */
3473
3496
  'react-hooks/syntax'?: Linter.RuleEntry<ReactHooksSyntax>;
3474
3497
  /**
3475
3498
  * Unimplemented features
3499
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/todo
3476
3500
  */
3477
3501
  'react-hooks/todo'?: Linter.RuleEntry<ReactHooksTodo>;
3478
3502
  /**
3479
3503
  * Validates against syntax that we do not plan to support in React Compiler
3504
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/unsupported-syntax
3480
3505
  */
3481
3506
  'react-hooks/unsupported-syntax'?: Linter.RuleEntry<ReactHooksUnsupportedSyntax>;
3482
3507
  /**
3483
3508
  * Validates usage of the useMemo() hook against common mistakes. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
3509
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/use-memo
3484
3510
  */
3485
3511
  'react-hooks/use-memo'?: Linter.RuleEntry<ReactHooksUseMemo>;
3486
3512
  /**
3487
3513
  * Validates that useMemos always return a value and that the result of the useMemo is used by the component/hook. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
3514
+ * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/void-use-memo
3488
3515
  */
3489
3516
  'react-hooks/void-use-memo'?: Linter.RuleEntry<ReactHooksVoidUseMemo>;
3490
3517
  'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>;
@@ -7252,7 +7279,7 @@ interface RuleOptions {
7252
7279
  * disallow object, array, and function literals in template
7253
7280
  * @see https://eslint.vuejs.org/rules/no-literals-in-template.html
7254
7281
  */
7255
- 'vue/no-literals-in-template'?: Linter.RuleEntry<[]>;
7282
+ 'vue/no-literals-in-template'?: Linter.RuleEntry<VueNoLiteralsInTemplate>;
7256
7283
  /**
7257
7284
  * disallow unnecessary `<template>`
7258
7285
  * @see https://eslint.vuejs.org/rules/no-lone-template.html
@@ -7645,6 +7672,11 @@ interface RuleOptions {
7645
7672
  * @see https://eslint.vuejs.org/rules/prefer-separate-static-class.html
7646
7673
  */
7647
7674
  'vue/prefer-separate-static-class'?: Linter.RuleEntry<[]>;
7675
+ /**
7676
+ * enforce passing a single argument to custom event emissions
7677
+ * @see https://eslint.vuejs.org/rules/prefer-single-event-payload.html
7678
+ */
7679
+ 'vue/prefer-single-event-payload'?: Linter.RuleEntry<[]>;
7648
7680
  /**
7649
7681
  * Require template literals instead of string concatenation in `<template>`
7650
7682
  * @see https://eslint.vuejs.org/rules/prefer-template.html
@@ -7660,6 +7692,11 @@ interface RuleOptions {
7660
7692
  * @see https://eslint.vuejs.org/rules/prefer-use-template-ref.html
7661
7693
  */
7662
7694
  'vue/prefer-use-template-ref'?: Linter.RuleEntry<[]>;
7695
+ /**
7696
+ * enforce using `v-model` instead of `:prop`/`@update:prop` pair
7697
+ * @see https://eslint.vuejs.org/rules/prefer-v-model.html
7698
+ */
7699
+ 'vue/prefer-v-model'?: Linter.RuleEntry<[]>;
7663
7700
  /**
7664
7701
  * enforce specific casing for the Prop name in Vue components
7665
7702
  * @see https://eslint.vuejs.org/rules/prop-name-casing.html
@@ -11332,6 +11369,7 @@ type PerfectionistSortClasses = {
11332
11369
  matchesAstSelector?: string;
11333
11370
  };
11334
11371
  useExperimentalDependencyDetection?: boolean;
11372
+ newlinesBetweenOverloadSignatures?: ("ignore" | number);
11335
11373
  ignoreCallbackDependenciesPatterns?: (({
11336
11374
  pattern: string;
11337
11375
  flags?: string;
@@ -12695,6 +12733,7 @@ type PerfectionistSortModules = [] | [{
12695
12733
  })[];
12696
12734
  newlinesBetween?: ("ignore" | number);
12697
12735
  useExperimentalDependencyDetection?: boolean;
12736
+ newlinesBetweenOverloadSignatures?: ("ignore" | number);
12698
12737
  partitionByComment?: (boolean | (({
12699
12738
  pattern: string;
12700
12739
  flags?: string;
@@ -13684,15 +13723,9 @@ type Quotes = [] | [("single" | "double" | "backtick")] | [("single" | "double"
13684
13723
  avoidEscape?: boolean;
13685
13724
  allowTemplateLiterals?: boolean;
13686
13725
  })]; // ----- radix -----
13687
- type Radix = [] | [("always" | "as-needed")]; // ----- react-hooks/automatic-effect-dependencies -----
13688
- type ReactHooksAutomaticEffectDependencies = [] | [{
13689
- [k: string]: unknown | undefined;
13690
- }]; // ----- react-hooks/capitalized-calls -----
13726
+ type Radix = [] | [("always" | "as-needed")]; // ----- react-hooks/capitalized-calls -----
13691
13727
  type ReactHooksCapitalizedCalls = [] | [{
13692
13728
  [k: string]: unknown | undefined;
13693
- }]; // ----- react-hooks/component-hook-factories -----
13694
- type ReactHooksComponentHookFactories = [] | [{
13695
- [k: string]: unknown | undefined;
13696
13729
  }]; // ----- react-hooks/config -----
13697
13730
  type ReactHooksConfig = [] | [{
13698
13731
  [k: string]: unknown | undefined;
@@ -13705,12 +13738,12 @@ type ReactHooksExhaustiveDeps = [] | [{
13705
13738
  enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean;
13706
13739
  experimental_autoDependenciesHooks?: string[];
13707
13740
  requireExplicitEffectDeps?: boolean;
13741
+ }]; // ----- react-hooks/exhaustive-effect-dependencies -----
13742
+ type ReactHooksExhaustiveEffectDependencies = [] | [{
13743
+ [k: string]: unknown | undefined;
13708
13744
  }]; // ----- react-hooks/fbt -----
13709
13745
  type ReactHooksFbt = [] | [{
13710
13746
  [k: string]: unknown | undefined;
13711
- }]; // ----- react-hooks/fire -----
13712
- type ReactHooksFire = [] | [{
13713
- [k: string]: unknown | undefined;
13714
13747
  }]; // ----- react-hooks/gating -----
13715
13748
  type ReactHooksGating = [] | [{
13716
13749
  [k: string]: unknown | undefined;
@@ -13729,6 +13762,9 @@ type ReactHooksIncompatibleLibrary = [] | [{
13729
13762
  }]; // ----- react-hooks/invariant -----
13730
13763
  type ReactHooksInvariant = [] | [{
13731
13764
  [k: string]: unknown | undefined;
13765
+ }]; // ----- react-hooks/memo-dependencies -----
13766
+ type ReactHooksMemoDependencies = [] | [{
13767
+ [k: string]: unknown | undefined;
13732
13768
  }]; // ----- react-hooks/memoized-effect-dependencies -----
13733
13769
  type ReactHooksMemoizedEffectDependencies = [] | [{
13734
13770
  [k: string]: unknown | undefined;
@@ -19771,6 +19807,9 @@ type VueNoIrregularWhitespace = [] | [{
19771
19807
  skipRegExps?: boolean;
19772
19808
  skipHTMLAttributeValues?: boolean;
19773
19809
  skipHTMLTextContents?: boolean;
19810
+ }]; // ----- vue/no-literals-in-template -----
19811
+ type VueNoLiteralsInTemplate = [] | [{
19812
+ ignores?: string[];
19774
19813
  }]; // ----- vue/no-lone-template -----
19775
19814
  type VueNoLoneTemplate = [] | [{
19776
19815
  ignoreAccessible?: boolean;
@@ -19925,7 +19964,7 @@ type VueNoUnusedComponents = [] | [{
19925
19964
  ignoreWhenBindingPresent?: boolean;
19926
19965
  }]; // ----- vue/no-unused-properties -----
19927
19966
  type VueNoUnusedProperties = [] | [{
19928
- groups?: ("props" | "data" | "asyncData" | "computed" | "methods" | "setup")[];
19967
+ groups?: ("props" | "data" | "asyncData" | "computed" | "methods" | "setup" | "inject")[];
19929
19968
  deepData?: boolean;
19930
19969
  ignorePublicMembers?: boolean;
19931
19970
  unreferencedOptions?: ("unknownMemberAsUnreferenced" | "returnAsUnreferenced")[];
@@ -20628,6 +20667,46 @@ type TagSelector = {
20628
20667
  type TailwindCSSBetterSelector = AttributeSelector | CalleeSelector | TagSelector | VariableSelector;
20629
20668
  interface OptionsTailwindCSSBetter {
20630
20669
  settings?: {
20670
+ /**
20671
+ * The working directory used to resolve tailwindcss and related config files. This is useful for monorepos where linting runs from the repository root but each project has its own node_modules and Tailwind setup.
20672
+ *
20673
+ * This path is resolved relative to the current working directory of the ESLint process. If not specified, it falls back to the current working directory of the ESLint process.
20674
+ *
20675
+ * You can configure settings["better-tailwindcss"].cwd per file group so the plugin resolves tailwindcss and config files from the correct project directory.
20676
+ *
20677
+ * @example
20678
+ * ```ts
20679
+ * // eslint.config.ts
20680
+ * export default [
20681
+ * {
20682
+ * files: ["packages/website/**\/*.{js,jsx,cjs,mjs,ts,tsx}"],
20683
+ * settings: {
20684
+ * "better-tailwindcss": {
20685
+ * cwd: "./packages/website"
20686
+ * }
20687
+ * }
20688
+ * },
20689
+ * {
20690
+ * files: ["packages/app/**\/*.{js,jsx,cjs,mjs,ts,tsx}"],
20691
+ * settings: {
20692
+ * "better-tailwindcss": {
20693
+ * cwd: "./packages/app"
20694
+ * }
20695
+ * }
20696
+ * }
20697
+ * ];
20698
+ * ```
20699
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#cwd
20700
+ */
20701
+ cwd?: string;
20702
+ /**
20703
+ * Tailwind CSS v4 allows you to define custom component classes like `card`, `btn`, `badge` etc.
20704
+ *
20705
+ * If you want to create such classes, you can set this option to `true` to allow the rule to detect those classes and not report them as unknown classes.
20706
+ *
20707
+ * @default false
20708
+ */
20709
+ detectComponentClasses?: boolean;
20631
20710
  /**
20632
20711
  * The path to the entry file of the css based tailwind config (eg: src/global.css).
20633
20712
  * If not specified, the plugin will fall back to the default configuration.
@@ -21029,4 +21108,4 @@ interface OptionsConfig extends OptionsComponentExts, OptionsComponentExtsTypeAw
21029
21108
  type ExtractOptions<TUnion> = Extract<TUnion, object>;
21030
21109
  //#endregion
21031
21110
  export { RuleOptions as A, OptionsTypeScriptErasableOnly as C, OptionsVue as D, OptionsTypescript as E, TypedFlatConfigItem as O, OptionsTanstack as S, OptionsTypeScriptWithTypes as T, OptionsReact as _, OptionsConfig as a, OptionsTailwindCSS as b, OptionsHasJsx as c, OptionsJSX as d, OptionsMarkdown as f, OptionsPnpm as g, OptionsOverridesMultiple as h, OptionsComponentExtsTypeAware as i, ConfigNames as k, OptionsHasTypeScript as l, OptionsOverrides as m, OptionsAppType as n, OptionsE18e as o, OptionsNode as p, OptionsComponentExts as r, OptionsFiles as s, ExtractOptions as t, OptionsIsInEditor as u, OptionsRegExp as v, OptionsTypeScriptParserOptions as w, OptionsTailwindCSSBetter as x, OptionsStylistic as y };
21032
- //# sourceMappingURL=index-H4NJ8Uyl.d.ts.map
21111
+ //# sourceMappingURL=index-D2ucqYld.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as RuleOptions, C as OptionsTypeScriptErasableOnly, D as OptionsVue, E as OptionsTypescript, O as TypedFlatConfigItem, S as OptionsTanstack, T as OptionsTypeScriptWithTypes, _ as OptionsReact, a as OptionsConfig, b as OptionsTailwindCSS, c as OptionsHasJsx, d as OptionsJSX, f as OptionsMarkdown, g as OptionsPnpm, h as OptionsOverridesMultiple, i as OptionsComponentExtsTypeAware, k as ConfigNames, l as OptionsHasTypeScript, m as OptionsOverrides, n as OptionsAppType, o as OptionsE18e, p as OptionsNode, r as OptionsComponentExts, s as OptionsFiles, t as ExtractOptions, u as OptionsIsInEditor, v as OptionsRegExp, w as OptionsTypeScriptParserOptions, x as OptionsTailwindCSSBetter, y as OptionsStylistic } from "./index-H4NJ8Uyl.js";
1
+ import { A as RuleOptions, C as OptionsTypeScriptErasableOnly, D as OptionsVue, E as OptionsTypescript, O as TypedFlatConfigItem, S as OptionsTanstack, T as OptionsTypeScriptWithTypes, _ as OptionsReact, a as OptionsConfig, b as OptionsTailwindCSS, c as OptionsHasJsx, d as OptionsJSX, f as OptionsMarkdown, g as OptionsPnpm, h as OptionsOverridesMultiple, i as OptionsComponentExtsTypeAware, k as ConfigNames, l as OptionsHasTypeScript, m as OptionsOverrides, n as OptionsAppType, o as OptionsE18e, p as OptionsNode, r as OptionsComponentExts, s as OptionsFiles, t as ExtractOptions, u as OptionsIsInEditor, v as OptionsRegExp, w as OptionsTypeScriptParserOptions, x as OptionsTailwindCSSBetter, y as OptionsStylistic } from "./index-D2ucqYld.js";
2
2
  import { Awaitable } from "@zayne-labs/toolkit-type-helpers";
3
3
  import { FlatConfigComposer } from "eslint-flat-config-utils";
4
4
  import { Linter } from "eslint";
package/dist/index.js CHANGED
@@ -150,10 +150,9 @@ const command = async () => {
150
150
  //#region src/configs/comments.ts
151
151
  const comments = async (options = {}) => {
152
152
  const { overrides, type = "app" } = options;
153
- const eslintPluginComments = await interopDefault(import("@eslint-community/eslint-plugin-eslint-comments"));
154
153
  return [{
155
154
  name: "zayne/eslint-comments/rules",
156
- plugins: { "eslint-comments": eslintPluginComments },
155
+ plugins: { "eslint-comments": await interopDefault(import("@eslint-community/eslint-plugin-eslint-comments")) },
157
156
  rules: {
158
157
  "eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }],
159
158
  "eslint-comments/no-aggregating-enable": "error",
@@ -1079,6 +1078,7 @@ const react = async (options = {}) => {
1079
1078
  "react/no-children-count": "off",
1080
1079
  "react/no-children-only": "off",
1081
1080
  "react/no-clone-element": "off",
1081
+ "react/set-state-in-effect": "off",
1082
1082
  "react/exhaustive-deps": "warn",
1083
1083
  "react/rules-of-hooks": "error",
1084
1084
  ...overrides,
@@ -1090,7 +1090,6 @@ const react = async (options = {}) => {
1090
1090
  name: "zayne/react/official/compiler/rules",
1091
1091
  rules: {
1092
1092
  "react-hooks/capitalized-calls": "error",
1093
- "react-hooks/component-hook-factories": "off",
1094
1093
  "react-hooks/config": "error",
1095
1094
  "react-hooks/error-boundaries": "error",
1096
1095
  "react-hooks/gating": "error",
@@ -1103,7 +1102,7 @@ const react = async (options = {}) => {
1103
1102
  "react-hooks/purity": "warn",
1104
1103
  "react-hooks/refs": "error",
1105
1104
  "react-hooks/rule-suppression": "off",
1106
- "react-hooks/set-state-in-effect": "off",
1105
+ "react-hooks/set-state-in-effect": "warn",
1107
1106
  "react-hooks/set-state-in-render": "error",
1108
1107
  "react-hooks/static-components": "error",
1109
1108
  "react-hooks/syntax": "error",
@@ -1453,8 +1452,8 @@ const tailwindcssBetter = async (options = {}) => {
1453
1452
  name: "zayne/tailwindcss-better/setup",
1454
1453
  plugins: { "tailwindcss-better": eslintPluginBetterTailwindCss },
1455
1454
  settings: { "better-tailwindcss": {
1455
+ entryPoint: zayneDefaultSettings.entryPoint,
1456
1456
  ...tailwindCssBetterSettings,
1457
- entryPoint: tailwindCssBetterSettings?.entryPoint ?? zayneDefaultSettings.entryPoint,
1458
1457
  selectors: [
1459
1458
  ...defaults.getDefaultSelectors(),
1460
1459
  ...zayneDefaultSettings.selectors,
@@ -1588,6 +1587,10 @@ const typescript = async (options = {}) => {
1588
1587
  },
1589
1588
  tsconfigRootDir: process.cwd()
1590
1589
  } : {
1590
+ /**
1591
+ * @default true for auto-discovery of project's tsconfig as fallback
1592
+ * @see https://typescript-eslint.io/blog/parser-options-project-true
1593
+ */
1591
1594
  project: tsconfigPath,
1592
1595
  tsconfigRootDir: process.cwd()
1593
1596
  }),
@@ -1732,6 +1735,10 @@ const vue = async (options = {}) => {
1732
1735
  ]);
1733
1736
  return [
1734
1737
  {
1738
+ /**
1739
+ * This allows Vue plugin to work with auto imports
1740
+ * @ see https://github.com/vuejs/eslint-plugin-vue/pull/2422
1741
+ */
1735
1742
  languageOptions: { globals: {
1736
1743
  computed: "readonly",
1737
1744
  defineEmits: "readonly",