Skip to content

Remove always-true conditional in findConfigForHtmlFile - #431

Merged
coliff merged 2 commits into
mainfrom
claude/project-thread-418nvq
Oct 10, 2026
Merged

coliff merged 2 commits into
mainfrom
claude/project-thread-418nvq

Conversation

@coliff

@coliff coliff commented Oct 10, 2026

Copy link
Copy Markdown
Member

Requested by Christian · project thread

Before: findConfigForHtmlFile ended with if (!options). options was only assigned right before an early return, so at that point it was always undefined and the check was always true (flagged as a useless conditional).

After: the local options variable is gone. The loop returns the cached config directly, and the end of the function logs "No config file found" and returns undefined unconditionally.

How: behaviour is unchanged; the function returns the same values in every path. Both packages compile and the file passes Prettier.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KuJTTYq3CpvR1S6x5iQxwH


Generated by Claude Code

options was only assigned right before an early return, so it was always
undefined at the end of the function and the !options check was always true.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KuJTTYq3CpvR1S6x5iQxwH
@coliff coliff self-assigned this Oct 10, 2026
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused refactor preserves all existing return paths and fallback behavior.

0 open findings

What changed in this PR

Removes a redundant conditional from configuration discovery without changing behavior.

Changes:

  • Returns cached configuration directly.
  • Unconditionally logs and returns undefined when no configuration is found.
File Description
htmlhint-server/​src/​server.ts Simplifies findConfigForHtmlFile control flow.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@coliff
coliff merged commit 4cb0e0e into main Oct 10, 2026
12 checks passed
@coliff
coliff deleted the claude/project-thread-418nvq branch October 10, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants