-
Notifications
You must be signed in to change notification settings - Fork 663
Scheduler: fix ts issues in demos in strict mode #32101
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
Conversation
apps/demos/Demos/Scheduler/GoogleCalendarIntegration/React/App.tsx
Outdated
Show resolved
Hide resolved
| }; | ||
|
|
||
| const setComponentAria = (element) => { | ||
| const setComponentAria = (element: dxElementWrapper) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the DxElement would be a better option here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| }, | ||
| ]; | ||
| export const schedulerDataSource = new DataSource(data); | ||
| export const schedulerDataSource = new DataSource(data) as unknown as DataSource<SchedulerTypes.Appointment>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to type that without 'as unknown'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I researched other demos and found way to use data instead of dataSource, like this https://github.com/DevExpress/DevExtreme/blob/577ad2c1d9e95357851643cbcfcae8bda262d223/apps/demos/Demos/Scheduler/Adaptability/React/App.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes TypeScript strict mode issues in Scheduler demos by enabling strict type checking and resolving the resulting compilation errors. The changes primarily involve improving type safety through better import patterns, null safety checks, and explicit type conversions.
Key Changes
- Removed Scheduler and Pagination demos from the strict mode exclusion list in
tsconfig.react-check.json, enabling strict type checking for these demos - Separated type-only imports using the
typekeyword to comply withverbatimModuleSyntaxconfiguration - Added null safety checks with optional chaining (
?.) to handle potentially undefined values - Replaced direct data arrays with
DataSourcewrapper to ensure proper type handling
Reviewed changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| apps/demos/tsconfig.react-check.json | Removed Scheduler/Pagination exclusions; added new component exclusions to expand strict type checking coverage |
| apps/demos/Demos/Scheduler//React/.tsx | Separated type-only imports from value imports using type keyword |
| apps/demos/Demos/Scheduler/Toolbar/React/* | Replaced DataSource wrapper with plain array, added explicit Number() conversion for cellDuration |
| apps/demos/Demos/Scheduler/Templates/React/* | Added null safety checks with optional chaining for form instance operations |
| apps/demos/Demos/Scheduler/Editing/React/* | Added nullish coalescing operator to handle potentially undefined text values |
| apps/demos/Demos/Scheduler/CellTemplates/React/* | Changed null to undefined for className, added type guards, improved null safety |
| apps/demos/Demos/Scheduler/ContextMenu/React/* | Added optional chaining for potentially undefined properties |
| apps/demos/Demos/Scheduler/GoogleCalendarIntegration/React/* | Added proper typing for getData function parameters |
| apps/demos/Demos/Pagination/Overview/React/* | Separated type-only imports using type keyword |
Comments suppressed due to low confidence (1)
apps/demos/tsconfig.react-check.json:61
- The
Demos/Localization/**/React/**/*.tsandDemos/Localization/**/React/**/*.tsxpatterns are duplicated in the exclude list. Lines 30-31 and lines 60-61 contain the same exclusion patterns. One set should be removed to avoid redundancy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 46 out of 46 changed files in this pull request and generated 4 comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 46 out of 46 changed files in this pull request and generated 7 comments.
apps/demos/Demos/Scheduler/Templates/React/MovieInfoContainer.tsx
Outdated
Show resolved
Hide resolved
apps/demos/Demos/Scheduler/Templates/ReactJs/MovieInfoContainer.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 46 out of 46 changed files in this pull request and generated 3 comments.
Co-authored-by: EugeniyKiyashko <[email protected]>

No description provided.