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

fix: remove ts-strict-ignore for env files and add typing #2683

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

miettal
Copy link
Contributor

@miettal miettal commented Jun 26, 2024

No description provided.

@@ -21,7 +21,7 @@ export interface Environment {
readonly docsUrlPrefix: string;
readonly links: {

readonly COMMON_STORAGE: string,
readonly COMMON_STORAGE: string | null,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default value is null, so I added null.

readonly SETTINGS_NETWORK_CONFIGURATION: string,
readonly SETTINGS_ALERTING: string | null,
readonly SETTINGS_NETWORK_CONFIGURATION: string | null,
readonly EVCS_CLUSTER: string,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is this attribute on theme.ts. but in this file this attribute is missing. so I added it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great 👍

// cf.
// - tools/docker/ui/root/etc/s6-overlay/s6-rc.d/init-nginx/run
// - tools/docker/ui/assets/env.template.js
const window_env = (window as any).env as { [key: string]: string};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

window is exsiting variable, but window.env is added by project dependent code. typing is needed.

Copy link

Code Coverage

@sfeilmeier sfeilmeier requested a review from lukasrgr June 26, 2024 09:21
readonly SETTINGS_NETWORK_CONFIGURATION: string,
readonly SETTINGS_ALERTING: string | null,
readonly SETTINGS_NETWORK_CONFIGURATION: string | null,
readonly EVCS_CLUSTER: string,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great 👍

@lukasrgr lukasrgr requested a review from sfeilmeier June 26, 2024 12:25
@ikegam
Copy link
Contributor

ikegam commented Jun 26, 2024

For upstream, is this your way with really strict with lint and typing? You want to drop all ts-strict-ignore? Then it is same as our will.

@sfeilmeier sfeilmeier merged commit 89db028 into OpenEMS:develop Jun 26, 2024
2 checks passed
@miettal
Copy link
Contributor Author

miettal commented Jun 28, 2024

I share one script. // I only checked this script work in my mac.
This oneliner dump

  • strict mode error numbers
  • line numbers for file
  • filename

and it is sorted by strict mode error number, line numbers for file.

$ script -q /dev/null npx tsc --strict | sed 's/\x1b\[[0-9;]*m//g' | awk '/Errors  Files/ {flag=1; next} flag' | tr ':' ' ' | awk '{print $1, $2}' | while read errors file; do echo "$errors $(wc -l < "$file") $file"; done | sort -k1,1n -k2,2n | sed 1d | tee output.txt

I(and We) will mainly focus on the head files of this list initially. Because small changes are easy to review and can be improved little by little but surely.
This is just information sharing. Thank you.

as of 2024.6 0876dce

1       12 src/app/shared/pipe/classname/classname.pipe.ts
1       12 src/app/shared/pipe/sign/sign.pipe.ts
1       14 src/app/shared/service/utils.spec.ts
1       14 src/themes/openems/environments/backend-dev.ts
1       14 src/themes/openems/environments/backend-prod.ts
1       14 src/themes/openems/environments/edge-dev.ts
1       14 src/themes/openems/environments/edge-prod.ts
1       15 src/app/shared/percentagebar/percentagebar.component.ts
1       15 src/themes/openems/environments/gitpod.ts
1       17 src/app/shared/edge/meter/esscharger/modal.component.ts
1       19 src/app/shared/pipe/keys/keys.pipe.ts
1       22 src/app/shared/genericComponents/modal/modal-button/modal-button.ts
1       27 src/app/edge/history/common/selfconsumption/flat/flat.ts
1       28 src/app/edge/history/common/autarchy/flat/flat.ts
1       30 src/app/edge/history/Controller/Ess/TimeOfUseTariff/flat/flat.ts
1       33 src/app/edge/live/Controller/Ess/FixActivePower/modal/modal.ts
1       34 src/app/shared/service/websocketInterface.ts
1       35 src/app/shared/genericComponents/shared/filter.ts
1       35 src/app/shared/service/pagination.ts
1       38 src/app/edge/settings/settings.component.ts
1       40 src/app/edge/live/Controller/Channelthreshold/Channelthreshold.ts
1       40 src/app/shared/jsonrpc/request/subscribeChannelsRequest.ts
1       41 src/app/shared/history-data-error.component.ts
1       42 src/app/shared/service/globalRouteChangeHandler.ts
1       43 src/app/edge/live/energymonitor/energymonitor.component.ts
1       45 src/app/edge/history/common/production/chart/chargerChart.ts
1       46 src/app/edge/live/Controller/Io/FixDigitalOutput/Io_FixDigitalOutput.ts
1       47 src/app/edge/live/Io/Api_DigitalInput/Io_Api_DigitalInput.ts
1       49 src/app/edge/history/common/production/chart/totalDcChart.ts
1       62 src/app/edge/history/common/consumption/flat/flat.ts
1       63 src/app/edge/edge.component.ts
1       66 src/app/edge/settings/component/install/index.component.ts
1       71 src/app/edge/history/Controller/ChannelThreshold/chart/totalchart.component.ts
1       72 src/app/edge/history/common/production/chart/productionMeterChart.ts
1       77 src/app/edge/history/common/production/chart/totalAcChart.ts
1       84 src/app/edge/live/Controller/Ess/GridOptimizedCharge/flat/flat.ts
1      114 src/app/edge/settings/app/formly/option-group-picker/formly-option-group-picker.component.ts
1      140 src/app/registration/modal/modal.component.ts
1      169 src/app/edge/settings/system/executeSystemUpdate.ts
1      244 src/app/shared/service/defaulttypes.ts
2       12 src/app/shared/type/language.spec.ts
2       14 src/themes/openems/environments/backend-docker.ts
2       14 src/themes/openems/environments/edge-docker.ts
2       17 src/app/shared/genericComponents/modal/model-horizontal-line/modal-horizontal-line.ts
2       18 src/app/shared/genericComponents/flat/flat-widget-line/flat-widget-line.ts
2       30 src/app/edge/history/delayedselltogrid/symmetricpeakshavingchartoverview/delayedselltogridchartoverview.component.ts
2       30 src/app/edge/history/peakshaving/symmetric/symmetricpeakshavingchartoverview/symmetricpeakshavingchartoverview.component.ts
2       30 src/app/edge/history/peakshaving/timeslot/timeslotpeakshavingchartoverview/timeslotpeakshavingchartoverview.component.ts
2       30 src/app/shared/formly/formly-select-field-modal.component.ts
2       31 src/app/edge/history/peakshaving/asymmetric/asymmetricpeakshavingchartoverview/asymmetricpeakshavingchartoverview.component.ts
2       31 src/app/shared/formly/formly-skeleton-wrapper.ts
2       32 src/app/shared/genericComponents/shared/dataservice.ts
2       33 src/app/edge/history/gridoptimizedcharge/gridoptimizedchargechartoverview/gridoptimizedchargechartoverview.component.ts
2       33 src/app/edge/history/heatingelement/heatingelementchartoverview/heatingelementchartoverview.component.ts
2       34 src/app/shared/genericComponents/modal/help-button/help-button.ts
2       35 src/app/edge/history/heatpump/heatpumpchartoverview/heatpumpchartoverview.component.ts
2       36 src/app/edge/live/common/autarchy/flat/flat.ts
2       37 src/app/edge/settings/system/system.component.ts
2       39 src/app/edge/live/common/selfconsumption/flat/flat.ts
2       39 src/app/shared/jsonrpc/request/queryHistoricTimeseriesExportXlxs.ts
2       45 src/app/edge/live/Controller/Ess/FixActivePower/flat/flat.ts
2       49 src/app/edge/live/Controller/Io/FixDigitalOutput/modal/modal.component.ts
2       54 src/app/edge/history/common/autarchy/chart/chart.ts
2       54 src/app/edge/history/common/selfconsumption/chart/chart.component.ts
2       67 src/app/edge/settings/component/update/index.component.ts
2       71 src/app/edge/settings/profile/profile.component.ts
2       78 src/app/edge/history/common/energy/flat/flat.ts
2       81 src/app/edge/settings/app/app.module.ts
2       97 src/app/shared/formly/form-field-default-cases.wrapper.ts
2       98 src/app/shared/genericComponents/flat/abstract-flat-widget-line.ts
2      100 src/app/edge/history/abstracthistorywidget.ts
2      127 src/app/edge/settings/app/formly/reorder-select/formly-reorder-array.component.ts
2      141 src/app/index/login.component.ts
2      155 src/app/shared/type/widget.ts
2      161 src/app/shared/shared.ts
2      203 src/app/shared/genericComponents/shared/converter.ts
3       21 src/app/edge/live/Io/Api_DigitalInput/modal/modal.component.ts
3       30 src/app/index/login.spec.ts
3       33 src/app/edge/history/chpsoc/chpsocchartoverview/chpsocchartoverview.component.ts
3       35 src/app/shared/shared.spec.ts
3       36 src/app/edge/history/singlethreshold/singlethresholdchartoverview/singlethresholdchartoverview.component.ts
3       36 src/app/shared/genericComponents/modal/modal-line/modal-line.ts
3       40 src/app/edge/live/live.component.ts
3       41 src/app/shared/genericComponents/modal/modal-value-line/modal-value-line.ts
3       43 src/app/shared/translate.extension.ts
3       46 src/app/edge/live/Controller/PeakShaving/Symmetric/Symmetric.ts
3       46 src/app/shared/jsonrpc/request/queryHistoricTimeseriesEnergyRequest.ts
3       48 src/app/edge/live/Controller/Ess/TimeOfUseTariff/modal/modal.ts
3       49 src/app/edge/history/fixdigitaloutput/fixdigitaloutputchartoverview/fixdigitaloutputchartoverview.component.ts
3       49 src/app/edge/live/Controller/PeakShaving/Symmetric_TimeSlot/Symmetric_TimeSlot.ts
3       50 src/app/edge/live/common/grid/flat/flat.ts
3       54 src/app/edge/live/delayedselltogrid/delayedselltogrid.component.ts
3       55 src/app/edge/live/livedataservice.ts
3       57 src/app/shared/utils/time/timeutils.ts
3       59 src/app/edge/history/historydataservice.ts
3       61 src/app/edge/live/Controller/Evcs/administration/administration.component.ts
3       65 src/app/edge/settings/system/executesystemupdate.component.ts
3       76 src/app/edge/settings/system/oe-system-update.component.ts
3       82 src/app/shared/genericComponents/chart/chart.ts
3       82 src/app/shared/genericComponents/modal/modal.ts
3       86 src/app/index/filter/filter.component.ts
3       89 src/app/edge/history/heatpump/widget.component.ts
3      107 src/app/edge/history/common/grid/chart/chart.ts
3      130 src/app/edge/history/common/consumption/chart/chart.ts
3      146 src/app/edge/settings/systemexecute/systemexecute.component.ts
3      164 src/app/index/overview/overview.component.ts
3      184 src/app/shared/header/header.component.ts
3      213 src/app/edge/history/common/energy/chart/chart.ts
3      343 src/app/shared/edge/edge.ts
3      464 src/app/edge/history/shared.ts
4       22 src/app/shared/genericComponents/flat/flat.ts
4       23 src/app/shared/genericComponents/modal/modal-info-line/modal-info-line.ts
4       34 src/app/edge/history/peakshaving/asymmetric/widget.component.ts
4       35 src/app/edge/history/delayedselltogrid/widget.component.ts
4       35 src/app/edge/history/peakshaving/timeslot/widget.component.ts
4       35 src/app/edge/settings/app/formly/safe-input/formly-safe-input-modal.component.ts
4       36 src/app/edge/history/peakshaving/symmetric/widget.component.ts
4       38 src/app/edge/history/Controller/ChannelThreshold/flat/flat.ts
4       38 src/app/shared/utils/color/color.utils.ts
4       49 src/app/shared/jsonrpc/request/queryHistoricTimeseriesDataRequest.ts
4       52 src/app/shared/jsonrpc/request/queryHistoricTimeseriesEnergyPerPeriodRequest.ts
4       54 src/app/shared/chartoptions/chartoptions.component.ts
4       63 src/app/edge/live/Controller/PeakShaving/Asymmetric/Asymmetric.ts
4       70 src/app/edge/history/storage/widget.component.ts
4       78 src/app/edge/history/heatingelement/widget.component.ts
4       85 src/app/shared/status/single/status.component.ts
4       88 src/app/edge/history/gridoptimizedcharge/widget.component.ts
4       88 src/app/edge/history/history.component.ts
4       88 src/app/edge/live/common/consumption/flat/flat.ts
4       95 src/app/shared/service/wsdata.ts
4       96 src/app/edge/live/Multiple/Evcs_Api_Cluster/Evcs_Api_Cluster.ts
4      106 src/app/edge/history/fixdigitaloutput/singlechart.component.ts
4      109 src/app/edge/live/Controller/Io/HeatingElement/flat/flat.ts
4      110 src/app/shared/genericComponents/flat/abstract-flat-widget.ts
4      124 src/app/app.component.ts
4      137 src/app/shared/genericComponents/modal/abstractModal.ts
4      162 src/app/edge/live/energymonitor/chart/section/consumption.component.ts
4      162 src/app/edge/live/energymonitor/chart/section/production.component.ts
4      386 src/app/shared/service/websocket.ts
5       11 src/app/shared/utils/time/timeutils.spec.ts
5       34 src/app/shared/genericComponents/chart/chart.constants.spec.ts
5       58 src/app/shared/utils/datetime/datetime-utils.ts
5       69 src/app/edge/history/chpsoc/widget.component.ts
5       75 src/app/edge/history/singlethreshold/widget.component.ts
5       80 src/app/edge/live/Controller/PeakShaving/Symmetric/modal/modal.component.ts
5       81 src/app/edge/live/Controller/Io/Heatpump/Io_Heatpump.ts
5       81 src/app/edge/live/delayedselltogrid/modal/modal.component.ts
5      150 src/app/edge/live/Controller/Ess/GridOptimizedCharge/modal/modal.ts
5      150 src/app/edge/settings/app/update.component.ts
5      160 src/app/edge/live/common/consumption/modal/modal.spec.ts
6       28 src/app/shared/formly/form-field-checkbox-hyperlink/form-field-checkbox-hyperlink.wrapper.ts
6       57 src/app/edge/history/storage/storagechartoverview/storagechartoverview.component.ts
6       58 src/app/edge/settings/app/jsonrpc/getAppAssistant.spec.ts
6       70 src/app/edge/history/fixdigitaloutput/widget.component.ts
6       79 src/app/edge/live/Controller/PeakShaving/Asymmetric/modal/modal.component.ts
6       87 src/app/edge/live/Controller/Io/HeatingElement/modal/modal.ts
6      103 src/app/shared/service/abstractservice.ts
6      107 src/app/shared/genericComponents/abstracthistorywidget.ts
6      107 src/app/shared/genericComponents/chart/abstractHistoryChartOverview.ts
6      172 src/app/edge/history/common/production/chart/totalChart.ts
6      296 src/app/edge/settings/network/network.component.ts
6      312 src/app/edge/settings/alerting/alerting.component.ts
7       63 src/app/edge/settings/profile/aliasupdate.component.ts
7      109 src/app/edge/history/storage/chargerchart.component.ts
7      125 src/app/shared/pickdate/popover/popover.component.ts
7      170 src/app/edge/history/chpsoc/chart.component.ts
7      170 src/app/edge/history/storage/socchart.component.ts
7      200 src/app/edge/settings/system/maintenance/maintenance.ts
7      229 src/app/edge/live/energymonitor/chart/section/grid.component.ts
8      126 src/app/edge/history/fixdigitaloutput/totalchart.component.ts
8      137 src/app/edge/settings/app/formly/safe-input/formly-safe-input.extended.ts
8      164 src/app/shared/shared.module.ts
8      202 src/app/edge/history/gridoptimizedcharge/sellToGridLimitChart.component.ts
8      215 src/app/edge/history/peakshaving/symmetric/chart.component.ts
8      216 src/app/edge/history/delayedselltogrid/chart.component.ts
8      224 src/app/edge/live/energymonitor/chart/section/storage.component.ts
8      230 src/app/edge/history/peakshaving/timeslot/chart.component.ts
8      426 src/app/shared/pickdate/pickdate.component.ts
9       58 src/app/shared/genericComponents/chart/chart.constants.ts
9       90 src/app/edge/live/Controller/ChpSoc/ChpSoc.ts
9      183 src/app/edge/live/Controller/Io/ChannelSingleThreshold/Io_ChannelSingleThreshold.ts
9      188 src/app/edge/settings/jsonrpctest/jsonrpctest.ts
9      195 src/app/edge/history/grid/chart.component.ts
9      238 src/app/edge/history/gridoptimizedcharge/chart.component.ts
9      239 src/app/edge/live/common/storage/storage.component.ts
9      360 src/app/edge/live/energymonitor/chart/section/abstractsection.component.ts
10       18 src/app/shared/utils/color/color.utils.spec.ts
10       47 src/app/shared/utils/date/dateutils.spec.ts
10      108 src/app/edge/live/energymonitor/chart/chart.component.ts
10      108 src/app/edge/settings/component/update/update.component.ts
10      222 src/app/edge/live/Multiple/Evcs_Api_Cluster/modal/evcs-chart/evcs.chart.ts
10      243 src/app/edge/history/peakshaving/asymmetric/chart.component.ts
10      274 src/app/user/user.component.ts
11       27 src/app/shared/utils/array/array.utils.spec.ts
11      109 src/app/edge/live/Controller/ChpSoc/modal/modal.component.ts
11      163 src/app/edge/history/storage/esschart.component.ts
11      251 src/app/edge/settings/app/single.component.ts
12      171 src/app/edge/settings/channels/channels.component.ts
12      207 src/app/edge/live/common/storage/modal/modal.component.ts
12      221 src/app/shared/genericComponents/modal/abstract-modal-line.ts
12      361 src/app/edge/live/Multiple/Evcs_Api_Cluster/modal/evcsCluster-modal.page.ts
13      346 src/app/edge/settings/app/jsonrpc/getAppAssistant.ts
14      117 src/app/edge/settings/component/install/install.component.ts
14      258 src/app/edge/settings/app/install.component.ts
15      247 src/app/edge/live/Controller/Ess/GridOptimizedCharge/modal/predictionChart.ts
16      421 src/app/shared/genericComponents/shared/testing/tester.ts
16      481 src/app/edge/settings/app/keypopup/modal.component.ts
17      126 src/app/edge/history/heatingelement/chart.component.ts
17      414 src/app/shared/service/service.ts
18      315 src/app/shared/edge/edgeconfig.spec.ts
18      346 src/app/edge/settings/app/index.component.ts
18      849 src/app/shared/service/utils.ts
19      157 src/app/edge/history/heatpump/chart.component.ts
19      208 src/app/edge/live/Controller/Evcs/flat/flat.ts
20      240 src/app/edge/history/storage/singlechart.component.ts
21      262 src/app/edge/history/storage/totalchart.component.ts
23      110 src/app/edge/live/Controller/PeakShaving/Symmetric_TimeSlot/modal/modal.component.ts
23      274 src/app/edge/history/singlethreshold/chart.component.ts
23      716 src/app/shared/edge/edgeconfig.ts
32      227 src/app/edge/live/Controller/Ess/TimeOfUseTariff/modal/powerSocChart.ts
33      107 src/app/edge/live/Controller/Io/Heatpump/modal/modal.component.ts
42      299 src/app/edge/live/Controller/Evcs/modal/modal.ts
43      177 src/app/edge/live/Controller/Ess/TimeOfUseTariff/modal/statePriceChart.ts
51      224 src/app/edge/history/Controller/Ess/TimeOfUseTariff/chart/chart.ts
60      240 src/app/edge/live/Controller/Io/ChannelSingleThreshold/modal/modal.component.ts
62      258 src/app/shared/edge/currentdata.ts
67      434 src/app/edge/history/abstracthistorychart.ts
110     1038 src/app/shared/genericComponents/chart/abstracthistorychart.ts
348       79 src/app/edge/history/common/grid/chart/chart.spec.ts
674       92 src/app/edge/history/common/consumption/chart/chart.spec.ts
1141      186 src/app/edge/history/common/energy/chart/chart.spec.ts

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.

4 participants