Skip to content

Disable init-declarations in eslint-config#57

Merged
gtbuchanan merged 1 commit intomainfrom
fix/init-declarations
Apr 22, 2026
Merged

Disable init-declarations in eslint-config#57
gtbuchanan merged 1 commit intomainfrom
fix/init-declarations

Conversation

@gtbuchanan
Copy link
Copy Markdown
Owner

Summary

  • Drops init-declarations from @gtbuchanan/eslint-config because it conflicts with unicorn/no-useless-undefined for the common let x: T | undefined; pattern — one rule warns on the missing initializer, the other on the explicit = undefined.
  • Hoisting bugs remain covered by no-var + prefer-const; TypeScript's strict null checks flag genuine use-before-assign for non-optional types.
  • Adds a config-shape test asserting no config enables init-declarations.

Closes #53

Test plan

  • pnpm build:ci passes (32/32 tasks)
  • packages/eslint-config fast tests pass (22/22)
  • Repo continues to lint clean under the new config

🤖 Generated with Claude Code

The `init-declarations` and `unicorn/no-useless-undefined` rules left no
clean way to declare `let x: T | undefined;` — one warns on missing
initializer, the other warns on the explicit `= undefined`. Drop
`init-declarations`; hoisting bugs remain covered by `no-var` +
`prefer-const`, and TypeScript's strict null checks flag genuine
use-before-assign for non-optional types.

Closes #53

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gtbuchanan gtbuchanan merged commit ebcceaf into main Apr 22, 2026
7 of 8 checks passed
@gtbuchanan gtbuchanan deleted the fix/init-declarations branch April 22, 2026 13:27
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.

eslint-config: resolve init-declarations vs unicorn/no-useless-undefined conflict

1 participant