Skip to content

refactor: improve type safety and revamp api client#2343

Open
jcscottiii wants to merge 1 commit intomainfrom
jcscottiii/enforce-strictness
Open

refactor: improve type safety and revamp api client#2343
jcscottiii wants to merge 1 commit intomainfrom
jcscottiii/enforce-strictness

Conversation

@jcscottiii
Copy link
Collaborator

@jcscottiii jcscottiii commented Mar 17, 2026

Refactored the frontend to use stricter typing and path-aware response handling. Replaced unsafe type assertions with type guards and updated the API client to handle specific status codes more robustly.

  • Reorganized api/client.ts to use status code handlers per endpoint
  • Added type guards for saved searches and vendor positions
  • Cleaned up manual casts and redundant checks across components
  • Fixed various linting and formatting issues to match project standards

Rules that are enabled now:

      '@typescript-eslint/no-explicit-any': 'error',
      '@typescript-eslint/no-unsafe-type-assertion': 'error',
      '@typescript-eslint/no-unnecessary-type-assertion': 'error',
      '@typescript-eslint/no-restricted-types': [
        'error',
        {
          types: {
            unknown:
              'Prefer explicit types or type guards instead of unknown. Use unknown only in tests or where absolutely unavoidable.',
          },
        },
      ],

This prevents the use of any, as type casting and unknown

@jcscottiii jcscottiii force-pushed the jcscottiii/enforce-strictness branch 3 times, most recently from aba23b2 to d97810d Compare March 18, 2026 16:13
Refactored the frontend to use stricter typing and path-aware response handling. Replaced unsafe type assertions with type guards and updated the API client to handle specific status codes more robustly.

- Reorganized api/client.ts to use status code handlers per endpoint
- Added type guards for saved searches and vendor positions
- Cleaned up manual casts and redundant checks across components
- Fixed various linting and formatting issues to match project standards
@jcscottiii jcscottiii force-pushed the jcscottiii/enforce-strictness branch from d97810d to 315f397 Compare March 18, 2026 17:37
@jcscottiii jcscottiii requested a review from neilv-g March 18, 2026 17:51
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