V1.1.0 #12
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
codetease/mep!12
Loading…
Reference in a new issue
No description provided.
Delete branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
feat: Upgrade syntax highlighting module
@ -94,52 +95,68 @@ export class CodePrompt extends Prompt<string, CodeOptions> {const shouldHighlight = this.options.highlight !== false;Unused variable, import, function or class
Unused variable currentAnsi.
In general, unused local variables should either be removed or, if they represent an intended but not yet implemented feature, be put to actual use. Since
currentAnsiis not used anywhere and there is no clear behavior missing from the method, the safest fix that does not change existing functionality is simply to remove the variable declaration.Concretely, in
src/prompts/code.tsinside therendermethod’s highlighting block, removelet currentAnsi = '';on line 102. No additional imports, methods, or definitions are needed; the rest of the logic already operates correctly usingsequence,activeColor, andhighlighted. This will eliminate the CodeQL warning without changing runtime behavior.@ -0,0 +1,206 @@import { highlight, highlightEnv, highlightToml, highlightJson, highlightCsv, highlightShell, highlightProperties } from '../src/highlight';Unused variable, import, function or class
Unused variable expected.
In general, an unused variable should either be removed or used. To avoid changing existing functionality, the simplest and safest fix here is to remove the unused
expectedvariable in thehighlightJson"should highlight keys" test while keeping its explanatory comments, since the test currently usestoContainassertions that do not depend onexpected.Concretely, in
test/highlight.test.ts, inside thedescribe('highlightJson', ...)block, in theit('should highlight keys', ...)test, delete theconst expected = ...declaration and its continuation lines (66–71). Keep the surrounding comments that describe the regex behavior if they are useful, but ensure there is no remainingexpectedidentifier that’s not used. No imports or additional methods are needed.In this commit:
highlightCsv,highlightShell, andhighlightPropertiesintest/highlight.test.ts.CodeOptionsinsrc/types.tsto includecsv,sh,bash,zsh,properties,props, andconf.examples/code-prompt.ts.highlightTomltests to match current implementation behavior.