eslint-plugin-functype 2.100.1 → 2.102.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/list-rules.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"../dependency-validator-
|
|
2
|
+
import{r as e}from"../dependency-validator-Cnms4306.js";import t from"../index.js";const n={reset:`\x1B[0m`,bright:`\x1B[1m`,red:`\x1B[31m`,green:`\x1B[32m`,yellow:`\x1B[33m`,blue:`\x1B[34m`,magenta:`\x1B[35m`,cyan:`\x1B[36m`};function r(e,t){return n[t]+e+n.reset}function i(e){console.log(r(`
|
|
3
3
|
🔍 Dependency Status Check:`,`bright`)),console.log(r(`=`.repeat(40),`blue`)),e.available.length>0&&(console.log(r(`
|
|
4
4
|
✅ Available:`,`green`)),e.available.forEach(e=>{let t=e.required?`🔧`:`🔌`;console.log(` ${t} ${r(e.name,`green`)} - ${e.description}`)})),e.missing.length>0&&(console.log(r(`
|
|
5
5
|
❌ Missing:`,`red`)),e.missing.forEach(e=>{let t=e.required?`⚠️ `:`💡`,n=e.required?`red`:`yellow`;console.log(` ${t} ${r(e.name,n)} - ${e.description}`)}),e.installCommand&&(console.log(r(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import{createRequire as e}from"node:module";var t=e(import.meta.url);const n=[{name:`@typescript-eslint/eslint-plugin`,packageName:`@typescript-eslint/eslint-plugin`,description:`TypeScript-aware ESLint rules`,required:!0},{name:`@typescript-eslint/parser`,packageName:`@typescript-eslint/parser`,description:`TypeScript parser for ESLint`,required:!0},{name:`eslint-plugin-functional`,packageName:`eslint-plugin-functional`,description:`Functional programming ESLint rules`,required:!0},{name:`eslint-plugin-prettier`,packageName:`eslint-plugin-prettier`,description:`Code formatting rules`,required:!1},{name:`eslint-plugin-simple-import-sort`,packageName:`eslint-plugin-simple-import-sort`,description:`Import sorting rules`,required:!1},{name:`prettier`,packageName:`prettier`,description:`Code formatter`,required:!1}];function r(e){try{return t.resolve(e),!0}catch{return!1}}function i(){let e=[],t=[],i=[];for(let a of n)r(a.packageName)?t.push(a):(e.push(a),a.required||i.push(`Optional plugin '${a.name}' not found. Some rules will be skipped.`));let a=e.filter(e=>e.required).length===0,o=e.map(e=>e.packageName);return{isValid:a,missing:e,available:t,installCommand:o.length>0?`pnpm add -D ${o.join(` `)}`:``,warnings:i}}function a(e){let t=e.missing.filter(e=>e.required);if(t.length===0)return Error(`No validation errors`);let n=[`❌ Missing required peer dependencies for eslint-plugin-functype:`,``,t.map(e=>` • ${e.name} - ${e.description}`).join(`
|
|
2
2
|
`),``,`📦 Install missing dependencies:`,` ${e.installCommand}`,``,`📖 See installation guide: https://github.com/jordanburke/eslint-plugin-functype#installation`].join(`
|
|
3
3
|
`);return Error(n)}function o(){return process.env.NODE_ENV!==`test`&&process.env.FUNCTYPE_SKIP_VALIDATION!==`true`}export{o as n,i as r,a as t};
|
|
4
|
-
//# sourceMappingURL=dependency-validator-
|
|
4
|
+
//# sourceMappingURL=dependency-validator-Cnms4306.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-validator-
|
|
1
|
+
{"version":3,"file":"dependency-validator-Cnms4306.js","names":[],"sources":["../src/utils/dependency-validator.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 tryRequire(packageName: string): boolean {\n try {\n require.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 (tryRequire(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-plugin-functype:\",\n \"\",\n missingList,\n \"\",\n \"📦 Install missing dependencies:\",\n ` ${result.installCommand}`,\n \"\",\n \"📖 See installation guide: https://github.com/jordanburke/eslint-plugin-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"],"mappings":"qEASA,MAAM,EAAsC,CAC1C,CACE,KAAM,mCACN,YAAa,mCACb,YAAa,gCACb,SAAU,EACZ,EACA,CACE,KAAM,4BACN,YAAa,4BACb,YAAa,+BACb,SAAU,EACZ,EACA,CACE,KAAM,2BACN,YAAa,2BACb,YAAa,sCACb,SAAU,EACZ,EACA,CACE,KAAM,yBACN,YAAa,yBACb,YAAa,wBACb,SAAU,EACZ,EACA,CACE,KAAM,mCACN,YAAa,mCACb,YAAa,uBACb,SAAU,EACZ,EACA,CACE,KAAM,WACN,YAAa,WACb,YAAa,iBACb,SAAU,EACZ,CACF,EAUA,SAAS,EAAW,EAA8B,CAChD,GAAI,CAEF,OADA,EAAQ,QAAQ,CAAW,EACpB,EACT,MAAQ,CACN,MAAO,EACT,CACF,CAEA,SAAgB,GAA6C,CAC3D,IAAM,EAA4B,CAAC,EAC7B,EAA8B,CAAC,EAC/B,EAAqB,CAAC,EAE5B,IAAK,IAAM,KAAO,EACZ,EAAW,EAAI,WAAW,EAC5B,EAAU,KAAK,CAAG,GAElB,EAAQ,KAAK,CAAG,EACZ,EAAI,UAIN,EAAS,KAAK,oBAAoB,EAAI,KAAK,yCAAyC,GAM1F,IAAM,EADkB,EAAQ,OAAQ,GAAQ,EAAI,QACtB,EAAE,SAAW,EAGrC,EAAsB,EAAQ,IAAK,GAAQ,EAAI,WAAW,EAGhE,MAAO,CACL,UACA,UACA,YACA,eANqB,EAAoB,OAAS,EAAI,eAAe,EAAoB,KAAK,GAAG,IAAM,GAOvG,UACF,CACF,CAEA,SAAgB,EAAsB,EAAiC,CACrE,IAAM,EAAkB,EAAO,QAAQ,OAAQ,GAAQ,EAAI,QAAQ,EAEnE,GAAI,EAAgB,SAAW,EAC7B,OAAW,MAAM,sBAAsB,EAKzC,IAAM,EAAU,CACd,mEACA,GAJkB,EAAgB,IAAK,GAAQ,OAAO,EAAI,KAAK,KAAK,EAAI,aAAa,EAAE,KAAK;CAKlF,EACV,GACA,mCACA,MAAM,EAAO,iBACb,GACA,+FACF,EAAE,KAAK;CAAI,EAEX,OAAW,MAAM,CAAO,CAC1B,CAEA,SAAgB,GAAsC,CAEpD,OAAO,QAAQ,IAAI,WAAa,QAAU,QAAQ,IAAI,2BAA6B,MACrF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"../dependency-validator-
|
|
1
|
+
import{n as e,r as t,t as n}from"../dependency-validator-Cnms4306.js";export{n as createValidationError,e as shouldValidateDependencies,t as validatePeerDependencies};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-functype",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.102.0",
|
|
4
4
|
"description": "Custom ESLint rules for functional TypeScript programming with functype library patterns including Do notation (ESLint 10+)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"eslint": "^10.2.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@types/node": "^24.12.
|
|
42
|
+
"@types/node": "^24.12.4",
|
|
43
43
|
"@typescript-eslint/rule-tester": "^8.60.0",
|
|
44
44
|
"eslint-config-prettier": "^10.1.8",
|
|
45
45
|
"ts-builds": "^2.8.1",
|
|
46
|
-
"tsdown": "^0.22.
|
|
47
|
-
"functype": "^1.0
|
|
46
|
+
"tsdown": "^0.22.1",
|
|
47
|
+
"functype": "^1.2.0"
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public",
|