Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct use of typescript type declarations in the codebase #6263

Open
rigolepe opened this issue Feb 11, 2025 · 0 comments
Open

Correct use of typescript type declarations in the codebase #6263

rigolepe opened this issue Feb 11, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@rigolepe
Copy link

rigolepe commented Feb 11, 2025

Feature Request

The generation of typescript type declarations fails: npx tsc. The errors can be revealed by running the existing type-check script for the frontend codebase:

npm run type-check

gives:

Found 27 errors in 18 files.

Errors  Files
     1  src/components/common/animatedNumbers/index.tsx:2
     1  src/components/common/arrayReaderComponent/index.tsx:1
     1  src/components/core/parameterRenderComponent/components/tableComponent/components/loadingOverlay/index.tsx:1
     1  src/CustomNodes/NoteNode/components/color-picker-buttons.tsx:3
     1  src/icons/AIML/index.tsx:6
     1  src/icons/athena/index.tsx:9
     1  src/icons/freezeAll/index.tsx:9
     1  src/icons/Perplexity/index.tsx:2
     3  src/modals/codeAreaModal/index.tsx:180
     1  src/modals/IOModal/components/chatView/chatInput/hooks/use-handle-file-change.ts:8
     1  src/pages/FlowPage/components/extraSidebarComponent/index.tsx:224
     1  src/pages/FlowPage/components/extraSidebarComponent/SidebarCategoryComponent/index.tsx:2
     1  src/pages/MainPage/oldComponents/componentsComponent/index.tsx:164
     1  src/pages/MainPage/utils/handle-download-folder.ts:2
     3  src/pages/ProfileSettingsPage/index.tsx:9
     1  src/pages/SettingsPage/pages/GeneralPage/components/ProfileGradientForm/index.tsx:2
     1  src/pages/SettingsPage/pages/GlobalVariablesPage/index.tsx:41
     6  src/reportWebVitals.ts:1

The errors above ensure that editors (such as vscode) are littered with "red underlined code" because of incomplete type information. This undercuts the advantage of using typescript in the first place.

Motivation

Typescript enforces type safety, but it looks like this feature is a ignored in a lot of files. A lot can be fixed quickly by correcting the import paths.

Your Contribution

I could prepare a PR if core developers have no time to have a look at this. Let me know.

@rigolepe rigolepe added the enhancement New feature or request label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant