eslint-config-functype 2.0.0 → 2.0.1
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/list-rules.js +2 -4
- package/dist/cli/list-rules.js.map +1 -1
- package/dist/configs/recommended.d.ts +4 -5
- package/dist/configs/recommended.js +3 -7
- package/dist/configs/recommended.js.map +1 -1
- package/dist/configs/strict.d.ts +3 -1
- package/dist/configs/strict.js +1 -2
- package/dist/configs/strict.js.map +1 -1
- package/dist/configs/test-overrides.d.ts +14 -0
- package/dist/configs/test-overrides.js +21 -0
- package/dist/configs/test-overrides.js.map +1 -0
- package/dist/index.d.ts +17 -6
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/utils/dependency-validator.js +1 -1
- package/package.json +36 -33
- package/LICENSE +0 -21
- package/README.md +0 -245
package/dist/cli/list-rules.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
5
|
-
|
|
6
5
|
//#region src/utils/dependency-validator.ts
|
|
7
6
|
const PEER_DEPENDENCIES = [
|
|
8
7
|
{
|
|
@@ -69,7 +68,6 @@ function validatePeerDependencies() {
|
|
|
69
68
|
warnings
|
|
70
69
|
};
|
|
71
70
|
}
|
|
72
|
-
|
|
73
71
|
//#endregion
|
|
74
72
|
//#region src/cli/list-rules.ts
|
|
75
73
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
@@ -444,7 +442,7 @@ main().catch((error) => {
|
|
|
444
442
|
console.error(colorize("❌ Unexpected error:", "red"), error);
|
|
445
443
|
process.exit(1);
|
|
446
444
|
});
|
|
447
|
-
|
|
448
445
|
//#endregion
|
|
449
|
-
export {
|
|
446
|
+
export {};
|
|
447
|
+
|
|
450
448
|
//# sourceMappingURL=list-rules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-rules.js","names":[],"sources":["../../src/utils/dependency-validator.ts","../../src/cli/list-rules.ts"],"sourcesContent":["// Utility to validate peer dependencies and provide helpful error messages\n\ninterface PeerDependency {\n name: string\n packageName: string\n description: string\n required: boolean\n}\n\nconst PEER_DEPENDENCIES: PeerDependency[] = [\n {\n name: \"@typescript-eslint/eslint-plugin\",\n packageName: \"@typescript-eslint/eslint-plugin\",\n description: \"TypeScript-aware ESLint rules\",\n required: true,\n },\n {\n name: \"@typescript-eslint/parser\",\n packageName: \"@typescript-eslint/parser\",\n description: \"TypeScript parser for ESLint\",\n required: true,\n },\n {\n name: \"eslint-plugin-functional\",\n packageName: \"eslint-plugin-functional\",\n description: \"Functional programming ESLint rules\",\n required: true,\n },\n {\n name: \"eslint-plugin-prettier\",\n packageName: \"eslint-plugin-prettier\",\n description: \"Code formatting rules\",\n required: false,\n },\n {\n name: \"eslint-plugin-simple-import-sort\",\n packageName: \"eslint-plugin-simple-import-sort\",\n description: \"Import sorting rules\",\n required: false,\n },\n {\n name: \"prettier\",\n packageName: \"prettier\",\n description: \"Code formatter\",\n required: false,\n },\n]\n\nexport interface ValidationResult {\n isValid: boolean\n missing: PeerDependency[]\n available: PeerDependency[]\n installCommand: string\n warnings: string[]\n}\n\nfunction tryResolve(packageName: string): boolean {\n try {\n import.meta.resolve(packageName)\n return true\n } catch {\n return false\n }\n}\n\nexport function validatePeerDependencies(): ValidationResult {\n const missing: PeerDependency[] = []\n const available: PeerDependency[] = []\n const warnings: string[] = []\n\n for (const dep of PEER_DEPENDENCIES) {\n if (tryResolve(dep.packageName)) {\n available.push(dep)\n } else {\n missing.push(dep)\n if (dep.required) {\n // Required dependency is missing - this will cause errors\n } else {\n // Optional dependency is missing - add warning\n warnings.push(`Optional plugin '${dep.name}' not found. Some rules will be skipped.`)\n }\n }\n }\n\n const requiredMissing = missing.filter((dep) => dep.required)\n const isValid = requiredMissing.length === 0\n\n // Generate install command for missing dependencies\n const missingPackageNames = missing.map((dep) => dep.packageName)\n const installCommand = missingPackageNames.length > 0 ? `pnpm add -D ${missingPackageNames.join(\" \")}` : \"\"\n\n return {\n isValid,\n missing,\n available,\n installCommand,\n warnings,\n }\n}\n\nexport function createValidationError(result: ValidationResult): Error {\n const requiredMissing = result.missing.filter((dep) => dep.required)\n\n if (requiredMissing.length === 0) {\n return new Error(\"No validation errors\")\n }\n\n const missingList = requiredMissing.map((dep) => ` • ${dep.name} - ${dep.description}`).join(\"\\n\")\n\n const message = [\n \"❌ Missing required peer dependencies for eslint-config-functype:\",\n \"\",\n missingList,\n \"\",\n \"📦 Install missing dependencies:\",\n ` ${result.installCommand}`,\n \"\",\n \"📖 See installation guide: https://github.com/jordanburke/eslint-config-functype#installation\",\n ].join(\"\\n\")\n\n return new Error(message)\n}\n\nexport function shouldValidateDependencies(): boolean {\n // Skip validation in test environments or when explicitly disabled\n return process.env.NODE_ENV !== \"test\" && process.env.FUNCTYPE_SKIP_VALIDATION !== \"true\"\n}\n","import fs from \"node:fs\"\nimport path from \"node:path\"\nimport { fileURLToPath, pathToFileURL } from \"node:url\"\n\nimport { validatePeerDependencies, type ValidationResult } from \"../utils/dependency-validator\"\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url))\n\n// Types for better type safety\ntype RuleSeverity = \"off\" | \"warn\" | \"error\" | 0 | 1 | 2\ntype RuleConfig = RuleSeverity | [RuleSeverity, ...unknown[]]\n\ninterface RuleData {\n severity: RuleSeverity\n options: unknown[]\n source: string\n}\n\ninterface Config {\n rules?: Record<string, RuleConfig>\n extends?: string[]\n plugins?: string[]\n}\n\ninterface LoadedConfig {\n name: string\n rules: Map<string, RuleData>\n}\n\ninterface RuleDiff {\n name: string\n status: \"added\" | \"removed\" | \"different\" | \"same\"\n localSeverity?: RuleSeverity\n functypeSeverity?: RuleSeverity\n localOptions?: unknown[]\n functypeOptions?: unknown[]\n}\n\n// Colors for console output\nconst colors = {\n reset: \"\\x1b[0m\",\n bright: \"\\x1b[1m\",\n red: \"\\x1b[31m\",\n green: \"\\x1b[32m\",\n yellow: \"\\x1b[33m\",\n blue: \"\\x1b[34m\",\n magenta: \"\\x1b[35m\",\n cyan: \"\\x1b[36m\",\n} as const\n\nfunction colorize(text: string, color: keyof typeof colors): string {\n return colors[color] + text + colors.reset\n}\n\nasync function loadConfig(configPath: string): Promise<Config | null> {\n try {\n const resolvedPath = path.resolve(configPath)\n const configModule = await import(pathToFileURL(resolvedPath).href)\n return configModule.default || configModule\n } catch (error) {\n console.error(colorize(`Error loading config from ${configPath}:`, \"red\"), (error as Error).message)\n return null\n }\n}\n\nfunction extractRules(config: Config): Map<string, RuleData> {\n const rules = new Map<string, RuleData>()\n\n if (config.rules) {\n Object.entries(config.rules).forEach(([ruleName, ruleConfig]) => {\n const severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig\n const options = Array.isArray(ruleConfig) ? ruleConfig.slice(1) : []\n\n rules.set(ruleName, {\n severity,\n options,\n source: getRuleSource(ruleName),\n })\n })\n }\n\n return rules\n}\n\nfunction getRuleSource(ruleName: string): string {\n if (ruleName.startsWith(\"functional/\")) return \"eslint-plugin-functional\"\n if (ruleName.startsWith(\"@typescript-eslint/\")) return \"@typescript-eslint/eslint-plugin\"\n return \"eslint (core)\"\n}\n\nfunction getSeverityColor(severity: RuleSeverity): keyof typeof colors {\n switch (severity) {\n case \"error\":\n case 2:\n return \"red\"\n case \"warn\":\n case 1:\n return \"yellow\"\n case \"off\":\n case 0:\n return \"cyan\"\n default:\n return \"reset\"\n }\n}\n\nfunction formatSeverity(severity: RuleSeverity): string {\n const severityMap: Record<string, string> = {\n \"0\": \"off\",\n \"1\": \"warn\",\n \"2\": \"error\",\n off: \"off\",\n warn: \"warn\",\n error: \"error\",\n }\n return severityMap[String(severity)] || String(severity)\n}\n\nfunction printRules(configName: string, rules: Map<string, RuleData>): void {\n console.log(colorize(`\\n📋 ${configName} Configuration Rules:`, \"bright\"))\n console.log(colorize(\"=\".repeat(50), \"blue\"))\n\n // Group rules by source\n const rulesBySource = new Map<string, Map<string, RuleData>>()\n rules.forEach((ruleData, ruleName) => {\n const source = ruleData.source\n if (!rulesBySource.has(source)) {\n rulesBySource.set(source, new Map())\n }\n rulesBySource.get(source)!.set(ruleName, ruleData)\n })\n\n // Print rules grouped by source\n rulesBySource.forEach((sourceRules, source) => {\n console.log(colorize(`\\n📦 ${source}:`, \"magenta\"))\n\n sourceRules.forEach((ruleData, ruleName) => {\n const shortName = ruleName.replace(/^.*\\//, \"\")\n const severity = formatSeverity(ruleData.severity)\n const severityColored = colorize(`[${severity.toUpperCase()}]`, getSeverityColor(ruleData.severity))\n const hasOptions = ruleData.options && ruleData.options.length > 0\n const optionsText = hasOptions ? colorize(\" (with options)\", \"cyan\") : \"\"\n\n console.log(` ${severityColored} ${colorize(shortName, \"green\")}${optionsText}`)\n\n if (hasOptions && process.argv.includes(\"--verbose\")) {\n console.log(` ${colorize(\"Options:\", \"cyan\")} ${JSON.stringify(ruleData.options)}`)\n }\n })\n })\n}\n\nfunction printSummary(configs: LoadedConfig[]): void {\n console.log(colorize(\"\\n📊 Summary:\", \"bright\"))\n console.log(colorize(\"=\".repeat(30), \"blue\"))\n\n configs.forEach(({ name, rules }) => {\n const totalRules = rules.size\n const errorRules = Array.from(rules.values()).filter((r) => r.severity === \"error\" || r.severity === 2).length\n const warnRules = Array.from(rules.values()).filter((r) => r.severity === \"warn\" || r.severity === 1).length\n const offRules = Array.from(rules.values()).filter((r) => r.severity === \"off\" || r.severity === 0).length\n\n console.log(`\\n${colorize(name, \"bright\")}: ${totalRules} total rules`)\n console.log(` ${colorize(\"●\", \"red\")} ${errorRules} errors`)\n console.log(` ${colorize(\"●\", \"yellow\")} ${warnRules} warnings`)\n console.log(` ${colorize(\"●\", \"cyan\")} ${offRules} disabled`)\n })\n}\n\nfunction printUsageInfo(): void {\n console.log(colorize(\"\\n💡 Usage Information:\", \"bright\"))\n console.log(colorize(\"=\".repeat(30), \"blue\"))\n console.log(\"\\n📖 How to use these configurations:\")\n console.log(\"\\n\" + colorize(\"ESLint 8 (.eslintrc):\", \"green\"))\n console.log(' extends: [\"plugin:functype/recommended\"]')\n console.log(\"\\n\" + colorize(\"ESLint 9+ (flat config):\", \"green\"))\n console.log(\" Copy the rules from our documentation into your eslint.config.js\")\n console.log(\"\\n\" + colorize(\"Individual rules:\", \"green\"))\n console.log(\" You can enable any rule individually in your rules section\")\n}\n\nfunction printDependencyStatus(result: ValidationResult): void {\n console.log(colorize(\"\\n🔍 Dependency Status Check:\", \"bright\"))\n console.log(colorize(\"=\".repeat(40), \"blue\"))\n\n // Show available dependencies\n if (result.available.length > 0) {\n console.log(colorize(\"\\n✅ Available:\", \"green\"))\n result.available.forEach((dep) => {\n const icon = dep.required ? \"🔧\" : \"🔌\"\n console.log(` ${icon} ${colorize(dep.name, \"green\")} - ${dep.description}`)\n })\n }\n\n // Show missing dependencies\n if (result.missing.length > 0) {\n console.log(colorize(\"\\n❌ Missing:\", \"red\"))\n result.missing.forEach((dep) => {\n const icon = dep.required ? \"⚠️ \" : \"💡\"\n const color = dep.required ? \"red\" : \"yellow\"\n console.log(` ${icon} ${colorize(dep.name, color)} - ${dep.description}`)\n })\n\n if (result.installCommand) {\n console.log(colorize(\"\\n📦 Install missing dependencies:\", \"bright\"))\n console.log(` ${colorize(result.installCommand, \"cyan\")}`)\n }\n }\n\n // Show warnings\n if (result.warnings.length > 0) {\n console.log(colorize(\"\\n⚠️ Warnings:\", \"yellow\"))\n result.warnings.forEach((warning) => console.log(` ${warning}`))\n }\n\n // Overall status\n const status = result.isValid ? \"✅ Ready to use\" : \"❌ Configuration will fail\"\n const statusColor = result.isValid ? \"green\" : \"red\"\n console.log(colorize(`\\n${status}`, statusColor))\n}\n\nasync function loadLocalESLintConfig(configPath: string): Promise<Config | null> {\n try {\n // Try common ESLint config file names if no path provided\n const possibleConfigs = [\n \"eslint.config.js\",\n \"eslint.config.mjs\",\n \"eslint.config.ts\",\n \".eslintrc.js\",\n \".eslintrc.json\",\n ]\n\n let actualPath = configPath\n if (!configPath) {\n // Search for config file in current directory\n for (const filename of possibleConfigs) {\n if (fs.existsSync(filename)) {\n actualPath = filename\n break\n }\n }\n if (!actualPath) {\n console.log(colorize(\"❌ No ESLint config file found. Searched for:\", \"red\"))\n possibleConfigs.forEach((f) => console.log(` • ${f}`))\n return null\n }\n }\n\n console.log(colorize(`📖 Loading local config: ${actualPath}`, \"cyan\"))\n\n // Handle flat config (eslint.config.js)\n if (actualPath.includes(\"eslint.config\")) {\n const configModule = await import(path.resolve(actualPath))\n const config = configModule.default || configModule\n\n // Flat config is array of config objects, merge rules\n if (Array.isArray(config)) {\n const mergedRules: Record<string, RuleConfig> = {}\n config.forEach((cfg: unknown) => {\n if (cfg && typeof cfg === \"object\" && \"rules\" in cfg) {\n const configObj = cfg as Config\n if (configObj.rules) {\n Object.assign(mergedRules, configObj.rules)\n }\n }\n })\n return { rules: mergedRules }\n }\n return config\n }\n\n // Handle legacy config (.eslintrc.*)\n return await loadConfig(actualPath)\n } catch (error) {\n console.error(colorize(`Error loading local config:`, \"red\"), (error as Error).message)\n return null\n }\n}\n\nfunction compareRules(localRules: Map<string, RuleData>, functypeRules: Map<string, RuleData>): RuleDiff[] {\n const allRules = new Set([...localRules.keys(), ...functypeRules.keys()])\n const diffs: RuleDiff[] = []\n\n allRules.forEach((ruleName) => {\n const localRule = localRules.get(ruleName)\n const functypeRule = functypeRules.get(ruleName)\n\n if (!localRule && functypeRule) {\n // Rule added by functype\n diffs.push({\n name: ruleName,\n status: \"added\",\n functypeSeverity: functypeRule.severity,\n functypeOptions: functypeRule.options,\n })\n } else if (localRule && !functypeRule) {\n // Rule exists locally but not in functype\n diffs.push({\n name: ruleName,\n status: \"removed\",\n localSeverity: localRule.severity,\n localOptions: localRule.options,\n })\n } else if (localRule && functypeRule) {\n // Compare configurations\n const severityDifferent = localRule.severity !== functypeRule.severity\n const optionsDifferent = JSON.stringify(localRule.options) !== JSON.stringify(functypeRule.options)\n\n if (severityDifferent || optionsDifferent) {\n diffs.push({\n name: ruleName,\n status: \"different\",\n localSeverity: localRule.severity,\n functypeSeverity: functypeRule.severity,\n localOptions: localRule.options,\n functypeOptions: functypeRule.options,\n })\n } else {\n diffs.push({\n name: ruleName,\n status: \"same\",\n localSeverity: localRule.severity,\n functypeSeverity: functypeRule.severity,\n })\n }\n }\n })\n\n return diffs.sort((a, b) => a.name.localeCompare(b.name))\n}\n\nfunction printDiff(diffs: RuleDiff[], functypeConfigName: string): void {\n console.log(colorize(`\\n🔄 Config Comparison vs ${functypeConfigName}:`, \"bright\"))\n console.log(colorize(\"=\".repeat(60), \"blue\"))\n\n const categories = {\n removed: diffs.filter((d) => d.status === \"removed\"),\n added: diffs.filter((d) => d.status === \"added\"),\n different: diffs.filter((d) => d.status === \"different\"),\n same: diffs.filter((d) => d.status === \"same\"),\n }\n\n // Rules you can remove (covered by functype)\n if (categories.same.length > 0) {\n console.log(colorize(\"\\n✅ Rules you can remove (covered by functype):\", \"green\"))\n categories.same.forEach((diff) => {\n const severity = formatSeverity(diff.functypeSeverity!)\n console.log(` • ${diff.name} (${severity})`)\n })\n }\n\n // New rules functype adds\n if (categories.added.length > 0) {\n console.log(colorize(\"\\n➕ New rules functype adds:\", \"blue\"))\n categories.added.forEach((diff) => {\n const severity = formatSeverity(diff.functypeSeverity!)\n const severityColored = colorize(`[${severity.toUpperCase()}]`, getSeverityColor(diff.functypeSeverity!))\n console.log(` • ${diff.name} ${severityColored}`)\n })\n }\n\n // Rules with conflicts\n if (categories.different.length > 0) {\n console.log(colorize(\"\\n🔀 Conflicting rules (will override functype):\", \"yellow\"))\n categories.different.forEach((diff) => {\n const localSeverity = formatSeverity(diff.localSeverity!)\n const functypeSeverity = formatSeverity(diff.functypeSeverity!)\n console.log(` • ${diff.name}`)\n console.log(` Local: ${localSeverity}`)\n console.log(` Functype: ${functypeSeverity}`)\n })\n }\n\n // Rules you have that functype doesn't\n if (categories.removed.length > 0) {\n console.log(colorize(\"\\n➖ Your additional rules (not in functype):\", \"magenta\"))\n categories.removed.forEach((diff) => {\n const severity = formatSeverity(diff.localSeverity!)\n console.log(` • ${diff.name} (${severity})`)\n })\n }\n\n // Summary stats\n console.log(colorize(\"\\n📊 Migration Summary:\", \"bright\"))\n console.log(` ${categories.same.length} rules can be removed`)\n console.log(` ${categories.added.length} new rules will be added`)\n console.log(` ${categories.different.length} rules have conflicts`)\n console.log(` ${categories.removed.length} additional rules you keep`)\n\n // Migration suggestions\n if (categories.same.length > 0 || categories.different.length > 0) {\n console.log(colorize(\"\\n💡 Suggested migration steps:\", \"bright\"))\n if (categories.same.length > 0) {\n console.log(\"1. Remove duplicate rules from your config (they match functype)\")\n }\n if (categories.different.length > 0) {\n console.log(\"2. Review conflicting rules - decide if you want local overrides\")\n }\n console.log('3. Add functype config: extends: [\"plugin:functype/recommended\"]')\n }\n}\n\nasync function runDiffMode(configPath: string): Promise<void> {\n console.log(colorize(\"🔄 ESLint Config Diff Mode\", \"bright\"))\n\n // Load local config\n const localConfig = await loadLocalESLintConfig(configPath)\n if (!localConfig) {\n console.error(colorize(\"❌ Could not load local ESLint config\", \"red\"))\n process.exit(1)\n }\n\n const localRules = extractRules(localConfig)\n console.log(colorize(`Found ${localRules.size} rules in local config`, \"cyan\"))\n\n // Load functype configs\n const distPath = path.join(__dirname, \"..\", \"..\", \"dist\")\n const configs = [\n { name: \"Recommended\", path: path.join(distPath, \"configs\", \"recommended.js\") },\n { name: \"Strict\", path: path.join(distPath, \"configs\", \"strict.js\") },\n ]\n\n for (const { name, path: configPath } of configs) {\n const functypeConfig = await loadConfig(configPath)\n if (functypeConfig) {\n const functypeRules = extractRules(functypeConfig)\n const diffs = compareRules(localRules, functypeRules)\n printDiff(diffs, name)\n }\n }\n}\n\nasync function main(): Promise<void> {\n const args = process.argv.slice(2)\n const showHelp = args.includes(\"--help\") || args.includes(\"-h\")\n const showUsage = args.includes(\"--usage\") || args.includes(\"-u\")\n const checkDeps = args.includes(\"--check-deps\") || args.includes(\"--check\")\n const diffMode = args.includes(\"--diff\")\n const diffConfigIndex = args.findIndex((arg) => arg === \"--diff\")\n const diffConfigPath = diffConfigIndex !== -1 && args[diffConfigIndex + 1] ? args[diffConfigIndex + 1] : \"\"\n\n if (showHelp) {\n console.log(colorize(\"📋 ESLint Plugin Functype - Rule Lister\", \"bright\"))\n console.log(\"\\nUsage: pnpm run list-rules [options]\")\n console.log(\"\\nOptions:\")\n console.log(\" --verbose, -v Show rule options\")\n console.log(\" --usage, -u Show usage examples\")\n console.log(\" --check-deps Check peer dependency status\")\n console.log(\" --diff [config] Compare local ESLint config with functype\")\n console.log(\" --help, -h Show this help message\")\n console.log(\"\\nThis command lists all rules configured in the functype plugin configurations.\")\n console.log(\"\\nDiff mode:\")\n console.log(\" --diff Auto-detect local ESLint config file\")\n console.log(\" --diff <path> Compare specific config file with functype\")\n return\n }\n\n // Handle diff mode\n if (diffMode) {\n await runDiffMode(diffConfigPath)\n return\n }\n\n // Handle dependency check\n if (checkDeps) {\n console.log(colorize(\"🔧 ESLint Plugin Functype - Dependency Check\", \"bright\"))\n const result = validatePeerDependencies()\n printDependencyStatus(result)\n\n if (!result.isValid) {\n process.exit(1)\n }\n return\n }\n\n console.log(colorize(\"🔧 ESLint Plugin Functype - Supported Rules\", \"bright\"))\n\n const distPath = path.join(__dirname, \"..\", \"..\", \"dist\")\n\n if (!fs.existsSync(distPath)) {\n console.error(colorize(\"❌ Build directory not found. Run `pnpm run build` first.\", \"red\"))\n process.exit(1)\n }\n\n const configs = [\n {\n name: \"Recommended\",\n path: path.join(distPath, \"configs\", \"recommended.js\"),\n },\n {\n name: \"Strict\",\n path: path.join(distPath, \"configs\", \"strict.js\"),\n },\n ]\n\n const loadedConfigs: LoadedConfig[] = []\n\n for (const { name, path: configPath } of configs) {\n const config = await loadConfig(configPath)\n if (config) {\n const rules = extractRules(config)\n loadedConfigs.push({ name, rules })\n printRules(name, rules)\n }\n }\n\n if (loadedConfigs.length > 0) {\n printSummary(loadedConfigs)\n\n if (showUsage) {\n printUsageInfo()\n }\n\n console.log(colorize(\"\\n💡 Tips:\", \"bright\"))\n console.log(\"• Use --verbose to see rule options\")\n console.log(\"• Use --usage to see configuration examples\")\n console.log(\"• Red rules will cause build failures\")\n console.log(\"• Yellow rules are warnings only\")\n console.log(\"• Blue rules are disabled by default\")\n\n console.log(colorize(\"\\n🔗 Links:\", \"bright\"))\n console.log(\"• Documentation: https://github.com/jordanburke/eslint-config-functype\")\n console.log(\"• eslint-plugin-functional: https://github.com/eslint-functional/eslint-plugin-functional\")\n console.log(\"• @typescript-eslint: https://typescript-eslint.io/\")\n }\n}\n\n// Run the CLI\nmain().catch((error) => {\n console.error(colorize(\"❌ Unexpected error:\", \"red\"), error)\n process.exit(1)\n})\n"],"mappings":";;;;;;AASA,MAAM,oBAAsC;CAC1C;EACE,MAAM;EACN,aAAa;EACb,aAAa;EACb,UAAU;EACX;CACD;EACE,MAAM;EACN,aAAa;EACb,aAAa;EACb,UAAU;EACX;CACD;EACE,MAAM;EACN,aAAa;EACb,aAAa;EACb,UAAU;EACX;CACD;EACE,MAAM;EACN,aAAa;EACb,aAAa;EACb,UAAU;EACX;CACD;EACE,MAAM;EACN,aAAa;EACb,aAAa;EACb,UAAU;EACX;CACD;EACE,MAAM;EACN,aAAa;EACb,aAAa;EACb,UAAU;EACX;CACF;AAUD,SAAS,WAAW,aAA8B;AAChD,KAAI;AACF,SAAO,KAAK,QAAQ,YAAY;AAChC,SAAO;SACD;AACN,SAAO;;;AAIX,SAAgB,2BAA6C;CAC3D,MAAM,UAA4B,EAAE;CACpC,MAAM,YAA8B,EAAE;CACtC,MAAM,WAAqB,EAAE;AAE7B,MAAK,MAAM,OAAO,kBAChB,KAAI,WAAW,IAAI,YAAY,CAC7B,WAAU,KAAK,IAAI;MACd;AACL,UAAQ,KAAK,IAAI;AACjB,MAAI,IAAI,UAAU,OAIhB,UAAS,KAAK,oBAAoB,IAAI,KAAK,0CAA0C;;CAM3F,MAAM,UADkB,QAAQ,QAAQ,QAAQ,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,UAAQ,IAAI,yEAAyE;AACrF,UAAQ,IAAI,4FAA4F;AACxG,UAAQ,IAAI,sDAAsD;;;AAKtE,MAAM,CAAC,OAAO,UAAU;AACtB,SAAQ,MAAM,SAAS,uBAAuB,MAAM,EAAE,MAAM;AAC5D,SAAQ,KAAK,EAAE;EACf"}
|
|
1
|
+
{"version":3,"file":"list-rules.js","names":[],"sources":["../../src/utils/dependency-validator.ts","../../src/cli/list-rules.ts"],"sourcesContent":["// Utility to validate peer dependencies and provide helpful error messages\n\ninterface PeerDependency {\n name: string\n packageName: string\n description: string\n required: boolean\n}\n\nconst PEER_DEPENDENCIES: PeerDependency[] = [\n {\n name: \"@typescript-eslint/eslint-plugin\",\n packageName: \"@typescript-eslint/eslint-plugin\",\n description: \"TypeScript-aware ESLint rules\",\n required: true,\n },\n {\n name: \"@typescript-eslint/parser\",\n packageName: \"@typescript-eslint/parser\",\n description: \"TypeScript parser for ESLint\",\n required: true,\n },\n {\n name: \"eslint-plugin-functional\",\n packageName: \"eslint-plugin-functional\",\n description: \"Functional programming ESLint rules\",\n required: true,\n },\n {\n name: \"eslint-plugin-prettier\",\n packageName: \"eslint-plugin-prettier\",\n description: \"Code formatting rules\",\n required: false,\n },\n {\n name: \"eslint-plugin-simple-import-sort\",\n packageName: \"eslint-plugin-simple-import-sort\",\n description: \"Import sorting rules\",\n required: false,\n },\n {\n name: \"prettier\",\n packageName: \"prettier\",\n description: \"Code formatter\",\n required: false,\n },\n]\n\nexport interface ValidationResult {\n isValid: boolean\n missing: PeerDependency[]\n available: PeerDependency[]\n installCommand: string\n warnings: string[]\n}\n\nfunction tryResolve(packageName: string): boolean {\n try {\n import.meta.resolve(packageName)\n return true\n } catch {\n return false\n }\n}\n\nexport function validatePeerDependencies(): ValidationResult {\n const missing: PeerDependency[] = []\n const available: PeerDependency[] = []\n const warnings: string[] = []\n\n for (const dep of PEER_DEPENDENCIES) {\n if (tryResolve(dep.packageName)) {\n available.push(dep)\n } else {\n missing.push(dep)\n if (dep.required) {\n // Required dependency is missing - this will cause errors\n } else {\n // Optional dependency is missing - add warning\n warnings.push(`Optional plugin '${dep.name}' not found. Some rules will be skipped.`)\n }\n }\n }\n\n const requiredMissing = missing.filter((dep) => dep.required)\n const isValid = requiredMissing.length === 0\n\n // Generate install command for missing dependencies\n const missingPackageNames = missing.map((dep) => dep.packageName)\n const installCommand = missingPackageNames.length > 0 ? `pnpm add -D ${missingPackageNames.join(\" \")}` : \"\"\n\n return {\n isValid,\n missing,\n available,\n installCommand,\n warnings,\n }\n}\n\nexport function createValidationError(result: ValidationResult): Error {\n const requiredMissing = result.missing.filter((dep) => dep.required)\n\n if (requiredMissing.length === 0) {\n return new Error(\"No validation errors\")\n }\n\n const missingList = requiredMissing.map((dep) => ` • ${dep.name} - ${dep.description}`).join(\"\\n\")\n\n const message = [\n \"❌ Missing required peer dependencies for eslint-config-functype:\",\n \"\",\n missingList,\n \"\",\n \"📦 Install missing dependencies:\",\n ` ${result.installCommand}`,\n \"\",\n \"📖 See installation guide: https://github.com/jordanburke/eslint-config-functype#installation\",\n ].join(\"\\n\")\n\n return new Error(message)\n}\n\nexport function shouldValidateDependencies(): boolean {\n // Skip validation in test environments or when explicitly disabled\n return process.env.NODE_ENV !== \"test\" && process.env.FUNCTYPE_SKIP_VALIDATION !== \"true\"\n}\n","import fs from \"node:fs\"\nimport path from \"node:path\"\nimport { fileURLToPath, pathToFileURL } from \"node:url\"\n\nimport { validatePeerDependencies, type ValidationResult } from \"../utils/dependency-validator\"\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url))\n\n// Types for better type safety\ntype RuleSeverity = \"off\" | \"warn\" | \"error\" | 0 | 1 | 2\ntype RuleConfig = RuleSeverity | [RuleSeverity, ...unknown[]]\n\ninterface RuleData {\n severity: RuleSeverity\n options: unknown[]\n source: string\n}\n\ninterface Config {\n rules?: Record<string, RuleConfig>\n extends?: string[]\n plugins?: string[]\n}\n\ninterface LoadedConfig {\n name: string\n rules: Map<string, RuleData>\n}\n\ninterface RuleDiff {\n name: string\n status: \"added\" | \"removed\" | \"different\" | \"same\"\n localSeverity?: RuleSeverity\n functypeSeverity?: RuleSeverity\n localOptions?: unknown[]\n functypeOptions?: unknown[]\n}\n\n// Colors for console output\nconst colors = {\n reset: \"\\x1b[0m\",\n bright: \"\\x1b[1m\",\n red: \"\\x1b[31m\",\n green: \"\\x1b[32m\",\n yellow: \"\\x1b[33m\",\n blue: \"\\x1b[34m\",\n magenta: \"\\x1b[35m\",\n cyan: \"\\x1b[36m\",\n} as const\n\nfunction colorize(text: string, color: keyof typeof colors): string {\n return colors[color] + text + colors.reset\n}\n\nasync function loadConfig(configPath: string): Promise<Config | null> {\n try {\n const resolvedPath = path.resolve(configPath)\n const configModule = await import(pathToFileURL(resolvedPath).href)\n return configModule.default || configModule\n } catch (error) {\n console.error(colorize(`Error loading config from ${configPath}:`, \"red\"), (error as Error).message)\n return null\n }\n}\n\nfunction extractRules(config: Config): Map<string, RuleData> {\n const rules = new Map<string, RuleData>()\n\n if (config.rules) {\n Object.entries(config.rules).forEach(([ruleName, ruleConfig]) => {\n const severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig\n const options = Array.isArray(ruleConfig) ? ruleConfig.slice(1) : []\n\n rules.set(ruleName, {\n severity,\n options,\n source: getRuleSource(ruleName),\n })\n })\n }\n\n return rules\n}\n\nfunction getRuleSource(ruleName: string): string {\n if (ruleName.startsWith(\"functional/\")) return \"eslint-plugin-functional\"\n if (ruleName.startsWith(\"@typescript-eslint/\")) return \"@typescript-eslint/eslint-plugin\"\n return \"eslint (core)\"\n}\n\nfunction getSeverityColor(severity: RuleSeverity): keyof typeof colors {\n switch (severity) {\n case \"error\":\n case 2:\n return \"red\"\n case \"warn\":\n case 1:\n return \"yellow\"\n case \"off\":\n case 0:\n return \"cyan\"\n default:\n return \"reset\"\n }\n}\n\nfunction formatSeverity(severity: RuleSeverity): string {\n const severityMap: Record<string, string> = {\n \"0\": \"off\",\n \"1\": \"warn\",\n \"2\": \"error\",\n off: \"off\",\n warn: \"warn\",\n error: \"error\",\n }\n return severityMap[String(severity)] || String(severity)\n}\n\nfunction printRules(configName: string, rules: Map<string, RuleData>): void {\n console.log(colorize(`\\n📋 ${configName} Configuration Rules:`, \"bright\"))\n console.log(colorize(\"=\".repeat(50), \"blue\"))\n\n // Group rules by source\n const rulesBySource = new Map<string, Map<string, RuleData>>()\n rules.forEach((ruleData, ruleName) => {\n const source = ruleData.source\n if (!rulesBySource.has(source)) {\n rulesBySource.set(source, new Map())\n }\n rulesBySource.get(source)!.set(ruleName, ruleData)\n })\n\n // Print rules grouped by source\n rulesBySource.forEach((sourceRules, source) => {\n console.log(colorize(`\\n📦 ${source}:`, \"magenta\"))\n\n sourceRules.forEach((ruleData, ruleName) => {\n const shortName = ruleName.replace(/^.*\\//, \"\")\n const severity = formatSeverity(ruleData.severity)\n const severityColored = colorize(`[${severity.toUpperCase()}]`, getSeverityColor(ruleData.severity))\n const hasOptions = ruleData.options && ruleData.options.length > 0\n const optionsText = hasOptions ? colorize(\" (with options)\", \"cyan\") : \"\"\n\n console.log(` ${severityColored} ${colorize(shortName, \"green\")}${optionsText}`)\n\n if (hasOptions && process.argv.includes(\"--verbose\")) {\n console.log(` ${colorize(\"Options:\", \"cyan\")} ${JSON.stringify(ruleData.options)}`)\n }\n })\n })\n}\n\nfunction printSummary(configs: LoadedConfig[]): void {\n console.log(colorize(\"\\n📊 Summary:\", \"bright\"))\n console.log(colorize(\"=\".repeat(30), \"blue\"))\n\n configs.forEach(({ name, rules }) => {\n const totalRules = rules.size\n const errorRules = Array.from(rules.values()).filter((r) => r.severity === \"error\" || r.severity === 2).length\n const warnRules = Array.from(rules.values()).filter((r) => r.severity === \"warn\" || r.severity === 1).length\n const offRules = Array.from(rules.values()).filter((r) => r.severity === \"off\" || r.severity === 0).length\n\n console.log(`\\n${colorize(name, \"bright\")}: ${totalRules} total rules`)\n console.log(` ${colorize(\"●\", \"red\")} ${errorRules} errors`)\n console.log(` ${colorize(\"●\", \"yellow\")} ${warnRules} warnings`)\n console.log(` ${colorize(\"●\", \"cyan\")} ${offRules} disabled`)\n })\n}\n\nfunction printUsageInfo(): void {\n console.log(colorize(\"\\n💡 Usage Information:\", \"bright\"))\n console.log(colorize(\"=\".repeat(30), \"blue\"))\n console.log(\"\\n📖 How to use these configurations:\")\n console.log(\"\\n\" + colorize(\"ESLint 8 (.eslintrc):\", \"green\"))\n console.log(' extends: [\"plugin:functype/recommended\"]')\n console.log(\"\\n\" + colorize(\"ESLint 9+ (flat config):\", \"green\"))\n console.log(\" Copy the rules from our documentation into your eslint.config.js\")\n console.log(\"\\n\" + colorize(\"Individual rules:\", \"green\"))\n console.log(\" You can enable any rule individually in your rules section\")\n}\n\nfunction printDependencyStatus(result: ValidationResult): void {\n console.log(colorize(\"\\n🔍 Dependency Status Check:\", \"bright\"))\n console.log(colorize(\"=\".repeat(40), \"blue\"))\n\n // Show available dependencies\n if (result.available.length > 0) {\n console.log(colorize(\"\\n✅ Available:\", \"green\"))\n result.available.forEach((dep) => {\n const icon = dep.required ? \"🔧\" : \"🔌\"\n console.log(` ${icon} ${colorize(dep.name, \"green\")} - ${dep.description}`)\n })\n }\n\n // Show missing dependencies\n if (result.missing.length > 0) {\n console.log(colorize(\"\\n❌ Missing:\", \"red\"))\n result.missing.forEach((dep) => {\n const icon = dep.required ? \"⚠️ \" : \"💡\"\n const color = dep.required ? \"red\" : \"yellow\"\n console.log(` ${icon} ${colorize(dep.name, color)} - ${dep.description}`)\n })\n\n if (result.installCommand) {\n console.log(colorize(\"\\n📦 Install missing dependencies:\", \"bright\"))\n console.log(` ${colorize(result.installCommand, \"cyan\")}`)\n }\n }\n\n // Show warnings\n if (result.warnings.length > 0) {\n console.log(colorize(\"\\n⚠️ Warnings:\", \"yellow\"))\n result.warnings.forEach((warning) => console.log(` ${warning}`))\n }\n\n // Overall status\n const status = result.isValid ? \"✅ Ready to use\" : \"❌ Configuration will fail\"\n const statusColor = result.isValid ? \"green\" : \"red\"\n console.log(colorize(`\\n${status}`, statusColor))\n}\n\nasync function loadLocalESLintConfig(configPath: string): Promise<Config | null> {\n try {\n // Try common ESLint config file names if no path provided\n const possibleConfigs = [\n \"eslint.config.js\",\n \"eslint.config.mjs\",\n \"eslint.config.ts\",\n \".eslintrc.js\",\n \".eslintrc.json\",\n ]\n\n let actualPath = configPath\n if (!configPath) {\n // Search for config file in current directory\n for (const filename of possibleConfigs) {\n if (fs.existsSync(filename)) {\n actualPath = filename\n break\n }\n }\n if (!actualPath) {\n console.log(colorize(\"❌ No ESLint config file found. Searched for:\", \"red\"))\n possibleConfigs.forEach((f) => console.log(` • ${f}`))\n return null\n }\n }\n\n console.log(colorize(`📖 Loading local config: ${actualPath}`, \"cyan\"))\n\n // Handle flat config (eslint.config.js)\n if (actualPath.includes(\"eslint.config\")) {\n const configModule = await import(path.resolve(actualPath))\n const config = configModule.default || configModule\n\n // Flat config is array of config objects, merge rules\n if (Array.isArray(config)) {\n const mergedRules: Record<string, RuleConfig> = {}\n config.forEach((cfg: unknown) => {\n if (cfg && typeof cfg === \"object\" && \"rules\" in cfg) {\n const configObj = cfg as Config\n if (configObj.rules) {\n Object.assign(mergedRules, configObj.rules)\n }\n }\n })\n return { rules: mergedRules }\n }\n return config\n }\n\n // Handle legacy config (.eslintrc.*)\n return await loadConfig(actualPath)\n } catch (error) {\n console.error(colorize(`Error loading local config:`, \"red\"), (error as Error).message)\n return null\n }\n}\n\nfunction compareRules(localRules: Map<string, RuleData>, functypeRules: Map<string, RuleData>): RuleDiff[] {\n const allRules = new Set([...localRules.keys(), ...functypeRules.keys()])\n const diffs: RuleDiff[] = []\n\n allRules.forEach((ruleName) => {\n const localRule = localRules.get(ruleName)\n const functypeRule = functypeRules.get(ruleName)\n\n if (!localRule && functypeRule) {\n // Rule added by functype\n diffs.push({\n name: ruleName,\n status: \"added\",\n functypeSeverity: functypeRule.severity,\n functypeOptions: functypeRule.options,\n })\n } else if (localRule && !functypeRule) {\n // Rule exists locally but not in functype\n diffs.push({\n name: ruleName,\n status: \"removed\",\n localSeverity: localRule.severity,\n localOptions: localRule.options,\n })\n } else if (localRule && functypeRule) {\n // Compare configurations\n const severityDifferent = localRule.severity !== functypeRule.severity\n const optionsDifferent = JSON.stringify(localRule.options) !== JSON.stringify(functypeRule.options)\n\n if (severityDifferent || optionsDifferent) {\n diffs.push({\n name: ruleName,\n status: \"different\",\n localSeverity: localRule.severity,\n functypeSeverity: functypeRule.severity,\n localOptions: localRule.options,\n functypeOptions: functypeRule.options,\n })\n } else {\n diffs.push({\n name: ruleName,\n status: \"same\",\n localSeverity: localRule.severity,\n functypeSeverity: functypeRule.severity,\n })\n }\n }\n })\n\n return diffs.sort((a, b) => a.name.localeCompare(b.name))\n}\n\nfunction printDiff(diffs: RuleDiff[], functypeConfigName: string): void {\n console.log(colorize(`\\n🔄 Config Comparison vs ${functypeConfigName}:`, \"bright\"))\n console.log(colorize(\"=\".repeat(60), \"blue\"))\n\n const categories = {\n removed: diffs.filter((d) => d.status === \"removed\"),\n added: diffs.filter((d) => d.status === \"added\"),\n different: diffs.filter((d) => d.status === \"different\"),\n same: diffs.filter((d) => d.status === \"same\"),\n }\n\n // Rules you can remove (covered by functype)\n if (categories.same.length > 0) {\n console.log(colorize(\"\\n✅ Rules you can remove (covered by functype):\", \"green\"))\n categories.same.forEach((diff) => {\n const severity = formatSeverity(diff.functypeSeverity!)\n console.log(` • ${diff.name} (${severity})`)\n })\n }\n\n // New rules functype adds\n if (categories.added.length > 0) {\n console.log(colorize(\"\\n➕ New rules functype adds:\", \"blue\"))\n categories.added.forEach((diff) => {\n const severity = formatSeverity(diff.functypeSeverity!)\n const severityColored = colorize(`[${severity.toUpperCase()}]`, getSeverityColor(diff.functypeSeverity!))\n console.log(` • ${diff.name} ${severityColored}`)\n })\n }\n\n // Rules with conflicts\n if (categories.different.length > 0) {\n console.log(colorize(\"\\n🔀 Conflicting rules (will override functype):\", \"yellow\"))\n categories.different.forEach((diff) => {\n const localSeverity = formatSeverity(diff.localSeverity!)\n const functypeSeverity = formatSeverity(diff.functypeSeverity!)\n console.log(` • ${diff.name}`)\n console.log(` Local: ${localSeverity}`)\n console.log(` Functype: ${functypeSeverity}`)\n })\n }\n\n // Rules you have that functype doesn't\n if (categories.removed.length > 0) {\n console.log(colorize(\"\\n➖ Your additional rules (not in functype):\", \"magenta\"))\n categories.removed.forEach((diff) => {\n const severity = formatSeverity(diff.localSeverity!)\n console.log(` • ${diff.name} (${severity})`)\n })\n }\n\n // Summary stats\n console.log(colorize(\"\\n📊 Migration Summary:\", \"bright\"))\n console.log(` ${categories.same.length} rules can be removed`)\n console.log(` ${categories.added.length} new rules will be added`)\n console.log(` ${categories.different.length} rules have conflicts`)\n console.log(` ${categories.removed.length} additional rules you keep`)\n\n // Migration suggestions\n if (categories.same.length > 0 || categories.different.length > 0) {\n console.log(colorize(\"\\n💡 Suggested migration steps:\", \"bright\"))\n if (categories.same.length > 0) {\n console.log(\"1. Remove duplicate rules from your config (they match functype)\")\n }\n if (categories.different.length > 0) {\n console.log(\"2. Review conflicting rules - decide if you want local overrides\")\n }\n console.log('3. Add functype config: extends: [\"plugin:functype/recommended\"]')\n }\n}\n\nasync function runDiffMode(configPath: string): Promise<void> {\n console.log(colorize(\"🔄 ESLint Config Diff Mode\", \"bright\"))\n\n // Load local config\n const localConfig = await loadLocalESLintConfig(configPath)\n if (!localConfig) {\n console.error(colorize(\"❌ Could not load local ESLint config\", \"red\"))\n process.exit(1)\n }\n\n const localRules = extractRules(localConfig)\n console.log(colorize(`Found ${localRules.size} rules in local config`, \"cyan\"))\n\n // Load functype configs\n const distPath = path.join(__dirname, \"..\", \"..\", \"dist\")\n const configs = [\n { name: \"Recommended\", path: path.join(distPath, \"configs\", \"recommended.js\") },\n { name: \"Strict\", path: path.join(distPath, \"configs\", \"strict.js\") },\n ]\n\n for (const { name, path: configPath } of configs) {\n const functypeConfig = await loadConfig(configPath)\n if (functypeConfig) {\n const functypeRules = extractRules(functypeConfig)\n const diffs = compareRules(localRules, functypeRules)\n printDiff(diffs, name)\n }\n }\n}\n\nasync function main(): Promise<void> {\n const args = process.argv.slice(2)\n const showHelp = args.includes(\"--help\") || args.includes(\"-h\")\n const showUsage = args.includes(\"--usage\") || args.includes(\"-u\")\n const checkDeps = args.includes(\"--check-deps\") || args.includes(\"--check\")\n const diffMode = args.includes(\"--diff\")\n const diffConfigIndex = args.findIndex((arg) => arg === \"--diff\")\n const diffConfigPath = diffConfigIndex !== -1 && args[diffConfigIndex + 1] ? args[diffConfigIndex + 1] : \"\"\n\n if (showHelp) {\n console.log(colorize(\"📋 ESLint Plugin Functype - Rule Lister\", \"bright\"))\n console.log(\"\\nUsage: pnpm run list-rules [options]\")\n console.log(\"\\nOptions:\")\n console.log(\" --verbose, -v Show rule options\")\n console.log(\" --usage, -u Show usage examples\")\n console.log(\" --check-deps Check peer dependency status\")\n console.log(\" --diff [config] Compare local ESLint config with functype\")\n console.log(\" --help, -h Show this help message\")\n console.log(\"\\nThis command lists all rules configured in the functype plugin configurations.\")\n console.log(\"\\nDiff mode:\")\n console.log(\" --diff Auto-detect local ESLint config file\")\n console.log(\" --diff <path> Compare specific config file with functype\")\n return\n }\n\n // Handle diff mode\n if (diffMode) {\n await runDiffMode(diffConfigPath)\n return\n }\n\n // Handle dependency check\n if (checkDeps) {\n console.log(colorize(\"🔧 ESLint Plugin Functype - Dependency Check\", \"bright\"))\n const result = validatePeerDependencies()\n printDependencyStatus(result)\n\n if (!result.isValid) {\n process.exit(1)\n }\n return\n }\n\n console.log(colorize(\"🔧 ESLint Plugin Functype - Supported Rules\", \"bright\"))\n\n const distPath = path.join(__dirname, \"..\", \"..\", \"dist\")\n\n if (!fs.existsSync(distPath)) {\n console.error(colorize(\"❌ Build directory not found. Run `pnpm run build` first.\", \"red\"))\n process.exit(1)\n }\n\n const configs = [\n {\n name: \"Recommended\",\n path: path.join(distPath, \"configs\", \"recommended.js\"),\n },\n {\n name: \"Strict\",\n path: path.join(distPath, \"configs\", \"strict.js\"),\n },\n ]\n\n const loadedConfigs: LoadedConfig[] = []\n\n for (const { name, path: configPath } of configs) {\n const config = await loadConfig(configPath)\n if (config) {\n const rules = extractRules(config)\n loadedConfigs.push({ name, rules })\n printRules(name, rules)\n }\n }\n\n if (loadedConfigs.length > 0) {\n printSummary(loadedConfigs)\n\n if (showUsage) {\n printUsageInfo()\n }\n\n console.log(colorize(\"\\n💡 Tips:\", \"bright\"))\n console.log(\"• Use --verbose to see rule options\")\n console.log(\"• Use --usage to see configuration examples\")\n console.log(\"• Red rules will cause build failures\")\n console.log(\"• Yellow rules are warnings only\")\n console.log(\"• Blue rules are disabled by default\")\n\n console.log(colorize(\"\\n🔗 Links:\", \"bright\"))\n console.log(\"• Documentation: https://github.com/jordanburke/eslint-config-functype\")\n console.log(\"• eslint-plugin-functional: https://github.com/eslint-functional/eslint-plugin-functional\")\n console.log(\"• @typescript-eslint: https://typescript-eslint.io/\")\n }\n}\n\n// Run the CLI\nmain().catch((error) => {\n console.error(colorize(\"❌ Unexpected error:\", \"red\"), error)\n process.exit(1)\n})\n"],"mappings":";;;;;AASA,MAAM,oBAAsC;CAC1C;EACE,MAAM;EACN,aAAa;EACb,aAAa;EACb,UAAU;EACX;CACD;EACE,MAAM;EACN,aAAa;EACb,aAAa;EACb,UAAU;EACX;CACD;EACE,MAAM;EACN,aAAa;EACb,aAAa;EACb,UAAU;EACX;CACD;EACE,MAAM;EACN,aAAa;EACb,aAAa;EACb,UAAU;EACX;CACD;EACE,MAAM;EACN,aAAa;EACb,aAAa;EACb,UAAU;EACX;CACD;EACE,MAAM;EACN,aAAa;EACb,aAAa;EACb,UAAU;EACX;CACF;AAUD,SAAS,WAAW,aAA8B;AAChD,KAAI;AACF,SAAO,KAAK,QAAQ,YAAY;AAChC,SAAO;SACD;AACN,SAAO;;;AAIX,SAAgB,2BAA6C;CAC3D,MAAM,UAA4B,EAAE;CACpC,MAAM,YAA8B,EAAE;CACtC,MAAM,WAAqB,EAAE;AAE7B,MAAK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,cAAc,SAAS,CAAC;AAC7C,UAAQ,IAAI,sCAAsC;AAClD,UAAQ,IAAI,8CAA8C;AAC1D,UAAQ,IAAI,wCAAwC;AACpD,UAAQ,IAAI,mCAAmC;AAC/C,UAAQ,IAAI,uCAAuC;AAEnD,UAAQ,IAAI,SAAS,eAAe,SAAS,CAAC;AAC9C,UAAQ,IAAI,yEAAyE;AACrF,UAAQ,IAAI,4FAA4F;AACxG,UAAQ,IAAI,sDAAsD;;;AAKtE,MAAM,CAAC,OAAO,UAAU;AACtB,SAAQ,MAAM,SAAS,uBAAuB,MAAM,EAAE,MAAM;AAC5D,SAAQ,KAAK,EAAE;EACf"}
|
|
@@ -47,13 +47,12 @@ declare const _default: {
|
|
|
47
47
|
"functional/no-let": string;
|
|
48
48
|
"functional/immutable-data": string;
|
|
49
49
|
"functional/no-loop-statements": string;
|
|
50
|
-
"functional/prefer-immutable-types":
|
|
51
|
-
enforcement: string;
|
|
52
|
-
ignoreInferredTypes: boolean;
|
|
53
|
-
})[];
|
|
50
|
+
"functional/prefer-immutable-types": string;
|
|
54
51
|
"functional/no-mixed-types": string;
|
|
55
52
|
"functional/functional-parameters": string;
|
|
56
|
-
"functional/no-throw-statements": string
|
|
53
|
+
"functional/no-throw-statements": (string | {
|
|
54
|
+
allowToRejectWith: boolean;
|
|
55
|
+
})[];
|
|
57
56
|
"functional/no-try-statements": (string | {
|
|
58
57
|
allowCatch: boolean;
|
|
59
58
|
})[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createValidationError, shouldValidateDependencies, validatePeerDependencies } from "../utils/dependency-validator.js";
|
|
2
|
-
|
|
3
2
|
//#region src/configs/recommended.ts
|
|
4
3
|
if (shouldValidateDependencies()) {
|
|
5
4
|
const result = validatePeerDependencies();
|
|
@@ -58,13 +57,10 @@ var recommended_default = {
|
|
|
58
57
|
"functional/no-let": "error",
|
|
59
58
|
"functional/immutable-data": "warn",
|
|
60
59
|
"functional/no-loop-statements": "off",
|
|
61
|
-
"functional/prefer-immutable-types":
|
|
62
|
-
enforcement: "ReadonlyShallow",
|
|
63
|
-
ignoreInferredTypes: true
|
|
64
|
-
}],
|
|
60
|
+
"functional/prefer-immutable-types": "off",
|
|
65
61
|
"functional/no-mixed-types": "off",
|
|
66
62
|
"functional/functional-parameters": "off",
|
|
67
|
-
"functional/no-throw-statements": "warn",
|
|
63
|
+
"functional/no-throw-statements": ["warn", { allowToRejectWith: true }],
|
|
68
64
|
"functional/no-try-statements": ["warn", { allowCatch: true }],
|
|
69
65
|
"functional/no-conditional-statements": "off",
|
|
70
66
|
"functional/no-expression-statements": "off",
|
|
@@ -78,7 +74,7 @@ var recommended_default = {
|
|
|
78
74
|
"simple-import-sort/exports": "error"
|
|
79
75
|
}
|
|
80
76
|
};
|
|
81
|
-
|
|
82
77
|
//#endregion
|
|
83
78
|
export { recommended_default as default };
|
|
79
|
+
|
|
84
80
|
//# sourceMappingURL=recommended.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recommended.js","names":[],"sources":["../../src/configs/recommended.ts"],"sourcesContent":["import {\n createValidationError,\n shouldValidateDependencies,\n validatePeerDependencies,\n} from \"../utils/dependency-validator\"\n\n// Validate peer dependencies on config load\nif (shouldValidateDependencies()) {\n const result = validatePeerDependencies()\n if (!result.isValid) {\n throw createValidationError(result)\n }\n\n // Log warnings for missing optional dependencies\n if (result.warnings.length > 0) {\n console.warn(\"\\n⚠️ eslint-config-functype warnings:\")\n result.warnings.forEach((warning) => console.warn(` ${warning}`))\n console.warn(\"\")\n }\n}\n\n// ESLint 9.x Flat Config Format\n// Complete functional TypeScript config with formatting and import organization\nexport default {\n name: \"functype/recommended\",\n rules: {\n // Core JavaScript immutability\n \"prefer-const\": \"error\",\n \"no-var\": \"error\",\n \"no-throw-literal\": \"error\",\n \"no-mixed-spaces-and-tabs\": \"error\",\n \"no-extra-semi\": \"error\",\n \"object-shorthand\": \"error\",\n \"prefer-template\": \"error\",\n \"prefer-destructuring\": [\n \"error\",\n {\n array: false,\n object: true,\n },\n ],\n\n // TypeScript functional patterns (when @typescript-eslint is available)\n \"@typescript-eslint/consistent-type-imports\": \"error\",\n \"@typescript-eslint/no-explicit-any\": \"error\",\n \"@typescript-eslint/no-unused-vars\": [\n \"error\",\n {\n argsIgnorePattern: \"^_\", // Only underscore-prefixed parameters\n varsIgnorePattern: \"^(_|[A-Z]$)\", // Allow underscore-prefixed vars and single uppercase letters (interface generics)\n caughtErrors: \"all\", // Require using catch block errors or prefix with _\n caughtErrorsIgnorePattern: \"^_\", // Allow _error, _e, etc. in catch blocks\n destructuredArrayIgnorePattern: \"^_\",\n ignoreRestSiblings: true,\n args: \"after-used\",\n },\n ],\n \"@typescript-eslint/no-unused-expressions\": [\n \"error\",\n {\n allowShortCircuit: true,\n allowTernary: true,\n },\n ],\n \"@typescript-eslint/no-floating-promises\": \"error\",\n \"@typescript-eslint/await-thenable\": \"error\",\n \"@typescript-eslint/no-misused-promises\": \"error\",\n \"@typescript-eslint/require-await\": \"error\",\n \"@typescript-eslint/prefer-nullish-coalescing\": \"error\",\n \"@typescript-eslint/prefer-optional-chain\": \"error\",\n \"@typescript-eslint/no-unnecessary-condition\": \"warn\",\n // Relax strict-boolean-expressions for functional library patterns\n // This rule is valuable for applications but creates excessive noise in a functional library where:\n // 1. Optional chaining patterns like `if (options?.prop)` are idiomatic and safe\n // 2. String/object truthiness checks are common and intentional (e.g., `if (message)`)\n // 3. The functional design already provides safety through Option/Either patterns\n // 4. Library code often needs flexibility for performance and interoperability\n \"@typescript-eslint/strict-boolean-expressions\": [\n \"warn\",\n {\n allowString: true, // Allow `if (str)` patterns\n allowNumber: true, // Allow `if (num)` patterns\n allowNullableObject: true, // Allow `if (obj?.prop)` patterns\n allowNullableBoolean: true, // Allow `if (bool)` where bool might be null/undefined\n allowNullableString: true, // Allow `if (str)` where str might be null/undefined\n allowNullableNumber: true, // Allow `if (num)` where num might be null/undefined\n allowAny: true, // Allow `if (value)` where value is any type\n },\n ],\n\n // Functional programming rules (when eslint-plugin-functional is available)\n \"functional/no-let\": \"error\",\n \"functional/immutable-data\": \"warn\",\n \"functional/no-loop-statements\": \"off\", // Start disabled, can enable later\n \"functional/prefer-immutable-types\":
|
|
1
|
+
{"version":3,"file":"recommended.js","names":[],"sources":["../../src/configs/recommended.ts"],"sourcesContent":["import {\n createValidationError,\n shouldValidateDependencies,\n validatePeerDependencies,\n} from \"../utils/dependency-validator\"\n\n// Validate peer dependencies on config load\nif (shouldValidateDependencies()) {\n const result = validatePeerDependencies()\n if (!result.isValid) {\n throw createValidationError(result)\n }\n\n // Log warnings for missing optional dependencies\n if (result.warnings.length > 0) {\n console.warn(\"\\n⚠️ eslint-config-functype warnings:\")\n result.warnings.forEach((warning) => console.warn(` ${warning}`))\n console.warn(\"\")\n }\n}\n\n// ESLint 9.x Flat Config Format\n// Complete functional TypeScript config with formatting and import organization\nexport default {\n name: \"functype/recommended\",\n rules: {\n // Core JavaScript immutability\n \"prefer-const\": \"error\",\n \"no-var\": \"error\",\n \"no-throw-literal\": \"error\",\n \"no-mixed-spaces-and-tabs\": \"error\",\n \"no-extra-semi\": \"error\",\n \"object-shorthand\": \"error\",\n \"prefer-template\": \"error\",\n \"prefer-destructuring\": [\n \"error\",\n {\n array: false,\n object: true,\n },\n ],\n\n // TypeScript functional patterns (when @typescript-eslint is available)\n \"@typescript-eslint/consistent-type-imports\": \"error\",\n \"@typescript-eslint/no-explicit-any\": \"error\",\n \"@typescript-eslint/no-unused-vars\": [\n \"error\",\n {\n argsIgnorePattern: \"^_\", // Only underscore-prefixed parameters\n varsIgnorePattern: \"^(_|[A-Z]$)\", // Allow underscore-prefixed vars and single uppercase letters (interface generics)\n caughtErrors: \"all\", // Require using catch block errors or prefix with _\n caughtErrorsIgnorePattern: \"^_\", // Allow _error, _e, etc. in catch blocks\n destructuredArrayIgnorePattern: \"^_\",\n ignoreRestSiblings: true,\n args: \"after-used\",\n },\n ],\n \"@typescript-eslint/no-unused-expressions\": [\n \"error\",\n {\n allowShortCircuit: true,\n allowTernary: true,\n },\n ],\n \"@typescript-eslint/no-floating-promises\": \"error\",\n \"@typescript-eslint/await-thenable\": \"error\",\n \"@typescript-eslint/no-misused-promises\": \"error\",\n \"@typescript-eslint/require-await\": \"error\",\n \"@typescript-eslint/prefer-nullish-coalescing\": \"error\",\n \"@typescript-eslint/prefer-optional-chain\": \"error\",\n \"@typescript-eslint/no-unnecessary-condition\": \"warn\",\n // Relax strict-boolean-expressions for functional library patterns\n // This rule is valuable for applications but creates excessive noise in a functional library where:\n // 1. Optional chaining patterns like `if (options?.prop)` are idiomatic and safe\n // 2. String/object truthiness checks are common and intentional (e.g., `if (message)`)\n // 3. The functional design already provides safety through Option/Either patterns\n // 4. Library code often needs flexibility for performance and interoperability\n \"@typescript-eslint/strict-boolean-expressions\": [\n \"warn\",\n {\n allowString: true, // Allow `if (str)` patterns\n allowNumber: true, // Allow `if (num)` patterns\n allowNullableObject: true, // Allow `if (obj?.prop)` patterns\n allowNullableBoolean: true, // Allow `if (bool)` where bool might be null/undefined\n allowNullableString: true, // Allow `if (str)` where str might be null/undefined\n allowNullableNumber: true, // Allow `if (num)` where num might be null/undefined\n allowAny: true, // Allow `if (value)` where value is any type\n },\n ],\n\n // Functional programming rules (when eslint-plugin-functional is available)\n \"functional/no-let\": \"error\",\n \"functional/immutable-data\": \"warn\",\n \"functional/no-loop-statements\": \"off\", // Start disabled, can enable later\n \"functional/prefer-immutable-types\": \"off\",\n \"functional/no-mixed-types\": \"off\",\n \"functional/functional-parameters\": \"off\",\n \"functional/no-throw-statements\": [\"warn\", { allowToRejectWith: true }],\n \"functional/no-try-statements\": [\"warn\", { allowCatch: true }],\n\n // Allow some flexibility\n \"functional/no-conditional-statements\": \"off\",\n \"functional/no-expression-statements\": \"off\",\n \"functional/no-return-void\": \"off\",\n\n // Code formatting (when eslint-plugin-prettier is available)\n \"prettier/prettier\": [\n \"error\",\n {},\n {\n usePrettierrc: true,\n },\n ],\n\n // Import organization (when eslint-plugin-simple-import-sort is available)\n \"simple-import-sort/imports\": \"error\",\n \"simple-import-sort/exports\": \"error\",\n },\n}\n"],"mappings":";;AAOA,IAAI,4BAA4B,EAAE;CAChC,MAAM,SAAS,0BAA0B;AACzC,KAAI,CAAC,OAAO,QACV,OAAM,sBAAsB,OAAO;AAIrC,KAAI,OAAO,SAAS,SAAS,GAAG;AAC9B,UAAQ,KAAK,yCAAyC;AACtD,SAAO,SAAS,SAAS,YAAY,QAAQ,KAAK,MAAM,UAAU,CAAC;AACnE,UAAQ,KAAK,GAAG;;;AAMpB,IAAA,sBAAe;CACb,MAAM;CACN,OAAO;EAEL,gBAAgB;EAChB,UAAU;EACV,oBAAoB;EACpB,4BAA4B;EAC5B,iBAAiB;EACjB,oBAAoB;EACpB,mBAAmB;EACnB,wBAAwB,CACtB,SACA;GACE,OAAO;GACP,QAAQ;GACT,CACF;EAGD,8CAA8C;EAC9C,sCAAsC;EACtC,qCAAqC,CACnC,SACA;GACE,mBAAmB;GACnB,mBAAmB;GACnB,cAAc;GACd,2BAA2B;GAC3B,gCAAgC;GAChC,oBAAoB;GACpB,MAAM;GACP,CACF;EACD,4CAA4C,CAC1C,SACA;GACE,mBAAmB;GACnB,cAAc;GACf,CACF;EACD,2CAA2C;EAC3C,qCAAqC;EACrC,0CAA0C;EAC1C,oCAAoC;EACpC,gDAAgD;EAChD,4CAA4C;EAC5C,+CAA+C;EAO/C,iDAAiD,CAC/C,QACA;GACE,aAAa;GACb,aAAa;GACb,qBAAqB;GACrB,sBAAsB;GACtB,qBAAqB;GACrB,qBAAqB;GACrB,UAAU;GACX,CACF;EAGD,qBAAqB;EACrB,6BAA6B;EAC7B,iCAAiC;EACjC,qCAAqC;EACrC,6BAA6B;EAC7B,oCAAoC;EACpC,kCAAkC,CAAC,QAAQ,EAAE,mBAAmB,MAAM,CAAC;EACvE,gCAAgC,CAAC,QAAQ,EAAE,YAAY,MAAM,CAAC;EAG9D,wCAAwC;EACxC,uCAAuC;EACvC,6BAA6B;EAG7B,qBAAqB;GACnB;GACA,EAAE;GACF,EACE,eAAe,MAChB;GACF;EAGD,8BAA8B;EAC9B,8BAA8B;EAC/B;CACF"}
|
package/dist/configs/strict.d.ts
CHANGED
|
@@ -44,7 +44,9 @@ declare const _default: {
|
|
|
44
44
|
"@typescript-eslint/no-unnecessary-condition": string;
|
|
45
45
|
"functional/no-let": string;
|
|
46
46
|
"functional/no-mixed-types": string;
|
|
47
|
-
"functional/no-throw-statements": string
|
|
47
|
+
"functional/no-throw-statements": (string | {
|
|
48
|
+
allowToRejectWith: boolean;
|
|
49
|
+
})[];
|
|
48
50
|
"functional/no-try-statements": (string | {
|
|
49
51
|
allowCatch: boolean;
|
|
50
52
|
})[];
|
package/dist/configs/strict.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import recommended_default from "./recommended.js";
|
|
2
|
-
|
|
3
2
|
//#region src/configs/strict.ts
|
|
4
3
|
var strict_default = {
|
|
5
4
|
...recommended_default,
|
|
@@ -15,7 +14,7 @@ var strict_default = {
|
|
|
15
14
|
"@typescript-eslint/strict-boolean-expressions": "error"
|
|
16
15
|
}
|
|
17
16
|
};
|
|
18
|
-
|
|
19
17
|
//#endregion
|
|
20
18
|
export { strict_default as default };
|
|
19
|
+
|
|
21
20
|
//# sourceMappingURL=strict.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strict.js","names":["recommended"],"sources":["../../src/configs/strict.ts"],"sourcesContent":["import recommended from \"./recommended\"\n\n// ESLint 9.x Flat Config Format - Strict rules overlay\n// Note: Peer dependency validation is inherited from recommended config\nexport default {\n ...recommended,\n name: \"functype/strict\",\n rules: {\n ...recommended.rules,\n\n // Enable stricter functional rules\n \"functional/no-loop-statements\": \"error\",\n \"functional/immutable-data\": \"error\",\n \"functional/prefer-immutable-types\": \"warn\",\n \"functional/functional-parameters\": \"warn\",\n\n // Stricter TypeScript rules (non-type-aware)\n \"@typescript-eslint/explicit-function-return-type\": \"error\",\n \"@typescript-eslint/no-non-null-assertion\": \"error\",\n \"@typescript-eslint/strict-boolean-expressions\": \"error\", // Default strict\n },\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"strict.js","names":["recommended"],"sources":["../../src/configs/strict.ts"],"sourcesContent":["import recommended from \"./recommended\"\n\n// ESLint 9.x Flat Config Format - Strict rules overlay\n// Note: Peer dependency validation is inherited from recommended config\nexport default {\n ...recommended,\n name: \"functype/strict\",\n rules: {\n ...recommended.rules,\n\n // Enable stricter functional rules\n \"functional/no-loop-statements\": \"error\",\n \"functional/immutable-data\": \"error\",\n \"functional/prefer-immutable-types\": \"warn\",\n \"functional/functional-parameters\": \"warn\",\n\n // Stricter TypeScript rules (non-type-aware)\n \"@typescript-eslint/explicit-function-return-type\": \"error\",\n \"@typescript-eslint/no-non-null-assertion\": \"error\",\n \"@typescript-eslint/strict-boolean-expressions\": \"error\", // Default strict\n },\n}\n"],"mappings":";;AAIA,IAAA,iBAAe;CACb,GAAGA;CACH,MAAM;CACN,OAAO;EACL,GAAGA,oBAAY;EAGf,iCAAiC;EACjC,6BAA6B;EAC7B,qCAAqC;EACrC,oCAAoC;EAGpC,oDAAoD;EACpD,4CAA4C;EAC5C,iDAAiD;EAClD;CACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/configs/test-overrides.d.ts
|
|
2
|
+
declare const _default: {
|
|
3
|
+
name: string;
|
|
4
|
+
files: string[];
|
|
5
|
+
rules: {
|
|
6
|
+
"functional/no-let": string;
|
|
7
|
+
"functional/immutable-data": string;
|
|
8
|
+
"functional/no-throw-statements": string;
|
|
9
|
+
"functional/no-try-statements": string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { _default as default };
|
|
14
|
+
//# sourceMappingURL=test-overrides.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/configs/test-overrides.ts
|
|
2
|
+
var test_overrides_default = {
|
|
3
|
+
name: "functype/test-overrides",
|
|
4
|
+
files: [
|
|
5
|
+
"**/*.test.ts",
|
|
6
|
+
"**/*.spec.ts",
|
|
7
|
+
"**/test/**",
|
|
8
|
+
"**/tests/**",
|
|
9
|
+
"**/__tests__/**"
|
|
10
|
+
],
|
|
11
|
+
rules: {
|
|
12
|
+
"functional/no-let": "off",
|
|
13
|
+
"functional/immutable-data": "off",
|
|
14
|
+
"functional/no-throw-statements": "off",
|
|
15
|
+
"functional/no-try-statements": "off"
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { test_overrides_default as default };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=test-overrides.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-overrides.js","names":[],"sources":["../../src/configs/test-overrides.ts"],"sourcesContent":["export default {\n name: \"functype/test-overrides\",\n files: [\"**/*.test.ts\", \"**/*.spec.ts\", \"**/test/**\", \"**/tests/**\", \"**/__tests__/**\"],\n rules: {\n \"functional/no-let\": \"off\",\n \"functional/immutable-data\": \"off\",\n \"functional/no-throw-statements\": \"off\",\n \"functional/no-try-statements\": \"off\",\n },\n}\n"],"mappings":";AAAA,IAAA,yBAAe;CACb,MAAM;CACN,OAAO;EAAC;EAAgB;EAAgB;EAAc;EAAe;EAAkB;CACvF,OAAO;EACL,qBAAqB;EACrB,6BAA6B;EAC7B,kCAAkC;EAClC,gCAAgC;EACjC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -49,13 +49,12 @@ declare const plugin: {
|
|
|
49
49
|
"functional/no-let": string;
|
|
50
50
|
"functional/immutable-data": string;
|
|
51
51
|
"functional/no-loop-statements": string;
|
|
52
|
-
"functional/prefer-immutable-types":
|
|
53
|
-
enforcement: string;
|
|
54
|
-
ignoreInferredTypes: boolean;
|
|
55
|
-
})[];
|
|
52
|
+
"functional/prefer-immutable-types": string;
|
|
56
53
|
"functional/no-mixed-types": string;
|
|
57
54
|
"functional/functional-parameters": string;
|
|
58
|
-
"functional/no-throw-statements": string
|
|
55
|
+
"functional/no-throw-statements": (string | {
|
|
56
|
+
allowToRejectWith: boolean;
|
|
57
|
+
})[];
|
|
59
58
|
"functional/no-try-statements": (string | {
|
|
60
59
|
allowCatch: boolean;
|
|
61
60
|
})[];
|
|
@@ -116,7 +115,9 @@ declare const plugin: {
|
|
|
116
115
|
"@typescript-eslint/no-unnecessary-condition": string;
|
|
117
116
|
"functional/no-let": string;
|
|
118
117
|
"functional/no-mixed-types": string;
|
|
119
|
-
"functional/no-throw-statements": string
|
|
118
|
+
"functional/no-throw-statements": (string | {
|
|
119
|
+
allowToRejectWith: boolean;
|
|
120
|
+
})[];
|
|
120
121
|
"functional/no-try-statements": (string | {
|
|
121
122
|
allowCatch: boolean;
|
|
122
123
|
})[];
|
|
@@ -132,6 +133,16 @@ declare const plugin: {
|
|
|
132
133
|
"simple-import-sort/exports": string;
|
|
133
134
|
};
|
|
134
135
|
};
|
|
136
|
+
testOverrides: {
|
|
137
|
+
name: string;
|
|
138
|
+
files: string[];
|
|
139
|
+
rules: {
|
|
140
|
+
"functional/no-let": string;
|
|
141
|
+
"functional/immutable-data": string;
|
|
142
|
+
"functional/no-throw-statements": string;
|
|
143
|
+
"functional/no-try-statements": string;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
135
146
|
};
|
|
136
147
|
meta: {
|
|
137
148
|
name: string;
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import recommended_default from "./configs/recommended.js";
|
|
2
2
|
import strict_default from "./configs/strict.js";
|
|
3
|
-
|
|
3
|
+
import test_overrides_default from "./configs/test-overrides.js";
|
|
4
4
|
//#region src/index.ts
|
|
5
5
|
const plugin = {
|
|
6
6
|
configs: {
|
|
7
7
|
recommended: recommended_default,
|
|
8
|
-
strict: strict_default
|
|
8
|
+
strict: strict_default,
|
|
9
|
+
testOverrides: test_overrides_default
|
|
9
10
|
},
|
|
10
11
|
meta: {
|
|
11
12
|
name: "eslint-config-functype",
|
|
12
13
|
version: "2.0.0"
|
|
13
14
|
}
|
|
14
15
|
};
|
|
15
|
-
|
|
16
16
|
//#endregion
|
|
17
17
|
export { plugin as default };
|
|
18
|
+
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import recommended from \"./configs/recommended\"\nimport strict from \"./configs/strict\"\n\n// ESLint 9.x Flat Config Plugin\nconst plugin = {\n configs: {\n recommended,\n strict,\n },\n // Meta information\n meta: {\n name: \"eslint-config-functype\",\n version: \"2.0.0\",\n },\n}\n\nexport default plugin\n"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import recommended from \"./configs/recommended\"\nimport strict from \"./configs/strict\"\nimport testOverrides from \"./configs/test-overrides\"\n\n// ESLint 9.x Flat Config Plugin\nconst plugin = {\n configs: {\n recommended,\n strict,\n testOverrides,\n },\n // Meta information\n meta: {\n name: \"eslint-config-functype\",\n version: \"2.0.0\",\n },\n}\n\nexport default plugin\n"],"mappings":";;;;AAKA,MAAM,SAAS;CACb,SAAS;EACP,aAAA;EACA,QAAA;EACA,eAAA;EACD;CAED,MAAM;EACJ,MAAM;EACN,SAAS;EACV;CACF"}
|
|
@@ -82,7 +82,7 @@ function createValidationError(result) {
|
|
|
82
82
|
function shouldValidateDependencies() {
|
|
83
83
|
return process.env.NODE_ENV !== "test" && process.env.FUNCTYPE_SKIP_VALIDATION !== "true";
|
|
84
84
|
}
|
|
85
|
-
|
|
86
85
|
//#endregion
|
|
87
86
|
export { createValidationError, shouldValidateDependencies, validatePeerDependencies };
|
|
87
|
+
|
|
88
88
|
//# sourceMappingURL=dependency-validator.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-functype",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Curated ESLint flat config bundle for functional TypeScript programming (ESLint 9.x+)",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
"types": "./dist/configs/strict.d.ts",
|
|
22
22
|
"import": "./dist/configs/strict.js",
|
|
23
23
|
"default": "./dist/configs/strict.js"
|
|
24
|
+
},
|
|
25
|
+
"./test-overrides": {
|
|
26
|
+
"types": "./dist/configs/test-overrides.d.ts",
|
|
27
|
+
"import": "./dist/configs/test-overrides.js",
|
|
28
|
+
"default": "./dist/configs/test-overrides.js"
|
|
24
29
|
}
|
|
25
30
|
},
|
|
26
31
|
"files": [
|
|
@@ -38,61 +43,59 @@
|
|
|
38
43
|
"immutable"
|
|
39
44
|
],
|
|
40
45
|
"prettier": "ts-builds/prettier",
|
|
46
|
+
"scripts": {
|
|
47
|
+
"validate": "ts-builds validate",
|
|
48
|
+
"format": "ts-builds format",
|
|
49
|
+
"format:check": "ts-builds format:check",
|
|
50
|
+
"lint": "ts-builds lint",
|
|
51
|
+
"lint:check": "ts-builds lint:check",
|
|
52
|
+
"typecheck": "ts-builds typecheck",
|
|
53
|
+
"build": "ts-builds build",
|
|
54
|
+
"dev": "ts-builds dev",
|
|
55
|
+
"prepublishOnly": "pnpm validate",
|
|
56
|
+
"list-rules": "node dist/cli/list-rules.js",
|
|
57
|
+
"list-rules:verbose": "node dist/cli/list-rules.js --verbose",
|
|
58
|
+
"list-rules:usage": "node dist/cli/list-rules.js --usage",
|
|
59
|
+
"check-deps": "node dist/cli/list-rules.js --check-deps",
|
|
60
|
+
"cli:help": "node dist/cli/list-rules.js --help",
|
|
61
|
+
"diff": "node dist/cli/list-rules.js --diff"
|
|
62
|
+
},
|
|
41
63
|
"peerDependencies": {
|
|
42
64
|
"@typescript-eslint/eslint-plugin": "^8.38.0 || ^8.39.0 || ^9.0.0",
|
|
43
65
|
"@typescript-eslint/parser": "^8.38.0 || ^8.39.0 || ^9.0.0",
|
|
44
|
-
"eslint": "^10.0.
|
|
66
|
+
"eslint": "^10.0.3",
|
|
45
67
|
"eslint-plugin-functional": "^9.0.2",
|
|
46
68
|
"eslint-plugin-prettier": "^5.0.0",
|
|
47
69
|
"eslint-plugin-simple-import-sort": "^12.0.0",
|
|
48
70
|
"prettier": "^3.0.0"
|
|
49
71
|
},
|
|
50
72
|
"dependencies": {
|
|
51
|
-
"@eslint/eslintrc": "^3.3.
|
|
52
|
-
"@eslint/js": "^
|
|
73
|
+
"@eslint/eslintrc": "^3.3.5",
|
|
74
|
+
"@eslint/js": "^10.0.1"
|
|
53
75
|
},
|
|
54
76
|
"devDependencies": {
|
|
55
|
-
"@types/node": "^24.
|
|
56
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
57
|
-
"@typescript-eslint/parser": "^8.
|
|
77
|
+
"@types/node": "^24.12.0",
|
|
78
|
+
"@typescript-eslint/eslint-plugin": "^8.57.0",
|
|
79
|
+
"@typescript-eslint/parser": "^8.57.0",
|
|
58
80
|
"eslint-config-prettier": "^10.1.8",
|
|
59
81
|
"eslint-plugin-functional": "^9.0.4",
|
|
60
82
|
"eslint-plugin-prettier": "^5.5.5",
|
|
61
83
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
62
|
-
"ts-builds": "^2.
|
|
63
|
-
"tsdown": "^0.
|
|
84
|
+
"ts-builds": "^2.5.1",
|
|
85
|
+
"tsdown": "^0.21.2"
|
|
64
86
|
},
|
|
65
87
|
"author": "Jordan Burke",
|
|
66
88
|
"repository": {
|
|
67
89
|
"type": "git",
|
|
68
|
-
"url": "https://github.com/jordanburke/eslint-
|
|
90
|
+
"url": "https://github.com/jordanburke/eslint-functype",
|
|
91
|
+
"directory": "packages/config"
|
|
69
92
|
},
|
|
70
|
-
"homepage": "https://github.com/jordanburke/eslint-
|
|
93
|
+
"homepage": "https://github.com/jordanburke/eslint-functype",
|
|
71
94
|
"bugs": {
|
|
72
|
-
"url": "https://github.com/jordanburke/eslint-
|
|
95
|
+
"url": "https://github.com/jordanburke/eslint-functype/issues"
|
|
73
96
|
},
|
|
74
97
|
"license": "MIT",
|
|
75
98
|
"engines": {
|
|
76
99
|
"node": ">=22.0.0"
|
|
77
|
-
},
|
|
78
|
-
"scripts": {
|
|
79
|
-
"validate": "ts-builds validate",
|
|
80
|
-
"format": "ts-builds format",
|
|
81
|
-
"format:check": "ts-builds format:check",
|
|
82
|
-
"lint": "ts-builds lint",
|
|
83
|
-
"lint:check": "ts-builds lint:check",
|
|
84
|
-
"typecheck": "ts-builds typecheck",
|
|
85
|
-
"test": "ts-builds test",
|
|
86
|
-
"test:watch": "ts-builds test:watch",
|
|
87
|
-
"test:coverage": "ts-builds test:coverage",
|
|
88
|
-
"build": "ts-builds build",
|
|
89
|
-
"build:watch": "ts-builds dev",
|
|
90
|
-
"dev": "ts-builds dev",
|
|
91
|
-
"list-rules": "node dist/cli/list-rules.js",
|
|
92
|
-
"list-rules:verbose": "node dist/cli/list-rules.js --verbose",
|
|
93
|
-
"list-rules:usage": "node dist/cli/list-rules.js --usage",
|
|
94
|
-
"check-deps": "node dist/cli/list-rules.js --check-deps",
|
|
95
|
-
"cli:help": "node dist/cli/list-rules.js --help",
|
|
96
|
-
"diff": "node dist/cli/list-rules.js --diff"
|
|
97
100
|
}
|
|
98
|
-
}
|
|
101
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Jordan
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/README.md
DELETED
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
# eslint-config-functype
|
|
2
|
-
|
|
3
|
-
A curated ESLint configuration bundle for functional TypeScript programming. This plugin combines and configures rules from established ESLint plugins to enforce immutability patterns and functional programming best practices.
|
|
4
|
-
|
|
5
|
-
## What This Plugin Does
|
|
6
|
-
|
|
7
|
-
Instead of recreating functional programming rules, this plugin provides carefully curated configurations that combine rules from:
|
|
8
|
-
|
|
9
|
-
- **eslint-plugin-functional**: Core functional programming rules
|
|
10
|
-
- **@typescript-eslint/eslint-plugin**: TypeScript-specific functional patterns
|
|
11
|
-
- **ESLint core**: JavaScript immutability basics
|
|
12
|
-
|
|
13
|
-
## Installation
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install --save-dev eslint-config-functype @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-plugin-functional
|
|
17
|
-
# or
|
|
18
|
-
pnpm add -D eslint-config-functype @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-plugin-functional
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
|
|
23
|
-
### ESLint 8 (.eslintrc) - Quick Start
|
|
24
|
-
|
|
25
|
-
```javascript
|
|
26
|
-
// .eslintrc.js
|
|
27
|
-
module.exports = {
|
|
28
|
-
extends: ["plugin:functype/recommended"],
|
|
29
|
-
parser: "@typescript-eslint/parser",
|
|
30
|
-
parserOptions: {
|
|
31
|
-
project: "./tsconfig.json",
|
|
32
|
-
},
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### ESLint 8 - Strict Mode
|
|
37
|
-
|
|
38
|
-
```javascript
|
|
39
|
-
// .eslintrc.js
|
|
40
|
-
module.exports = {
|
|
41
|
-
extends: ["plugin:functype/strict"],
|
|
42
|
-
parser: "@typescript-eslint/parser",
|
|
43
|
-
parserOptions: {
|
|
44
|
-
project: "./tsconfig.json",
|
|
45
|
-
},
|
|
46
|
-
}
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### ESLint 9+ (Flat Config)
|
|
50
|
-
|
|
51
|
-
For ESLint 9+, create your own flat config using our rule selections:
|
|
52
|
-
|
|
53
|
-
```javascript
|
|
54
|
-
// eslint.config.js
|
|
55
|
-
import js from "@eslint/js"
|
|
56
|
-
import tseslint from "@typescript-eslint/eslint-plugin"
|
|
57
|
-
import functional from "eslint-plugin-functional"
|
|
58
|
-
import parser from "@typescript-eslint/parser"
|
|
59
|
-
|
|
60
|
-
export default [
|
|
61
|
-
js.configs.recommended,
|
|
62
|
-
{
|
|
63
|
-
files: ["**/*.ts", "**/*.tsx"],
|
|
64
|
-
languageOptions: {
|
|
65
|
-
parser,
|
|
66
|
-
parserOptions: {
|
|
67
|
-
ecmaVersion: "latest",
|
|
68
|
-
sourceType: "module",
|
|
69
|
-
project: "./tsconfig.json",
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
plugins: {
|
|
73
|
-
"@typescript-eslint": tseslint,
|
|
74
|
-
functional,
|
|
75
|
-
},
|
|
76
|
-
rules: {
|
|
77
|
-
// Core immutability
|
|
78
|
-
"prefer-const": "error",
|
|
79
|
-
"no-var": "error",
|
|
80
|
-
|
|
81
|
-
// TypeScript functional patterns
|
|
82
|
-
"@typescript-eslint/consistent-type-imports": "error",
|
|
83
|
-
"@typescript-eslint/no-explicit-any": "error",
|
|
84
|
-
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
|
|
85
|
-
|
|
86
|
-
// Functional programming rules
|
|
87
|
-
"functional/no-let": "error",
|
|
88
|
-
"functional/immutable-data": "warn",
|
|
89
|
-
"functional/no-loop-statements": "off", // Enable as "error" for strict mode
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
]
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### Individual Rule Usage
|
|
96
|
-
|
|
97
|
-
You can also use individual rules without our presets:
|
|
98
|
-
|
|
99
|
-
```javascript
|
|
100
|
-
{
|
|
101
|
-
"plugins": ["@typescript-eslint", "functional"],
|
|
102
|
-
"rules": {
|
|
103
|
-
"functional/no-let": "error",
|
|
104
|
-
"functional/immutable-data": "warn",
|
|
105
|
-
"@typescript-eslint/no-explicit-any": "error",
|
|
106
|
-
"prefer-const": "error"
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
## What Rules Are Included
|
|
112
|
-
|
|
113
|
-
### Recommended Configuration
|
|
114
|
-
|
|
115
|
-
- ✅ `prefer-const` / `no-var` - Basic immutability
|
|
116
|
-
- ✅ `functional/no-let` - Disallow `let` declarations
|
|
117
|
-
- ⚠️ `functional/immutable-data` - Warn on data mutation
|
|
118
|
-
- ⚠️ `functional/no-mutation` - Warn on object/array mutations
|
|
119
|
-
- ✅ `@typescript-eslint/consistent-type-imports` - Clean imports
|
|
120
|
-
- ✅ `@typescript-eslint/no-explicit-any` - Type safety
|
|
121
|
-
|
|
122
|
-
### Strict Configuration
|
|
123
|
-
|
|
124
|
-
All recommended rules plus:
|
|
125
|
-
|
|
126
|
-
- ✅ `functional/no-loop-statements` - Disallow imperative loops
|
|
127
|
-
- ✅ `functional/immutable-data` - Error on data mutation
|
|
128
|
-
- ✅ `functional/prefer-immutable-types` - Encourage readonly types
|
|
129
|
-
- ✅ `@typescript-eslint/explicit-function-return-type` - Explicit return types
|
|
130
|
-
|
|
131
|
-
## Examples
|
|
132
|
-
|
|
133
|
-
```typescript
|
|
134
|
-
// ❌ Bad (will be flagged)
|
|
135
|
-
let x = 1 // functional/no-let
|
|
136
|
-
arr.push(item) // functional/immutable-data
|
|
137
|
-
for (
|
|
138
|
-
let i = 0;
|
|
139
|
-
i < 10;
|
|
140
|
-
i++ // functional/no-loop-statements (strict only)
|
|
141
|
-
)
|
|
142
|
-
// ✅ Good
|
|
143
|
-
const x = 1
|
|
144
|
-
const newArr = [...arr, item]
|
|
145
|
-
arr.forEach((item) => process(item))
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
## Configurations
|
|
149
|
-
|
|
150
|
-
- **`recommended`**: Balanced functional programming rules suitable for most projects
|
|
151
|
-
- **`strict`**: Maximum functional programming enforcement for pure FP codebases
|
|
152
|
-
|
|
153
|
-
## Philosophy
|
|
154
|
-
|
|
155
|
-
This plugin follows the principle of **composition over recreation**. Rather than maintaining custom rules, we curate and combine battle-tested rules from the community, ensuring:
|
|
156
|
-
|
|
157
|
-
- ✅ Less maintenance burden
|
|
158
|
-
- ✅ Better rule quality and edge case handling
|
|
159
|
-
- ✅ Automatic updates from upstream plugins
|
|
160
|
-
- ✅ Community-driven improvements
|
|
161
|
-
|
|
162
|
-
## CLI Tools
|
|
163
|
-
|
|
164
|
-
### List All Supported Rules
|
|
165
|
-
|
|
166
|
-
See exactly which rules are configured in each preset:
|
|
167
|
-
|
|
168
|
-
```bash
|
|
169
|
-
# Basic rule listing
|
|
170
|
-
pnpm run list-rules
|
|
171
|
-
|
|
172
|
-
# Show rule options/configuration
|
|
173
|
-
pnpm run list-rules:verbose
|
|
174
|
-
|
|
175
|
-
# Show usage examples
|
|
176
|
-
pnpm run list-rules:usage
|
|
177
|
-
|
|
178
|
-
# Check peer dependency status
|
|
179
|
-
pnpm run check-deps
|
|
180
|
-
|
|
181
|
-
# Show help
|
|
182
|
-
pnpm run cli:help
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
### After Installation
|
|
186
|
-
|
|
187
|
-
Once installed globally or in a project, you can also use:
|
|
188
|
-
|
|
189
|
-
```bash
|
|
190
|
-
# If installed globally
|
|
191
|
-
functype-list-rules --help
|
|
192
|
-
|
|
193
|
-
# Or with npx
|
|
194
|
-
npx eslint-config-functype functype-list-rules
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
## CI/CD
|
|
198
|
-
|
|
199
|
-
This plugin includes GitHub Actions workflows for:
|
|
200
|
-
|
|
201
|
-
- ✅ **Testing** on Node.js 22
|
|
202
|
-
- ✅ **Linting** with our own rules
|
|
203
|
-
- ✅ **Building** and validation
|
|
204
|
-
- ✅ **Publishing** to npm on version changes
|
|
205
|
-
|
|
206
|
-
## Development
|
|
207
|
-
|
|
208
|
-
### Requirements
|
|
209
|
-
|
|
210
|
-
- Node.js 22.0.0 or higher
|
|
211
|
-
- pnpm (recommended package manager)
|
|
212
|
-
|
|
213
|
-
```bash
|
|
214
|
-
# Install dependencies
|
|
215
|
-
pnpm install
|
|
216
|
-
|
|
217
|
-
# Build
|
|
218
|
-
pnpm run build
|
|
219
|
-
|
|
220
|
-
# Lint
|
|
221
|
-
pnpm run lint
|
|
222
|
-
|
|
223
|
-
# List rules during development
|
|
224
|
-
pnpm run list-rules
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
## Troubleshooting
|
|
228
|
-
|
|
229
|
-
### Missing Peer Dependencies
|
|
230
|
-
|
|
231
|
-
If you see errors like `Definition for rule '@typescript-eslint/no-explicit-any' was not found`, you're missing peer dependencies.
|
|
232
|
-
|
|
233
|
-
**Quick Check:**
|
|
234
|
-
|
|
235
|
-
```bash
|
|
236
|
-
pnpm run check-deps
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
This will show you exactly which dependencies are missing and provide the installation command.
|
|
240
|
-
|
|
241
|
-
**Manual Installation:**
|
|
242
|
-
|
|
243
|
-
```bash
|
|
244
|
-
pnpm add -D @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-plugin-functional eslint-plugin-prettier eslint-plugin-simple-import-sort prettier
|
|
245
|
-
```
|