Skip to content

v0.8.0: code quality improvements

Choose a tag to compare

@ctorgalson ctorgalson released this 17 Oct 12:33
· 143 commits to main since this release
7fea9e2

Changelog - 2025-10-17

Code Quality Improvements

Type Safety

  • Added null checks for DOM queries with clear error messages
  • Fixed intervalId type (removed NodeJS.Timeout, now number | undefined)
  • Changed slides to NodeListOf<HTMLElement> for proper typing
  • Made playPauseButton nullable to reflect optional element
  • Updated constructor to accept Partial<BhCarouselSettings>
  • Fixed createEvent() return type to CustomEvent<BhCarouselEventDetail>

Code Efficiency

  • Converted public API methods to standard method syntax (keeping event handlers as arrow functions for proper this binding)
  • Removed unnecessary event.currentTarget checks from handlers

TypeScript Conventions

  • Cleaned up JSDoc comments (removed redundant @public, @protected, and @param {Type} annotations)
  • Fixed typo in interface documentation
  • Enabled TypeScript declarations with declarationDir: "dist/js"

Build Configuration

  • Added explicit exports: "default" to CommonJS outputs in Rollup config for consistent usage across all module formats