Issue Summary: UI Warnings in React App Build
Issue Title: Warnings when building react app Opened by: jacobbaungard Date: January 16, 2024
Current Situation:
The React application for the Thanos project is generating multiple warnings during compilation, primarily relating to TypeScript and code style issues. Addressing these warnings is crucial to maintaining code quality and allowing the removal of CI=false
from the build step. This will help ensure that new code contributions do not introduce additional warnings.
List of Key Warnings:
- TypeScript Issues: Numerous instances of
Unexpected any
indicating the use of theany
type across various files, suggesting that more specific types should be defined.
- For example:
src/components/ListTree.tsx: Line 30:50
src/hooks/useFetch.ts: Line 12:92
src/pages/status/Status.tsx: Line 15:42
- Non-null Assertions: Multiple occurrences of forbidden non-null assertions.
- Example:
src/pages/config/Config.tsx: Line 30:17
- Naming Conventions: Warnings regarding identifiers not following camelCase.
- Example:
src/pages/graph/CMTheme.tsx: Line 15:7
, whereoutline_fallback
is highlighted.
- Unused Variables: Instances of defined but unused variables.
- Example:
src/pages/targets/Targets.tsx: Line 3:8
whereFilter
is defined but not used.
- Array Callback Issues: Missing return values in array mapping functions.
- Example:
src/thanos/pages/blocks/helpers.ts: Line 155:45
Contributors Involved:
- AbhiRam162105 expressed interest in fixing the issue on February 12, 2024.
- 0ZeKa0 also requested to work on the issue on May 25, 2024.
- bdharsan04 proposed collaboration on July 5, 2024, to work on the issue.
- NishantBansal2003 inquired about testing changes on July 23, 2024, seeking clarification on commands to run.
Recommended Next Steps:
- Identify and replace usages of the
any
type with more specific types throughout the affected components and hooks. - Remove or refactor non-null assertions as per TypeScript best practices.
- Ensure proper naming conventions are followed throughout the codebase.
- Address any instances of unused variables to clean up the code.
- For testing, use the recommended commands (
make check-react-app
andmake react-app-test
) to verify that changes do not break existing functionality, alongside any additional relevant tests.
This compilation of warnings reflects a necessary update plan for the React application, aimed at enhancing maintainability and reducing technical debt.