@diegovelasquezweb/a11y-engine 0.11.37 → 0.11.39
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/package.json
CHANGED
|
@@ -150,7 +150,7 @@ function getPatternCandidateFile(projectDir, finding) {
|
|
|
150
150
|
return { abs, rel: finding.file, content };
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
function buildPatternAiInput({ finding, candidate }) {
|
|
153
|
+
function buildPatternAiInput({ finding, candidate, projectHints }) {
|
|
154
154
|
// Extract the exact line(s) containing the pattern match so Claude has an
|
|
155
155
|
// unambiguous search anchor instead of inferring it from the full file.
|
|
156
156
|
const fileLines = candidate.content.split("\n");
|
|
@@ -181,6 +181,7 @@ function buildPatternAiInput({ finding, candidate }) {
|
|
|
181
181
|
fixCode: finding.fix_code || "",
|
|
182
182
|
},
|
|
183
183
|
files: [{ filePath: candidate.rel, content: candidate.content.slice(0, 12000) }],
|
|
184
|
+
...(projectHints ? { projectContext: projectHints } : {}),
|
|
184
185
|
};
|
|
185
186
|
}
|
|
186
187
|
|
|
@@ -596,7 +597,7 @@ export async function applyFindingFix(input) {
|
|
|
596
597
|
});
|
|
597
598
|
}
|
|
598
599
|
|
|
599
|
-
const aiInput = buildPatternAiInput({ finding, candidate });
|
|
600
|
+
const aiInput = buildPatternAiInput({ finding, candidate, projectHints });
|
|
600
601
|
const candidateSet = new Set([candidate.rel]);
|
|
601
602
|
|
|
602
603
|
let patchOutput = null;
|
|
@@ -201,6 +201,10 @@ export function scanPattern(pattern, scanDir, projectDir = scanDir) {
|
|
|
201
201
|
regex.lastIndex = 0;
|
|
202
202
|
if (!regex.test(lines[i])) continue;
|
|
203
203
|
|
|
204
|
+
// Skip matches inside comments — they are not real code issues
|
|
205
|
+
const trimmed = lines[i].trim();
|
|
206
|
+
if (trimmed.startsWith("<!--") || trimmed.startsWith("{/*") || trimmed.startsWith("//")) continue;
|
|
207
|
+
|
|
204
208
|
const contextStart = Math.max(0, i - 3);
|
|
205
209
|
const contextEnd = Math.min(lines.length - 1, i + 3);
|
|
206
210
|
const context = lines
|