diff --git a/scripts/check-skills-index.mjs b/scripts/check-skills-index.mjs index 91b5a2c..0a27ad9 100644 --- a/scripts/check-skills-index.mjs +++ b/scripts/check-skills-index.mjs @@ -14,11 +14,12 @@ function parseSkillsIndex(content) { let currentSkill = null let inSections = false - for (const line of lines) { + for (let i = 0; i < lines.length; i++) { + const line = lines[i] const skillMatch = /^ {2}([\w-]+):\s*$/.exec(line) if (skillMatch) { currentSkill = skillMatch[1] - skills[currentSkill] = { sections: [], lineNumber: lines.indexOf(line) + 1 } + skills[currentSkill] = { sections: [], lineNumber: i + 1 } inSections = false continue } diff --git a/scripts/sync-plugins.mjs b/scripts/sync-plugins.mjs index 95b83fc..32189b3 100644 --- a/scripts/sync-plugins.mjs +++ b/scripts/sync-plugins.mjs @@ -203,8 +203,10 @@ function injectDeprecationNotice(content, notice, label) { if (currentDesc.startsWith(notice)) { return content } - const newFm = fm.replace(/^description:[ \t]*(.*)$/m, `description: ${notice}${currentDesc}`) - return content.replace(fmMatch[0], `---\n${newFm}\n---`) + const newFm = fm.replace(/^description:[ \t]*(.*)$/m, (_, matchedDesc) => { + return `description: ${notice}${matchedDesc}` + }) + return content.replace(fmMatch[0], () => `---\n${newFm}\n---`) } async function loadLocalPlugins() {