con un clic
fix-jscpd
// Decision framework for fixing jscpd (copy-paste detector) errors. Use when asked to fix jscpd issues, copy-paste errors, clones or COPYPASTE lint failures.
// Decision framework for fixing jscpd (copy-paste detector) errors. Use when asked to fix jscpd issues, copy-paste errors, clones or COPYPASTE lint failures.
Style rules for updating CHANGELOG.md entries. Use whenever the user asks to update, add to, or write entries in CHANGELOG.md.
Implement a feature, bug fix, or code change in sfdx-hardis. Use whenever the user asks to add a feature, fix a bug, implement something, or make a code change - with or without a prior /design phase.
Watch the GitHub PR for the current branch, wait for CI to finish, and autonomously fix failing jobs by reading logs, editing sources, and pushing. Stops cleanly when stuck.
sfdx-hardis project architecture, technology stack, provider pattern, configuration system, and project structure. Use when working with project structure, providers, hooks, or config.
How sfdx-hardis monitoring commands, notification types, frequency, and per-channel routing fit together. Use when adding a new monitoring command, adding a new notification type, changing default routing thresholds, or wiring a new channel.
Code examples and patterns for using i18n translations in sfdx-hardis source code (uxLog, uxLogTable, prompts, markers). Use when adding or modifying user-visible strings.
| name | fix-jscpd |
| description | Decision framework for fixing jscpd (copy-paste detector) errors. Use when asked to fix jscpd issues, copy-paste errors, clones or COPYPASTE lint failures. |
| user-invocable | false |
When jscpd reports a clone, decide between factorization and ignore comments based on these criteria.
Examples in this project: buildPersonaCols(n) in profiles-extract.ts, formatLimitLine(limit) in limits.ts.
/* jscpd:ignore-start */ / /* jscpd:ignore-end */ whenagent, debug, websocket, skipauth).buildInitialMarkdownLines in different DocBuilder subclasses).Place /* jscpd:ignore-start */ on the line before the first duplicate line, and /* jscpd:ignore-end */ on the line after the last duplicate line. Keep the comments on their own lines, indented to match the surrounding code.
/* jscpd:ignore-start */
for (const catcher of catchers) {
const results = await catchMatches(catcher, file, fileText, this);
this.matchResults.push(...results);
}
/* jscpd:ignore-end */
Add a private (or private static) helper method to the enclosing class, or a module-level function if the logic is pure and stateless.
private static formatLimitLine(limit: any): string {
return `• ${limit.name}: *${limit.percentUsed}%* used (${limit.used}/${limit.max})`;
}
Then replace the duplicate .map(...) blocks with .map(MyClass.formatLimitLine).
The agent, debug, websocket, and skipauth flags appear in every command. These are always intentional duplicates - wrap them with jscpd:ignore rather than abstracting.