Skip to content

Remove lodash and improve code quality#24

Open
Ghost---Shadow wants to merge 1 commit intomainfrom
refactor/code-quality
Open

Remove lodash and improve code quality#24
Ghost---Shadow wants to merge 1 commit intomainfrom
refactor/code-quality

Conversation

@Ghost---Shadow
Copy link
Owner

Summary

  • Remove lodash dependency entirely — replaced all usages with native JS (optional chaining, spread operator, JSON-based deep clone). This drops 1 production dependency and ~600KB from the install footprint.
  • Clean up imports — remove unused @babel/core require in plugin-helpers.js, rename legacy babylon variable to parser in frozen-asts.js
  • Extract BLACKLISTED_JSX_ATTRIBUTES to a module-level constant for readability
  • Simplify boolean logic and remove outdated inline comments

Test plan

  • All 36 tests pass
  • Lint passes (0 errors, 5 warnings — all expected no-console in CLI entry point)
  • 0 vulnerabilities

🤖 Generated with Claude Code

- Remove lodash entirely, replace with native JS:
  - _.get() → optional chaining (?.) and direct property access
  - _.merge() → spread operator ({...obj})
  - _.cloneDeep() → JSON.parse(JSON.stringify()) for plain AST nodes
- Remove unused @babel/core require in plugin-helpers.js, import
  types from @babel/core directly where needed
- Rename legacy 'babylon' variable to 'parser' in frozen-asts.js
- Extract BLACKLISTED_JSX_ATTRIBUTES to a module-level constant
- Simplify isBlacklistedForJsxAttribute boolean return
- Remove outdated inline comments

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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