Fix: TS6133 errors for unused v-for variables in settings views
#6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes #5 TypeScript compilation errors (TS6133: variable declared but never read) in several settings views where the
v-forloop declared element variables that were not actually used in the template logic.Previously, these TS6133 errors caused
npm run buildto fail, even though the underlying problem was only unusedv-forvariables.Root cause
In the following views, the
v-forused the pattern(item, i)but only the indexi(or the backing store array) was effectively used, while theitemvariable was never read by TypeScript:EnergyMonitorSettingsView:energyMonitorForecastProvidersSettingsView:forecastProviderMinerControllersSettingsView:minerControllerAs a result, TypeScript reported TS6133 for each unused variable and the type-check step failed.
Changes
src/views/settings/EnergyMonitorSettingsView.vueto avoid declaring an unusedenergyMonitorvariable in thev-forand to bind the component via the actual value used.src/views/settings/ForecastProvidersSettingsView.vueto remove the unusedforecastProvidervariable from thev-fordeclaration or to use it consistently in bindings where appropriate.src/views/settings/MinerControllersSettingsView.vueto remove or properly use theminerControllervariable in thev-forloop.The changes keep the runtime behavior of the UI intact while ensuring that all
v-forvariables are either used or not declared at all.Result
npm run buildcompletes successfully.v-forvariables (e.g. energy sources, external services).