Skip to content

Commit

Permalink
fix pre-commit failing due to TS new linting rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine C committed Jun 4, 2023
1 parent 5ced390 commit 098f782
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
21 changes: 11 additions & 10 deletions res/controllers/Traktor-Kontrol-S4-MK3.js
Expand Up @@ -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
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}
},
});

Expand Down Expand Up @@ -2883,6 +2883,7 @@ class S4MK3 {
}
);

/* eslint @typescript-eslint/no-this-alias: "off" */
const that = this;
/* eslint no-unused-vars: "off" */
const meterConnection = engine.makeConnection("[Master]", "guiTick50ms", function(_value) {
Expand Down
5 changes: 4 additions & 1 deletion res/controllers/common-controller-scripts.js
Expand Up @@ -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);
}
Expand Down Expand Up @@ -121,6 +121,7 @@ var colorCodeToObject = function(colorCode) {
};
};

/* eslint @typescript-eslint/no-empty-function: "off" */
var script = function() {
};

Expand Down Expand Up @@ -491,6 +492,7 @@ script.softStart = function(channel, control, value, status, group, factor) {
};

// bpm - Used for tapping the desired BPM for a deck
/* eslint @typescript-eslint/no-empty-function: "off" */
var bpm = function() {
};

Expand Down Expand Up @@ -578,6 +580,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;
Expand Down

0 comments on commit 098f782

Please sign in to comment.