eslint-plugin-functype 1.0.0 → 1.1.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/README.md CHANGED
@@ -169,6 +169,9 @@ pnpm run list-rules:verbose
169
169
  # Show usage examples
170
170
  pnpm run list-rules:usage
171
171
 
172
+ # Check peer dependency status
173
+ pnpm run check-deps
174
+
172
175
  # Show help
173
176
  pnpm run cli:help
174
177
  ```
@@ -207,4 +210,22 @@ pnpm run lint
207
210
 
208
211
  # List rules during development
209
212
  pnpm run list-rules
213
+ ```
214
+
215
+ ## Troubleshooting
216
+
217
+ ### Missing Peer Dependencies
218
+
219
+ If you see errors like `Definition for rule '@typescript-eslint/no-explicit-any' was not found`, you're missing peer dependencies.
220
+
221
+ **Quick Check:**
222
+ ```bash
223
+ pnpm run check-deps
224
+ ```
225
+
226
+ This will show you exactly which dependencies are missing and provide the installation command.
227
+
228
+ **Manual Installation:**
229
+ ```bash
230
+ pnpm add -D @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-plugin-functional eslint-plugin-prettier eslint-plugin-simple-import-sort prettier
210
231
  ```
@@ -1,2 +1 @@
1
1
  #!/usr/bin/env node
2
- export {};
@@ -1,233 +1,332 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
2
+ 'use strict';
3
+
4
+ var fs = require('fs');
5
+ var path = require('path');
6
+
7
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
+
9
+ var fs__default = /*#__PURE__*/_interopDefault(fs);
10
+ var path__default = /*#__PURE__*/_interopDefault(path);
11
+
12
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
13
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
14
+ }) : x)(function(x) {
15
+ if (typeof require !== "undefined") return require.apply(this, arguments);
16
+ throw Error('Dynamic require of "' + x + '" is not supported');
18
17
  });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
36
- var __importDefault = (this && this.__importDefault) || function (mod) {
37
- return (mod && mod.__esModule) ? mod : { "default": mod };
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- const fs_1 = __importDefault(require("fs"));
41
- const path_1 = __importDefault(require("path"));
42
- // Colors for console output
43
- const colors = {
44
- reset: '\x1b[0m',
45
- bright: '\x1b[1m',
46
- red: '\x1b[31m',
47
- green: '\x1b[32m',
48
- yellow: '\x1b[33m',
49
- blue: '\x1b[34m',
50
- magenta: '\x1b[35m',
51
- cyan: '\x1b[36m',
18
+
19
+ // src/utils/dependency-validator.ts
20
+ var PEER_DEPENDENCIES = [
21
+ {
22
+ name: "@typescript-eslint/eslint-plugin",
23
+ packageName: "@typescript-eslint/eslint-plugin",
24
+ description: "TypeScript-aware ESLint rules",
25
+ required: true
26
+ },
27
+ {
28
+ name: "@typescript-eslint/parser",
29
+ packageName: "@typescript-eslint/parser",
30
+ description: "TypeScript parser for ESLint",
31
+ required: true
32
+ },
33
+ {
34
+ name: "eslint-plugin-functional",
35
+ packageName: "eslint-plugin-functional",
36
+ description: "Functional programming ESLint rules",
37
+ required: true
38
+ },
39
+ {
40
+ name: "eslint-plugin-prettier",
41
+ packageName: "eslint-plugin-prettier",
42
+ description: "Code formatting rules",
43
+ required: false
44
+ },
45
+ {
46
+ name: "eslint-plugin-simple-import-sort",
47
+ packageName: "eslint-plugin-simple-import-sort",
48
+ description: "Import sorting rules",
49
+ required: false
50
+ },
51
+ {
52
+ name: "prettier",
53
+ packageName: "prettier",
54
+ description: "Code formatter",
55
+ required: false
56
+ }
57
+ ];
58
+ function tryRequire(packageName) {
59
+ try {
60
+ __require.resolve(packageName);
61
+ return true;
62
+ } catch {
63
+ return false;
64
+ }
65
+ }
66
+ function validatePeerDependencies() {
67
+ const missing = [];
68
+ const available = [];
69
+ const warnings = [];
70
+ for (const dep of PEER_DEPENDENCIES) {
71
+ if (tryRequire(dep.packageName)) {
72
+ available.push(dep);
73
+ } else {
74
+ missing.push(dep);
75
+ if (dep.required) ; else {
76
+ warnings.push(`Optional plugin '${dep.name}' not found. Some rules will be skipped.`);
77
+ }
78
+ }
79
+ }
80
+ const requiredMissing = missing.filter((dep) => dep.required);
81
+ const isValid = requiredMissing.length === 0;
82
+ const missingPackageNames = missing.map((dep) => dep.packageName);
83
+ const installCommand = missingPackageNames.length > 0 ? `pnpm add -D ${missingPackageNames.join(" ")}` : "";
84
+ return {
85
+ isValid,
86
+ missing,
87
+ available,
88
+ installCommand,
89
+ warnings
90
+ };
91
+ }
92
+
93
+ // src/cli/list-rules.ts
94
+ var colors = {
95
+ reset: "\x1B[0m",
96
+ bright: "\x1B[1m",
97
+ red: "\x1B[31m",
98
+ green: "\x1B[32m",
99
+ yellow: "\x1B[33m",
100
+ blue: "\x1B[34m",
101
+ magenta: "\x1B[35m",
102
+ cyan: "\x1B[36m"
52
103
  };
53
104
  function colorize(text, color) {
54
- return colors[color] + text + colors.reset;
105
+ return colors[color] + text + colors.reset;
55
106
  }
56
107
  async function loadConfig(configPath) {
57
- try {
58
- // For built JS files, use require
59
- if (configPath.endsWith('.js')) {
60
- const configModule = require(configPath);
61
- return configModule.default || configModule;
62
- }
63
- // For TS files, we'd need to use dynamic import
64
- const configModule = await Promise.resolve(`${configPath}`).then(s => __importStar(require(s)));
65
- return configModule.default || configModule;
66
- }
67
- catch (error) {
68
- console.error(colorize(`Error loading config from ${configPath}:`, 'red'), error.message);
69
- return null;
108
+ try {
109
+ if (configPath.endsWith(".js")) {
110
+ const configModule2 = __require(configPath);
111
+ return configModule2.default || configModule2;
70
112
  }
113
+ const configModule = await import(configPath);
114
+ return configModule.default || configModule;
115
+ } catch (error) {
116
+ console.error(
117
+ colorize(`Error loading config from ${configPath}:`, "red"),
118
+ error.message
119
+ );
120
+ return null;
121
+ }
71
122
  }
72
123
  function extractRules(config) {
73
- const rules = new Map();
74
- if (config.rules) {
75
- Object.entries(config.rules).forEach(([ruleName, ruleConfig]) => {
76
- const severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;
77
- const options = Array.isArray(ruleConfig) ? ruleConfig.slice(1) : [];
78
- rules.set(ruleName, {
79
- severity,
80
- options,
81
- source: getRuleSource(ruleName)
82
- });
83
- });
84
- }
85
- return rules;
124
+ const rules = /* @__PURE__ */ new Map();
125
+ if (config.rules) {
126
+ Object.entries(config.rules).forEach(([ruleName, ruleConfig]) => {
127
+ const severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;
128
+ const options = Array.isArray(ruleConfig) ? ruleConfig.slice(1) : [];
129
+ rules.set(ruleName, {
130
+ severity,
131
+ options,
132
+ source: getRuleSource(ruleName)
133
+ });
134
+ });
135
+ }
136
+ return rules;
86
137
  }
87
138
  function getRuleSource(ruleName) {
88
- if (ruleName.startsWith('functional/'))
89
- return 'eslint-plugin-functional';
90
- if (ruleName.startsWith('@typescript-eslint/'))
91
- return '@typescript-eslint/eslint-plugin';
92
- return 'eslint (core)';
139
+ if (ruleName.startsWith("functional/")) return "eslint-plugin-functional";
140
+ if (ruleName.startsWith("@typescript-eslint/")) return "@typescript-eslint/eslint-plugin";
141
+ return "eslint (core)";
93
142
  }
94
143
  function getSeverityColor(severity) {
95
- switch (severity) {
96
- case 'error':
97
- case 2:
98
- return 'red';
99
- case 'warn':
100
- case 1:
101
- return 'yellow';
102
- case 'off':
103
- case 0:
104
- return 'cyan';
105
- default:
106
- return 'reset';
107
- }
144
+ switch (severity) {
145
+ case "error":
146
+ case 2:
147
+ return "red";
148
+ case "warn":
149
+ case 1:
150
+ return "yellow";
151
+ case "off":
152
+ case 0:
153
+ return "cyan";
154
+ default:
155
+ return "reset";
156
+ }
108
157
  }
109
158
  function formatSeverity(severity) {
110
- const severityMap = {
111
- '0': 'off',
112
- '1': 'warn',
113
- '2': 'error',
114
- 'off': 'off',
115
- 'warn': 'warn',
116
- 'error': 'error'
117
- };
118
- return severityMap[String(severity)] || String(severity);
159
+ const severityMap = {
160
+ "0": "off",
161
+ "1": "warn",
162
+ "2": "error",
163
+ "off": "off",
164
+ "warn": "warn",
165
+ "error": "error"
166
+ };
167
+ return severityMap[String(severity)] || String(severity);
119
168
  }
120
169
  function printRules(configName, rules) {
121
- console.log(colorize(`\nšŸ“‹ ${configName} Configuration Rules:`, 'bright'));
122
- console.log(colorize('='.repeat(50), 'blue'));
123
- // Group rules by source
124
- const rulesBySource = new Map();
125
- rules.forEach((ruleData, ruleName) => {
126
- const source = ruleData.source;
127
- if (!rulesBySource.has(source)) {
128
- rulesBySource.set(source, new Map());
129
- }
130
- rulesBySource.get(source).set(ruleName, ruleData);
131
- });
132
- // Print rules grouped by source
133
- rulesBySource.forEach((sourceRules, source) => {
134
- console.log(colorize(`\nšŸ“¦ ${source}:`, 'magenta'));
135
- sourceRules.forEach((ruleData, ruleName) => {
136
- const shortName = ruleName.replace(/^.*\//, '');
137
- const severity = formatSeverity(ruleData.severity);
138
- const severityColored = colorize(`[${severity.toUpperCase()}]`, getSeverityColor(ruleData.severity));
139
- const hasOptions = ruleData.options && ruleData.options.length > 0;
140
- const optionsText = hasOptions ? colorize(' (with options)', 'cyan') : '';
141
- console.log(` ${severityColored} ${colorize(shortName, 'green')}${optionsText}`);
142
- if (hasOptions && process.argv.includes('--verbose')) {
143
- console.log(` ${colorize('Options:', 'cyan')} ${JSON.stringify(ruleData.options)}`);
144
- }
145
- });
170
+ console.log(colorize(`
171
+ \u{1F4CB} ${configName} Configuration Rules:`, "bright"));
172
+ console.log(colorize("=".repeat(50), "blue"));
173
+ const rulesBySource = /* @__PURE__ */ new Map();
174
+ rules.forEach((ruleData, ruleName) => {
175
+ const source = ruleData.source;
176
+ if (!rulesBySource.has(source)) {
177
+ rulesBySource.set(source, /* @__PURE__ */ new Map());
178
+ }
179
+ rulesBySource.get(source).set(ruleName, ruleData);
180
+ });
181
+ rulesBySource.forEach((sourceRules, source) => {
182
+ console.log(colorize(`
183
+ \u{1F4E6} ${source}:`, "magenta"));
184
+ sourceRules.forEach((ruleData, ruleName) => {
185
+ const shortName = ruleName.replace(/^.*\//, "");
186
+ const severity = formatSeverity(ruleData.severity);
187
+ const severityColored = colorize(`[${severity.toUpperCase()}]`, getSeverityColor(ruleData.severity));
188
+ const hasOptions = ruleData.options && ruleData.options.length > 0;
189
+ const optionsText = hasOptions ? colorize(" (with options)", "cyan") : "";
190
+ console.log(` ${severityColored} ${colorize(shortName, "green")}${optionsText}`);
191
+ if (hasOptions && process.argv.includes("--verbose")) {
192
+ console.log(` ${colorize("Options:", "cyan")} ${JSON.stringify(ruleData.options)}`);
193
+ }
146
194
  });
195
+ });
147
196
  }
148
197
  function printSummary(configs) {
149
- console.log(colorize('\nšŸ“Š Summary:', 'bright'));
150
- console.log(colorize('='.repeat(30), 'blue'));
151
- configs.forEach(({ name, rules }) => {
152
- const totalRules = rules.size;
153
- const errorRules = Array.from(rules.values()).filter(r => r.severity === 'error' || r.severity === 2).length;
154
- const warnRules = Array.from(rules.values()).filter(r => r.severity === 'warn' || r.severity === 1).length;
155
- const offRules = Array.from(rules.values()).filter(r => r.severity === 'off' || r.severity === 0).length;
156
- console.log(`\n${colorize(name, 'bright')}: ${totalRules} total rules`);
157
- console.log(` ${colorize('ā—', 'red')} ${errorRules} errors`);
158
- console.log(` ${colorize('ā—', 'yellow')} ${warnRules} warnings`);
159
- console.log(` ${colorize('ā—', 'cyan')} ${offRules} disabled`);
160
- });
198
+ console.log(colorize("\n\u{1F4CA} Summary:", "bright"));
199
+ console.log(colorize("=".repeat(30), "blue"));
200
+ configs.forEach(({ name, rules }) => {
201
+ const totalRules = rules.size;
202
+ const errorRules = Array.from(rules.values()).filter(
203
+ (r) => r.severity === "error" || r.severity === 2
204
+ ).length;
205
+ const warnRules = Array.from(rules.values()).filter(
206
+ (r) => r.severity === "warn" || r.severity === 1
207
+ ).length;
208
+ const offRules = Array.from(rules.values()).filter(
209
+ (r) => r.severity === "off" || r.severity === 0
210
+ ).length;
211
+ console.log(`
212
+ ${colorize(name, "bright")}: ${totalRules} total rules`);
213
+ console.log(` ${colorize("\u25CF", "red")} ${errorRules} errors`);
214
+ console.log(` ${colorize("\u25CF", "yellow")} ${warnRules} warnings`);
215
+ console.log(` ${colorize("\u25CF", "cyan")} ${offRules} disabled`);
216
+ });
161
217
  }
162
218
  function printUsageInfo() {
163
- console.log(colorize('\nšŸ’” Usage Information:', 'bright'));
164
- console.log(colorize('='.repeat(30), 'blue'));
165
- console.log('\nšŸ“– How to use these configurations:');
166
- console.log('\n' + colorize('ESLint 8 (.eslintrc):', 'green'));
167
- console.log(' extends: ["plugin:functype/recommended"]');
168
- console.log('\n' + colorize('ESLint 9+ (flat config):', 'green'));
169
- console.log(' Copy the rules from our documentation into your eslint.config.js');
170
- console.log('\n' + colorize('Individual rules:', 'green'));
171
- console.log(' You can enable any rule individually in your rules section');
219
+ console.log(colorize("\n\u{1F4A1} Usage Information:", "bright"));
220
+ console.log(colorize("=".repeat(30), "blue"));
221
+ console.log("\n\u{1F4D6} How to use these configurations:");
222
+ console.log("\n" + colorize("ESLint 8 (.eslintrc):", "green"));
223
+ console.log(' extends: ["plugin:functype/recommended"]');
224
+ console.log("\n" + colorize("ESLint 9+ (flat config):", "green"));
225
+ console.log(" Copy the rules from our documentation into your eslint.config.js");
226
+ console.log("\n" + colorize("Individual rules:", "green"));
227
+ console.log(" You can enable any rule individually in your rules section");
228
+ }
229
+ function printDependencyStatus(result) {
230
+ console.log(colorize("\n\u{1F50D} Dependency Status Check:", "bright"));
231
+ console.log(colorize("=".repeat(40), "blue"));
232
+ if (result.available.length > 0) {
233
+ console.log(colorize("\n\u2705 Available:", "green"));
234
+ result.available.forEach((dep) => {
235
+ const icon = dep.required ? "\u{1F527}" : "\u{1F50C}";
236
+ console.log(` ${icon} ${colorize(dep.name, "green")} - ${dep.description}`);
237
+ });
238
+ }
239
+ if (result.missing.length > 0) {
240
+ console.log(colorize("\n\u274C Missing:", "red"));
241
+ result.missing.forEach((dep) => {
242
+ const icon = dep.required ? "\u26A0\uFE0F " : "\u{1F4A1}";
243
+ const color = dep.required ? "red" : "yellow";
244
+ console.log(` ${icon} ${colorize(dep.name, color)} - ${dep.description}`);
245
+ });
246
+ if (result.installCommand) {
247
+ console.log(colorize("\n\u{1F4E6} Install missing dependencies:", "bright"));
248
+ console.log(` ${colorize(result.installCommand, "cyan")}`);
249
+ }
250
+ }
251
+ if (result.warnings.length > 0) {
252
+ console.log(colorize("\n\u26A0\uFE0F Warnings:", "yellow"));
253
+ result.warnings.forEach((warning) => console.log(` ${warning}`));
254
+ }
255
+ const status = result.isValid ? "\u2705 Ready to use" : "\u274C Configuration will fail";
256
+ const statusColor = result.isValid ? "green" : "red";
257
+ console.log(colorize(`
258
+ ${status}`, statusColor));
172
259
  }
173
260
  async function main() {
174
- const args = process.argv.slice(2);
175
- const showHelp = args.includes('--help') || args.includes('-h');
176
- const showUsage = args.includes('--usage') || args.includes('-u');
177
- if (showHelp) {
178
- console.log(colorize('šŸ“‹ ESLint Plugin Functype - Rule Lister', 'bright'));
179
- console.log('\nUsage: pnpm run list-rules [options]');
180
- console.log('\nOptions:');
181
- console.log(' --verbose, -v Show rule options');
182
- console.log(' --usage, -u Show usage examples');
183
- console.log(' --help, -h Show this help message');
184
- console.log('\nThis command lists all rules configured in the functype plugin configurations.');
185
- return;
261
+ const args = process.argv.slice(2);
262
+ const showHelp = args.includes("--help") || args.includes("-h");
263
+ const showUsage = args.includes("--usage") || args.includes("-u");
264
+ const checkDeps = args.includes("--check-deps") || args.includes("--check");
265
+ if (showHelp) {
266
+ console.log(colorize("\u{1F4CB} ESLint Plugin Functype - Rule Lister", "bright"));
267
+ console.log("\nUsage: pnpm run list-rules [options]");
268
+ console.log("\nOptions:");
269
+ console.log(" --verbose, -v Show rule options");
270
+ console.log(" --usage, -u Show usage examples");
271
+ console.log(" --check-deps Check peer dependency status");
272
+ console.log(" --help, -h Show this help message");
273
+ console.log("\nThis command lists all rules configured in the functype plugin configurations.");
274
+ return;
275
+ }
276
+ if (checkDeps) {
277
+ console.log(colorize("\u{1F527} ESLint Plugin Functype - Dependency Check", "bright"));
278
+ const result = validatePeerDependencies();
279
+ printDependencyStatus(result);
280
+ if (!result.isValid) {
281
+ process.exit(1);
186
282
  }
187
- console.log(colorize('šŸ”§ ESLint Plugin Functype - Supported Rules', 'bright'));
188
- const distPath = path_1.default.join(__dirname, '..', '..', 'dist');
189
- if (!fs_1.default.existsSync(distPath)) {
190
- console.error(colorize('āŒ Build directory not found. Run `pnpm run build` first.', 'red'));
191
- process.exit(1);
283
+ return;
284
+ }
285
+ console.log(colorize("\u{1F527} ESLint Plugin Functype - Supported Rules", "bright"));
286
+ const distPath = path__default.default.join(__dirname, "..", "..", "dist");
287
+ if (!fs__default.default.existsSync(distPath)) {
288
+ console.error(colorize("\u274C Build directory not found. Run `pnpm run build` first.", "red"));
289
+ process.exit(1);
290
+ }
291
+ const configs = [
292
+ {
293
+ name: "Recommended",
294
+ path: path__default.default.join(distPath, "configs", "recommended.js")
295
+ },
296
+ {
297
+ name: "Strict",
298
+ path: path__default.default.join(distPath, "configs", "strict.js")
192
299
  }
193
- const configs = [
194
- {
195
- name: 'Recommended',
196
- path: path_1.default.join(distPath, 'configs', 'recommended.js')
197
- },
198
- {
199
- name: 'Strict',
200
- path: path_1.default.join(distPath, 'configs', 'strict.js')
201
- }
202
- ];
203
- const loadedConfigs = [];
204
- for (const { name, path: configPath } of configs) {
205
- const config = await loadConfig(configPath);
206
- if (config) {
207
- const rules = extractRules(config);
208
- loadedConfigs.push({ name, rules });
209
- printRules(name, rules);
210
- }
300
+ ];
301
+ const loadedConfigs = [];
302
+ for (const { name, path: configPath } of configs) {
303
+ const config = await loadConfig(configPath);
304
+ if (config) {
305
+ const rules = extractRules(config);
306
+ loadedConfigs.push({ name, rules });
307
+ printRules(name, rules);
211
308
  }
212
- if (loadedConfigs.length > 0) {
213
- printSummary(loadedConfigs);
214
- if (showUsage) {
215
- printUsageInfo();
216
- }
217
- console.log(colorize('\nšŸ’” Tips:', 'bright'));
218
- console.log('• Use --verbose to see rule options');
219
- console.log('• Use --usage to see configuration examples');
220
- console.log('• Red rules will cause build failures');
221
- console.log('• Yellow rules are warnings only');
222
- console.log('• Blue rules are disabled by default');
223
- console.log(colorize('\nšŸ”— Links:', 'bright'));
224
- console.log('• Documentation: https://github.com/jordanburke/eslint-plugin-functype');
225
- console.log('• eslint-plugin-functional: https://github.com/eslint-functional/eslint-plugin-functional');
226
- console.log('• @typescript-eslint: https://typescript-eslint.io/');
309
+ }
310
+ if (loadedConfigs.length > 0) {
311
+ printSummary(loadedConfigs);
312
+ if (showUsage) {
313
+ printUsageInfo();
227
314
  }
315
+ console.log(colorize("\n\u{1F4A1} Tips:", "bright"));
316
+ console.log("\u2022 Use --verbose to see rule options");
317
+ console.log("\u2022 Use --usage to see configuration examples");
318
+ console.log("\u2022 Red rules will cause build failures");
319
+ console.log("\u2022 Yellow rules are warnings only");
320
+ console.log("\u2022 Blue rules are disabled by default");
321
+ console.log(colorize("\n\u{1F517} Links:", "bright"));
322
+ console.log("\u2022 Documentation: https://github.com/jordanburke/eslint-plugin-functype");
323
+ console.log("\u2022 eslint-plugin-functional: https://github.com/eslint-functional/eslint-plugin-functional");
324
+ console.log("\u2022 @typescript-eslint: https://typescript-eslint.io/");
325
+ }
228
326
  }
229
- // Run the CLI
230
- main().catch(error => {
231
- console.error(colorize('āŒ Unexpected error:', 'red'), error);
232
- process.exit(1);
327
+ main().catch((error) => {
328
+ console.error(colorize("\u274C Unexpected error:", "red"), error);
329
+ process.exit(1);
233
330
  });
331
+ //# sourceMappingURL=list-rules.js.map
332
+ //# sourceMappingURL=list-rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/dependency-validator.ts","../../src/cli/list-rules.ts"],"names":["configModule","path","fs"],"mappings":";;;;;;;;;;;;;;;;;;;AASA,IAAM,iBAAA,GAAsC;AAAA,EAC1C;AAAA,IACE,IAAA,EAAM,kCAAA;AAAA,IACN,WAAA,EAAa,kCAAA;AAAA,IACb,WAAA,EAAa,+BAAA;AAAA,IACb,QAAA,EAAU;AAAA,GACZ;AAAA,EACA;AAAA,IACE,IAAA,EAAM,2BAAA;AAAA,IACN,WAAA,EAAa,2BAAA;AAAA,IACb,WAAA,EAAa,8BAAA;AAAA,IACb,QAAA,EAAU;AAAA,GACZ;AAAA,EACA;AAAA,IACE,IAAA,EAAM,0BAAA;AAAA,IACN,WAAA,EAAa,0BAAA;AAAA,IACb,WAAA,EAAa,qCAAA;AAAA,IACb,QAAA,EAAU;AAAA,GACZ;AAAA,EACA;AAAA,IACE,IAAA,EAAM,wBAAA;AAAA,IACN,WAAA,EAAa,wBAAA;AAAA,IACb,WAAA,EAAa,uBAAA;AAAA,IACb,QAAA,EAAU;AAAA,GACZ;AAAA,EACA;AAAA,IACE,IAAA,EAAM,kCAAA;AAA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b,MAAA,cAAA,EAAe;AAAA,IACjB;AAEA,IAAA,OAAA,CAAQ,GAAA,CAAI,QAAA,CAAS,mBAAA,EAAc,QAAQ,CAAC,CAAA;AAC5C,IAAA,OAAA,CAAQ,IAAI,0CAAqC,CAAA;AACjD,IAAA,OAAA,CAAQ,IAAI,kDAA6C,CAAA;AACzD,IAAA,OAAA,CAAQ,IAAI,4CAAuC,CAAA;AACnD,IAAA,OAAA,CAAQ,IAAI,uCAAkC,CAAA;AAC9C,IAAA,OAAA,CAAQ,IAAI,2CAAsC,CAAA;AAElD,IAAA,OAAA,CAAQ,GAAA,CAAI,QAAA,CAAS,oBAAA,EAAe,QAAQ,CAAC,CAAA;AAC7C,IAAA,OAAA,CAAQ,IAAI,6EAAwE,CAAA;AACpF,IAAA,OAAA,CAAQ,IAAI,gGAA2F,CAAA;AACvG,IAAA,OAAA,CAAQ,IAAI,0DAAqD,CAAA;AAAA,EACnE;AACF;AAGA,IAAA,EAAK,CAAE,MAAM,CAAA,KAAA,KAAS;AACpB,EAAA,OAAA,CAAQ,KAAA,CAAM,QAAA,CAAS,0BAAA,EAAuB,KAAK,GAAG,KAAK,CAAA;AAC3D,EAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAChB,CAAC,CAAA","file":"list-rules.js","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 \n ? `pnpm add -D ${missingPackageNames.join(' ')}`\n : ''\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\n .map(dep => ` • ${dep.name} - ${dep.description}`)\n .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' && \n process.env.FUNCTYPE_SKIP_VALIDATION !== 'true'\n}","#!/usr/bin/env node\n\nimport fs from 'fs'\nimport path from 'path'\nimport { validatePeerDependencies, type ValidationResult } from '../utils/dependency-validator'\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\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 // For built JS files, use require\n if (configPath.endsWith('.js')) {\n const configModule = require(configPath)\n return configModule.default || configModule\n }\n \n // For TS files, we'd need to use dynamic import\n const configModule = await import(configPath)\n return configModule.default || configModule\n } catch (error) {\n console.error(\n colorize(`Error loading config from ${configPath}:`, 'red'), \n (error as Error).message\n )\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 => \n r.severity === 'error' || r.severity === 2\n ).length\n const warnRules = Array.from(rules.values()).filter(r => \n r.severity === 'warn' || r.severity === 1\n ).length\n const offRules = Array.from(rules.values()).filter(r => \n r.severity === 'off' || r.severity === 0\n ).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 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 \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(' --help, -h Show this help message')\n console.log('\\nThis command lists all rules configured in the functype plugin configurations.')\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-plugin-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})"]}