Changes required for compiling in strict mode #600

Closed
opened 2025-08-09 17:16:55 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @stephtr on 7/8/2017

EDIT: This issue has nothing to do with projects generated using the template throwing errors while running webpack. For a solution to that problem see #1099.


Even though I'm not sure if TypeScript's strict should be activated by default, I think that the templates should at least compile when a user decides to enable strict mode.
At the moment the ReactRedux template throws a few issues:

  • ./ClientApp/boot-client.tsx:5:30 TS7016: Could not find a declaration file for module 'react-hot-loader'.

  • ./ClientApp/configureStore.ts:15:51 TS7006: Parameter 'f' implicitly has an 'any' type.

  • ./ClientApp/configureStore.ts:33:27 TS7006: Parameter 'allReducers' implicitly has an 'any' type.

  • ./ClientApp/store/WeatherForecasts.ts:63:7 TS2322: Type '{ startDateIndex: null; forecasts: never[]; isLoading: false; }' is not assignable to type 'WeatherForecastsState'. Types of property 'startDateIndex' are incompatible. Type 'null' is not assignable to type 'number'.

All of these issues can be fixed with just small modifications. Should I create a PR?

*Originally created by @stephtr on 7/8/2017* **EDIT:** This issue has nothing to do with projects generated using the template throwing errors while running webpack. For a solution to that problem see [#1099](https://github.com/aspnet/JavaScriptServices/issues/1099#issuecomment-313876245). --- Even though I'm not sure if TypeScript's ```strict``` should be activated by default, I think that the templates should at least compile when a user decides to enable strict mode. At the moment the ReactRedux template throws a few issues: - ```./ClientApp/boot-client.tsx:5:30 TS7016: Could not find a declaration file for module 'react-hot-loader'.``` - ```./ClientApp/configureStore.ts:15:51 TS7006: Parameter 'f' implicitly has an 'any' type.``` - ```./ClientApp/configureStore.ts:33:27 TS7006: Parameter 'allReducers' implicitly has an 'any' type.``` - ```./ClientApp/store/WeatherForecasts.ts:63:7 TS2322: Type '{ startDateIndex: null; forecasts: never[]; isLoading: false; }' is not assignable to type 'WeatherForecastsState'. Types of property 'startDateIndex' are incompatible. Type 'null' is not assignable to type 'number'.``` All of these issues can be fixed with just small modifications. Should I create a PR?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#600
No description provided.