summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine C <mixxx@acolombier.dev>2023-06-03 21:28:29 +0100
committerAntoine C <mixxx@acolombier.dev>2023-06-04 17:32:30 +0100
commitfebccc2ba374acfc0d0e71fabb826fc8539b31c8 (patch)
tree43d3f8d387b8b87d29fbdc0ae7a2e579600331d2
parent61b34515da1ce60ef49a8c3ead4864e565a06d13 (diff)
fix pre-commit failing due to TS new linting rules
-rw-r--r--res/controllers/Traktor-Kontrol-S4-MK3.js20
-rw-r--r--res/controllers/common-controller-scripts.js5
2 files changed, 13 insertions, 12 deletions
diff --git a/res/controllers/Traktor-Kontrol-S4-MK3.js b/res/controllers/Traktor-Kontrol-S4-MK3.js
index 258e4911dc..b20056345a 100644
--- a/res/controllers/Traktor-Kontrol-S4-MK3.js
+++ b/res/controllers/Traktor-Kontrol-S4-MK3.js
@@ -86,7 +86,7 @@ const GridButtonBlinkOverBeat = false;
const WheelLedBlinkOnTrackEnd = true;
// When shifting either decks, the mixer will control microphones or auxiliary lines. If there is both a mic and an configure on the same channel, the mixer will control the auxiliary.
-// Default: true
+// Default: false
const MixerControlsMixAuxOnShift = false;
// Define how many wheel moves are sampled to compute the speed. The more you have, the more the speed is accurate, but the
@@ -860,7 +860,7 @@ class SamplerButton extends Button {
if (this.number === undefined || !Number.isInteger(this.number) || this.number < 1 || this.number > 64) {
throw Error("SamplerButton must have a number property of an integer between 1 and 64");
}
- this.group = "[Sampler${this.number}]";
+ this.group = `[Sampler${this.number}]`;
this.outConnect();
}
onShortPress() {
@@ -1635,12 +1635,11 @@ class S4Mk3Deck extends Deck {
this.indicator(false);
const wheelOutput = new Uint8Array(40).fill(0);
wheelOutput[0] = decks[0] - 1;
- const that = this;
controller.sendOutputReport(50, wheelOutput.buffer, true);
if (!skipRestore) {
- that.deck.wheelMode = that.previousWheelMode;
+ this.deck.wheelMode = this.previousWheelMode;
}
- that.previousWheelMode = null;
+ this.previousWheelMode = null;
if (this.loopModeConnection !== null) {
this.loopModeConnection.disconnect();
this.loopModeConnection = null;
@@ -1721,12 +1720,11 @@ class S4Mk3Deck extends Deck {
this.indicator(false);
const wheelOutput = new Uint8Array(40).fill(0);
wheelOutput[0] = decks[0] - 1;
- const that = this;
controller.sendOutputReport(wheelOutput.buffer, null, 50, true);
if (!skipRestore) {
- that.deck.wheelMode = that.previousWheelMode;
+ this.deck.wheelMode = this.previousWheelMode;
}
- that.previousWheelMode = null;
+ this.previousWheelMode = null;
if (this.loopModeConnection !== null) {
this.loopModeConnection.disconnect();
this.loopModeConnection = null;
@@ -2350,8 +2348,10 @@ class S4Mk3Deck extends Deck {
outTrigger: function() {
const vinylOn = this.deck.wheelMode === wheelModes.vinyl;
this.send(this.color + (vinylOn ? this.brightnessOn : this.brightnessOff));
- const motorOn = this.deck.wheelMode === wheelModes.motor;
- this.deck.turntableButton.send(this.color + (motorOn ? this.brightnessOn : this.brightnessOff));
+ if (this.deck.turntableButton) {
+ const motorOn = this.deck.wheelMode === wheelModes.motor;
+ this.deck.turntableButton.send(this.color + (motorOn ? this.brightnessOn : this.brightnessOff));
+ }
},
});
diff --git a/res/controllers/common-controller-scripts.js b/res/controllers/common-controller-scripts.js
index bcc8602f6c..68eed58954 100644
--- a/res/controllers/common-controller-scripts.js
+++ b/res/controllers/common-controller-scripts.js
@@ -21,7 +21,7 @@
// Returns an ASCII byte array for the string
String.prototype.toInt = function() {
- const a = new Array();
+ const a = [];
for (let i = 0; i < this.length; i++) {
a[i] = this.charCodeAt(i);
}
@@ -124,6 +124,7 @@ var colorCodeToObject = function(colorCode) {
};
};
+/* eslint @typescript-eslint/no-empty-function: "off" */
var script = function() {
};
@@ -494,7 +495,6 @@ script.softStart = function(channel, control, value, status, group, factor) {
};
// bpm - Used for tapping the desired BPM for a deck
-
var bpm = function() {
};
@@ -584,6 +584,7 @@ var Controller = function() {
Controller.prototype.addButton = function(buttonName, button, eventHandler) {
if (eventHandler) {
+ /* eslint @typescript-eslint/no-this-alias: "off" */
const executionEnvironment = this;
const handler = function(value) {
button.state = value;