Skip to content

Conversation

@jgunnink
Copy link
Member

This pull request introduces several improvements to the SDK, focusing on code quality, robustness, and documentation.

  • Linter Setup (ESLint):

    • Integrated ESLint with TypeScript support to enforce consistent code style and catch potential errors early.
    • Added an eslint.config.js file with recommended rules for ESLint and TypeScript.
    • Included a new lint script in package.json for easy execution.
    • Corrected all existing linting issues across the codebase.
  • Enhanced Input Validation:

    • Strengthened the getFlag function by adding validation for the userContext object. It now ensures that all provided context values are of a permitted type (string, number, or boolean).
    • Added a corresponding test case to verify that the new validation correctly throws an error for invalid userContext data.
  • Improved Documentation:

    • Updated the README.md to include a new Error Handling section. This section details the custom error types (APIError, InvalidResponseError, NetworkError) and provides a clear example of how to catch and handle them.

@jgunnink jgunnink merged commit 82e618d into main Jul 10, 2025
5 checks passed
@jgunnink jgunnink deleted the touch-ups branch July 10, 2025 01: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.

2 participants