Skip to content

Commit 3d31ff3

Browse files
authored
Merge pull request #2808 from jtpio/fix-eslint-warnings
Fix ESLint warnings
2 parents 1f9e392 + 3a4d1a8 commit 3d31ff3

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

packages/controls/src/widget_float.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export class FloatLogSliderView extends BaseIntSliderView {
145145
return log_value;
146146
}
147147

148-
createSlider() {
148+
createSlider(): void {
149149
const orientation = this.model.get('orientation');
150150
noUiSlider.create(this.$slider, {
151151
start: this.logCalc(this.model.get('value')),
@@ -158,8 +158,8 @@ export class FloatLogSliderView extends BaseIntSliderView {
158158
orientation: orientation,
159159
direction: orientation === 'horizontal' ? 'ltr' : 'rtl',
160160
format: {
161-
from: (value: number) => value,
162-
to: (value: number) => value
161+
from: (value: number): number => value,
162+
to: (value: number): number => value
163163
}
164164
});
165165

@@ -258,7 +258,7 @@ export class FloatLogSliderView extends BaseIntSliderView {
258258
this.$slider.noUiSlider.set(log_value);
259259
}
260260

261-
updateSliderOptions(e: any) {
261+
updateSliderOptions(e: any): void {
262262
this.$slider.noUiSlider.updateOptions({
263263
start: this.logCalc(this.model.get('value')),
264264
range: {
@@ -269,7 +269,7 @@ export class FloatLogSliderView extends BaseIntSliderView {
269269
});
270270
}
271271

272-
_validate_slide_value(x: any) {
272+
_validate_slide_value(x: any): any {
273273
return x;
274274
}
275275

packages/controls/src/widget_int.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export abstract class BaseIntSliderView extends DescriptionView {
123123
* Called when the model is changed. The model may have been
124124
* changed by another view or by a state update from the back-end.
125125
*/
126-
update(options?: any) {
126+
update(options?: any): void {
127127
if (options === undefined || options.updated_view !== this) {
128128
if (this.model.get('disabled')) {
129129
this.readout.contentEditable = 'false';
@@ -201,7 +201,7 @@ export abstract class BaseIntSliderView extends DescriptionView {
201201
/**
202202
* Create a new noUiSlider object
203203
*/
204-
createSlider() {
204+
createSlider(): void {
205205
const orientation = this.model.get('orientation');
206206
noUiSlider.create(this.$slider, {
207207
start: this.model.get('value'),
@@ -215,8 +215,8 @@ export abstract class BaseIntSliderView extends DescriptionView {
215215
orientation: orientation,
216216
direction: orientation === 'horizontal' ? 'ltr' : 'rtl',
217217
format: {
218-
from: (value: number) => value,
219-
to: (value: number) => value
218+
from: (value: number): number => value,
219+
to: (value: number): number => value
220220
}
221221
});
222222

@@ -238,7 +238,7 @@ export abstract class BaseIntSliderView extends DescriptionView {
238238
* handled in a separate function and has a dedicated event
239239
* handler.
240240
*/
241-
regenSlider(e: any) {
241+
regenSlider(e: any): void {
242242
this.$slider.noUiSlider.destroy();
243243
this.createSlider();
244244
}
@@ -293,7 +293,7 @@ export abstract class BaseIntSliderView extends DescriptionView {
293293
}
294294

295295
export class IntRangeSliderView extends BaseIntSliderView {
296-
update(options?: any) {
296+
update(options?: any): void {
297297
super.update(options);
298298
const value = this.model.get('value');
299299
this.readout.textContent = this.valueToString(value);
@@ -363,7 +363,7 @@ export class IntRangeSliderView extends BaseIntSliderView {
363363
}
364364
}
365365

366-
handleSliderChange(values: any, handle: any) {
366+
handleSliderChange(values: any, handle: any): void {
367367
const actual_value = values.map(this._validate_slide_value);
368368
this.readout.textContent = this.valueToString(actual_value);
369369

@@ -374,13 +374,13 @@ export class IntRangeSliderView extends BaseIntSliderView {
374374
}
375375
}
376376

377-
handleSliderChanged(values: number[], handle: number) {
377+
handleSliderChanged(values: number[], handle: number): void {
378378
const actual_value = values.map(this._validate_slide_value);
379379
this.model.set('value', actual_value, { updated_view: this });
380380
this.touch();
381381
}
382382

383-
updateSliderOptions(e: any) {
383+
updateSliderOptions(e: any): void {
384384
this.$slider.noUiSlider.updateOptions({
385385
start: this.model.get('value'),
386386
range: {
@@ -391,7 +391,7 @@ export class IntRangeSliderView extends BaseIntSliderView {
391391
});
392392
}
393393

394-
updateSliderValue(model: any, _: any, options: any) {
394+
updateSliderValue(model: any, _: any, options: any): void {
395395
if (options.updated_view === this) {
396396
return;
397397
}
@@ -457,7 +457,7 @@ export class IntSliderView extends BaseIntSliderView {
457457
}
458458
}
459459

460-
handleSliderChange(values: any, handle: any) {
460+
handleSliderChange(values: any, handle: any): void {
461461
const actual_value = this._validate_slide_value(values[handle]);
462462
this.readout.textContent = this.valueToString(actual_value);
463463

@@ -468,7 +468,7 @@ export class IntSliderView extends BaseIntSliderView {
468468
}
469469
}
470470

471-
handleSliderChanged(values: any, handle: any) {
471+
handleSliderChanged(values: any, handle: any): void {
472472
const actual_value = this._validate_slide_value(values[handle]);
473473
const model_value = this.model.get('value');
474474

packages/controls/src/widget_selection.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -737,12 +737,12 @@ export class SelectionSliderView extends DescriptionView {
737737
return super.update(options);
738738
}
739739

740-
regenSlider(e: any) {
740+
regenSlider(e: any): void {
741741
this.$slider.noUiSlider.destroy();
742742
this.createSlider();
743743
}
744744

745-
createSlider() {
745+
createSlider(): void {
746746
const labels = this.model.get('_options_labels');
747747
const min = 0;
748748
const max = labels.length - 1;
@@ -760,8 +760,8 @@ export class SelectionSliderView extends DescriptionView {
760760
orientation: orientation,
761761
direction: orientation === 'horizontal' ? 'ltr' : 'rtl',
762762
format: {
763-
from: (value: number) => value,
764-
to: (value: number) => value
763+
from: (value: number): number => value,
764+
to: (value: number): number => value
765765
}
766766
});
767767

@@ -812,14 +812,14 @@ export class SelectionSliderView extends DescriptionView {
812812
* Calling model.set will trigger all of the other views of the
813813
* model to update.
814814
*/
815-
handleSliderChanged(values: number[], handle: number) {
815+
handleSliderChanged(values: number[], handle: number): void {
816816
const index = values[0];
817817
this.updateReadout(index);
818818
this.model.set('index', index, { updated_view: this });
819819
this.touch();
820820
}
821821

822-
updateSliderOptions(e: any) {
822+
updateSliderOptions(e: any): void {
823823
const labels = this.model.get('_options_labels');
824824
const min = 0;
825825
const max = labels.length - 1;
@@ -834,7 +834,7 @@ export class SelectionSliderView extends DescriptionView {
834834
});
835835
}
836836

837-
updateSliderValue(model: any, _: any, options: any) {
837+
updateSliderValue(model: any, _: any, options: any): void {
838838
if (options.updated_view === this) {
839839
return;
840840
}
@@ -950,7 +950,7 @@ export class SelectionRangeSliderView extends SelectionSliderView {
950950
/**
951951
* Called when the slider value is changing.
952952
*/
953-
handleSliderChange(values: number[], handle: any) {
953+
handleSliderChange(values: number[], handle: any): void {
954954
const intValues = values.map(Math.trunc);
955955
this.updateReadout(intValues);
956956

@@ -967,7 +967,7 @@ export class SelectionRangeSliderView extends SelectionSliderView {
967967
* Calling model.set will trigger all of the other views of the
968968
* model to update.
969969
*/
970-
handleSliderChanged(values: number[], handle: number) {
970+
handleSliderChanged(values: number[], handle: number): void {
971971
const intValues = values.map(Math.round);
972972
this.updateReadout(intValues);
973973

@@ -976,7 +976,7 @@ export class SelectionRangeSliderView extends SelectionSliderView {
976976
this.touch();
977977
}
978978

979-
updateSliderValue(model: any, _: any, options: any) {
979+
updateSliderValue(model: any, _: any, options: any): void {
980980
if (options.updated_view === this) {
981981
return;
982982
}

0 commit comments

Comments
 (0)