Skip to content

refactor(adapter): define isEmptyMapping before its use - #325

Merged
pascalre merged 1 commit into
masterfrom
feat/lint-use-before-define
Nov 19, 2026
Merged

pascalre merged 1 commit into
masterfrom
feat/lint-use-before-define

Conversation

@pascalre

Copy link
Copy Markdown
Owner

DeepSource reported "'isEmptyMapping' was used before it was defined": the helper was declared after the JsYamlAdapter class that calls it. This works at runtime, because the method only runs after the module is loaded, but it reads backwards and is a temporal dead zone trap.

Move the helper above the class and enable
@typescript-eslint/no-use-before-define, so the local lint step and CI catch this before DeepSource does. The rule reports no other findings.

Claude-Session: https://claude.ai/code/session_01Jdb5is9YsMnteaxHryN26M

DeepSource reported "'isEmptyMapping' was used before it was defined":
the helper was declared after the JsYamlAdapter class that calls it.
This works at runtime, because the method only runs after the module
is loaded, but it reads backwards and is a temporal dead zone trap.

Move the helper above the class and enable
@typescript-eslint/no-use-before-define, so the local lint step and CI
catch this before DeepSource does. The rule reports no other findings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jdb5is9YsMnteaxHryN26M
@pascalre
pascalre merged commit 34007f6 into master Nov 19, 2026
5 of 7 checks passed
@pascalre
pascalre deleted the feat/lint-use-before-define branch November 19, 2026 19:53
@sonarqubecloud

Copy link
Copy Markdown

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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.

1 participant