Bladeren bron

lint: configure eslintrc, fix all lint errors, remove tslint from project

sschmid 4 jaren geleden
bovenliggende
commit
bae72d2bea
28 gewijzigde bestanden met toevoegingen van 49 en 64 verwijderingen
  1. 4 4
      .eslintrc.js
  2. 1 3
      package.json
  3. 1 1
      src/Common/DataObjects/Fraction.ts
  4. 4 4
      src/Common/DataObjects/Pitch.ts
  5. 0 1
      src/MusicalScore/Graphical/DrawingEnums.ts
  6. 2 2
      src/MusicalScore/Graphical/EngravingRules.ts
  7. 1 2
      src/MusicalScore/Graphical/GraphicalMusicSheet.ts
  8. 4 6
      src/MusicalScore/Graphical/GraphicalSlur.ts
  9. 0 4
      src/MusicalScore/Graphical/MusicSheetCalculator.ts
  10. 6 6
      src/MusicalScore/Graphical/VexFlow/VexFlowMeasure.ts
  11. 2 2
      src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetCalculator.ts
  12. 1 1
      src/MusicalScore/Graphical/VexFlow/VexFlowVoiceEntry.ts
  13. 3 5
      src/MusicalScore/ScoreIO/InstrumentReader.ts
  14. 2 1
      src/MusicalScore/ScoreIO/MusicSheetReader.ts
  15. 1 1
      src/MusicalScore/ScoreIO/MusicSymbolModules/ArticulationReader.ts
  16. 4 4
      src/MusicalScore/ScoreIO/MusicSymbolModules/ChordSymbolReader.ts
  17. 4 4
      src/MusicalScore/ScoreIO/MusicSymbolModules/ExpressionReader.ts
  18. 1 1
      src/MusicalScore/ScoreIO/MusicSymbolModules/LyricsReader.ts
  19. 0 1
      src/MusicalScore/VoiceData/NoteType.ts
  20. 1 1
      src/OpenSheetMusicDisplay/OSMDOptions.ts
  21. 3 3
      test/Common/FileIO/Mxl_Test.ts
  22. 0 1
      test/MusicalScore/Graphical/VexFlow/VexFlowConverter_Clef_Test.ts
  23. 1 1
      test/MusicalScore/Graphical/VexFlow/VexFlowMeasure_Test.ts
  24. 1 1
      test/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetDrawer_Test.ts
  25. 1 1
      test/MusicalScore/ScoreCalculation/MusicSheetCalculator_Test.ts
  26. 0 1
      test/MusicalScore/ScoreIO/Key_Test.ts
  27. 1 1
      test/MusicalScore/ScoreIO/MusicSheetReader_Test.ts
  28. 0 1
      test/MusicalScore/VoiceData/NoteType_Test.ts

+ 4 - 4
.eslintrc.js

@@ -55,7 +55,7 @@ module.exports = {
             "error",
             {
                 "multiline": {
-                    "delimiter": "none",
+                    "delimiter": "semi",
                     "requireLast": true
                 },
                 "singleline": {
@@ -119,7 +119,7 @@ module.exports = {
         ],*/
         "id-match": "error",
         "jsdoc/check-alignment": "error",
-        "jsdoc/check-indentation": "error",
+        "jsdoc/check-indentation": "off",
         "jsdoc/newline-after-description": "off",
         "max-len": [
             "error",
@@ -162,10 +162,10 @@ module.exports = {
         "no-fallthrough": "error",
         "no-multiple-empty-lines": "off",
         "no-new-wrappers": "error",
-        "no-null/no-null": "error",
+        "no-null/no-null": "off",
         "no-redeclare": "error",
         "no-trailing-spaces": "error",
-        "no-underscore-dangle": "error",
+        "no-underscore-dangle": "off",
         "no-unused-labels": "error",
         "no-var": "error",
         "prefer-const": "error",

+ 1 - 3
package.json

@@ -6,7 +6,7 @@
   "typings": "build/dist/src/",
   "scripts": {
     "docs": "typedoc --out ./build/docs --name OpenSheetMusicDisplay --module commonjs --target ES2017 --ignoreCompilerErrors --mode file ./src",
-    "eslint": "eslint .",
+    "eslint": "eslint . --ext .ts src/",
     "lint": "eslint -c .eslintrc.js --ext .ts src/",
     "test": "karma start --single-run --no-auto-watch",
     "test:watch": "karma start --no-single-run --auto-watch --browsers ChromeNoSecurity",
@@ -109,8 +109,6 @@
     "pre-commit": "^1.2.2",
     "svg2pdf.js": "^1.5.0",
     "ts-loader": "^4.1.0",
-    "tslint": "^5.14.0",
-    "tslint-loader": "^3.5.4",
     "typedoc": "^0.17.3",
     "typescript": "^3.9.5",
     "webpack": "^4.43.0",

+ 1 - 1
src/Common/DataObjects/Fraction.ts

@@ -81,7 +81,7 @@ export class Fraction {
    * @param denominator
    * @param wholeValue - the integer number, needed for values greater than 1
    * @param simplify - If simplify is true, then the fraction is simplified
-   *      to make both the numerator and denominator coprime, and less than maximumAllowedNumber.
+   * to make both the numerator and denominator coprime, and less than maximumAllowedNumber.
    */
   constructor(numerator: number = 0, denominator: number = 1, wholeValue: number = 0, simplify: boolean = true) {
     this.numerator = numerator;

+ 4 - 4
src/Common/DataObjects/Pitch.ts

@@ -12,7 +12,7 @@ export enum NoteEnum {
 /** Describes Accidental types.
  * Do not use the number values of these enum members directly for calculation anymore.
  * To use these for pitch calculation, use pitch.AccidentalHalfTones()
- *  or Pitch.HalfTonesFromAccidental(accidentalEnum).
+ * or Pitch.HalfTonesFromAccidental(accidentalEnum).
  */
 export enum AccidentalEnum {
     SHARP,
@@ -70,15 +70,15 @@ export class Pitch {
      * @param the input pitch
      * @param the number of halftones to transpose with
      * @returns ret[0] = the transposed fundamental.
-     *          ret[1] = the octave shift (not the new octave!)
+     * ret[1] = the octave shift (not the new octave!)
      * @constructor
      */
-    public static CalculateTransposedHalfTone(pitch: Pitch, transpose: number): { halftone: number; overflow: number; } {
+    public static CalculateTransposedHalfTone(pitch: Pitch, transpose: number): { halftone: number, overflow: number } {
         const newHalfTone: number = <number>pitch.fundamentalNote + pitch.AccidentalHalfTones + transpose;
         return Pitch.WrapAroundCheck(newHalfTone, 12);
     }
 
-    public static WrapAroundCheck(value: number, limit: number): { halftone: number; overflow: number; } {
+    public static WrapAroundCheck(value: number, limit: number): { halftone: number, overflow: number } {
         let overflow: number = 0;
 
         while (value < 0) {

+ 0 - 1
src/MusicalScore/Graphical/DrawingEnums.ts

@@ -41,7 +41,6 @@ export enum OutlineAndFillStyleEnum {
     Comment10
 }
 
-// tslint:disable-next-line:max-line-length A linebreak would be more confusing here
 export const OUTLINE_AND_FILL_STYLE_DICT: Dictionary<OutlineAndFillStyleEnum, string> =
     new Dictionary<OutlineAndFillStyleEnum, string>();
 OUTLINE_AND_FILL_STYLE_DICT.setValue(OutlineAndFillStyleEnum.BaseWritingColor, "Thistle");

+ 2 - 2
src/MusicalScore/Graphical/EngravingRules.ts

@@ -207,8 +207,8 @@ export class EngravingRules {
     public MaxInstructionsConstValue: number;
     public NoteDistances: number[] = [1.0, 1.0, 1.3, 1.6, 2.0, 2.5, 3.0, 4.0];
     public NoteDistancesScalingFactors: number[] = [1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0];
-    public DurationDistanceDict: {[_: number]: number; } = {};
-    public DurationScalingDistanceDict: {[_: number]: number; } = {};
+    public DurationDistanceDict: {[_: number]: number } = {};
+    public DurationScalingDistanceDict: {[_: number]: number } = {};
 
     public AlignRests: number; // 0 = false, 1 = true, 2 = auto
     public FillEmptyMeasuresWithWholeRest: FillEmptyMeasuresWithWholeRests | number;

+ 1 - 2
src/MusicalScore/Graphical/GraphicalMusicSheet.ts

@@ -393,7 +393,6 @@ export class GraphicalMusicSheet {
         const containers: VerticalGraphicalStaffEntryContainer[] = this.verticalGraphicalStaffEntryContainers;
         let leftIndex: number = 0;
         let rightIndex: number = containers.length - 1;
-        let foundIndex: number;
         let leftTS: Fraction = undefined;
         let rightTS: Fraction = undefined;
         if (musicTimestamp.lte(containers[containers.length - 1].AbsoluteTimestamp)) {
@@ -429,7 +428,7 @@ export class GraphicalMusicSheet {
         const diffTS: number = rightTS.RealValue - musicTimestamp.RealValue;
 
         // estimate the interpolated index
-        foundIndex = rightIndex - (diffTS / diff);
+        const foundIndex: number = rightIndex - (diffTS / diff);
         return Math.min(foundIndex, this.verticalGraphicalStaffEntryContainers.length);
     }
 

+ 4 - 6
src/MusicalScore/Graphical/GraphicalSlur.ts

@@ -152,9 +152,8 @@ export class GraphicalSlur extends GraphicalCurve {
                 // clockwise/counterclockwise Rotation
                 // after Rotation end2.Y must be 0
                 // Inverse of RotationMatrix = TransposeMatrix of RotationMatrix
-            let rotationMatrix: Matrix2D, transposeMatrix: Matrix2D;
-            rotationMatrix = Matrix2D.getRotationMatrix(startEndLineAngleRadians);
-            transposeMatrix = rotationMatrix.getTransposeMatrix();
+            const rotationMatrix: Matrix2D = Matrix2D.getRotationMatrix(startEndLineAngleRadians);
+            const transposeMatrix: Matrix2D = rotationMatrix.getTransposeMatrix();
             end2 = rotationMatrix.vectorMultiplication(end2);
             const transformedPoints: PointF2D[] = this.calculateTranslatedAndRotatedPointListAbove(points, startX, startY, rotationMatrix);
 
@@ -323,9 +322,8 @@ export class GraphicalSlur extends GraphicalCurve {
             // clockwise/counterclockwise Rotation
             // after Rotation end2.Y must be 0
             // Inverse of RotationMatrix = TransposeMatrix of RotationMatrix
-            let rotationMatrix: Matrix2D, transposeMatrix: Matrix2D;
-            rotationMatrix = Matrix2D.getRotationMatrix(-startEndLineAngleRadians);
-            transposeMatrix = rotationMatrix.getTransposeMatrix();
+            const rotationMatrix: Matrix2D = Matrix2D.getRotationMatrix(-startEndLineAngleRadians);
+            const transposeMatrix: Matrix2D = rotationMatrix.getTransposeMatrix();
             end2 = rotationMatrix.vectorMultiplication(end2);
             const transformedPoints: PointF2D[] = this.calculateTranslatedAndRotatedPointListBelow(points, startX, startY, rotationMatrix);
 

+ 0 - 4
src/MusicalScore/Graphical/MusicSheetCalculator.ts

@@ -2331,11 +2331,7 @@ export abstract class MusicSheetCalculator {
         accidentalCalculator.checkAccidental(graphicalNote, pitch);
     }
 
-    // // needed to disable linter, as it doesn't recognize the existing usage of this method.
-    // // ToDo: check if a newer version doesn't have the problem.
-    // /* tslint:disable:no-unused-variable */
     // private createStaffEntryForTieNote(measure: StaffMeasure, absoluteTimestamp: Fraction, openTie: Tie): GraphicalStaffEntry {
-    //     /* tslint:enable:no-unused-variable */
     //     let graphicalStaffEntry: GraphicalStaffEntry;
     //     graphicalStaffEntry = MusicSheetCalculator.symbolFactory.createStaffEntry(openTie.Start.ParentStaffEntry, measure);
     //     graphicalStaffEntry.relInMeasureTimestamp = Fraction.minus(absoluteTimestamp, measure.parentSourceMeasure.AbsoluteTimestamp);

+ 6 - 6
src/MusicalScore/Graphical/VexFlow/VexFlowMeasure.ts

@@ -62,7 +62,7 @@ export class VexFlowMeasure extends GraphicalMeasure {
     /** octaveOffset according to active clef */
     public octaveOffset: number = 3;
     /** The VexFlow Voices in the measure */
-    public vfVoices: { [voiceID: number]: Vex.Flow.Voice; } = {};
+    public vfVoices: { [voiceID: number]: Vex.Flow.Voice } = {};
     /** Call this function (if present) to x-format all the voices in the measure */
     public formatVoices: (width: number, parent: VexFlowMeasure) => void;
     /** The VexFlow Ties in the measure */
@@ -74,17 +74,17 @@ export class VexFlowMeasure extends GraphicalMeasure {
     /** VexFlow StaveConnectors (vertical lines) */
     protected connectors: Vex.Flow.StaveConnector[] = [];
     /** Intermediate object to construct beams */
-    private beams: { [voiceID: number]: [Beam, VexFlowVoiceEntry[]][]; } = {};
+    private beams: { [voiceID: number]: [Beam, VexFlowVoiceEntry[]][] } = {};
     /** Beams created by (optional) autoBeam function. */
     private autoVfBeams: Vex.Flow.Beam[];
     /** Beams of tuplet notes created by (optional) autoBeam function. */
     private autoTupletVfBeams: Vex.Flow.Beam[];
     /** VexFlow Beams */
-    private vfbeams: { [voiceID: number]: Vex.Flow.Beam[]; };
+    private vfbeams: { [voiceID: number]: Vex.Flow.Beam[] };
     /** Intermediate object to construct tuplets */
-    protected tuplets: { [voiceID: number]: [Tuplet, VexFlowVoiceEntry[]][]; } = {};
+    protected tuplets: { [voiceID: number]: [Tuplet, VexFlowVoiceEntry[]][] } = {};
     /** VexFlow Tuplets */
-    private vftuplets: { [voiceID: number]: Vex.Flow.Tuplet[]; } = {};
+    private vftuplets: { [voiceID: number]: Vex.Flow.Tuplet[] } = {};
     // The engraving rules of OSMD.
     public rules: EngravingRules;
 
@@ -1243,7 +1243,7 @@ export class VexFlowMeasure extends GraphicalMeasure {
     protected createOrnaments(): void {
         for (let idx: number = 0, len: number = this.staffEntries.length; idx < len; ++idx) {
             const graphicalStaffEntry: VexFlowStaffEntry = (this.staffEntries[idx] as VexFlowStaffEntry);
-            const gvoices: { [voiceID: number]: GraphicalVoiceEntry; } = graphicalStaffEntry.graphicalVoiceEntries;
+            const gvoices: { [voiceID: number]: GraphicalVoiceEntry } = graphicalStaffEntry.graphicalVoiceEntries;
 
             for (const voiceID in gvoices) {
                 if (gvoices.hasOwnProperty(voiceID)) {

+ 2 - 2
src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetCalculator.ts

@@ -148,7 +148,7 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
       if (!measure) {
         continue;
       }
-      const mvoices: { [voiceID: number]: Vex.Flow.Voice; } = (measure as VexFlowMeasure).vfVoices;
+      const mvoices: { [voiceID: number]: Vex.Flow.Voice } = (measure as VexFlowMeasure).vfVoices;
       const voices: Vex.Flow.Voice[] = [];
       for (const voiceID in mvoices) {
         if (mvoices.hasOwnProperty(voiceID)) {
@@ -1045,7 +1045,7 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
 
   // Generate all Graphical Slurs and attach them to the staffline
   protected calculateSlurs(): void {
-    const openSlursDict: { [staffId: number]: GraphicalSlur[]; } = {};
+    const openSlursDict: { [staffId: number]: GraphicalSlur[] } = {};
     for (const graphicalMeasure of this.graphicalMusicSheet.MeasureList[0]) { //let i: number = 0; i < this.graphicalMusicSheet.MeasureList[0].length; i++) {
       openSlursDict[graphicalMeasure.ParentStaff.idInMusicSheet] = [];
     }

+ 1 - 1
src/MusicalScore/Graphical/VexFlow/VexFlowVoiceEntry.ts

@@ -107,7 +107,7 @@ export class VexFlowVoiceEntry extends GraphicalVoiceEntry {
                     }
                 }
                 if (colorBeam) {
-                    if (vfStaveNote.beam !== null && vfStaveNote.beam.setStyle) {
+                    if (vfStaveNote.beam?.setStyle) {
                         vfStaveNote.beam.setStyle({ fillStyle: noteheadColor, strokeStyle: noteheadColor});
                     }
                 }

+ 3 - 5
src/MusicalScore/ScoreIO/InstrumentReader.ts

@@ -73,7 +73,7 @@ export class InstrumentReader {
   private musicSheet: MusicSheet;
   private slurReader: SlurReader;
   private instrument: Instrument;
-  private voiceGeneratorsDict: { [n: number]: VoiceGenerator; } = {};
+  private voiceGeneratorsDict: { [n: number]: VoiceGenerator } = {};
   private staffMainVoiceGeneratorDict: { [staffId: number]: VoiceGenerator } = {};
   private inSourceMeasureInstrumentIndex: number;
   private divisions: number = 0;
@@ -252,10 +252,8 @@ export class InstrumentReader {
           let noteTypeXml: NoteType = NoteType.UNDEFINED;
           if (typeNode) {
             const sizeAttr: Attr = typeNode.attribute("size");
-            if (sizeAttr !== undefined && sizeAttr !== null) {
-              if (sizeAttr.value === "cue") {
-                isCueNote = true;
-              }
+            if (sizeAttr?.value === "cue") {
+              isCueNote = true;
             }
             noteTypeXml = NoteTypeHandler.StringToNoteType(typeNode.value);
           }

+ 2 - 1
src/MusicalScore/ScoreIO/MusicSheetReader.ts

@@ -195,7 +195,7 @@ export class MusicSheetReader /*implements IMusicSheetReader*/ {
     }
 
     private initializeReading(partList: IXmlElement[], partInst: IXmlElement[], instrumentReaders: InstrumentReader[]): void {
-        const instrumentDict: { [_: string]: Instrument; } = this.createInstrumentGroups(partList);
+        const instrumentDict: { [_: string]: Instrument } = this.createInstrumentGroups(partList);
         this.completeNumberOfStaves = this.getCompleteNumberOfStavesFromXml(partInst);
         if (partInst.length !== 0) {
             this.repetitionInstructionReader.MusicSheet = this.musicSheet;
@@ -571,6 +571,7 @@ export class MusicSheetReader /*implements IMusicSheetReader*/ {
                     }
                     const creditJustify: string = creditChild.attribute("justify")?.value;
                     const creditY: string = creditChild.attribute("default-y")?.value;
+                    // eslint-disable-next-line no-null/no-null
                     const creditYGiven: boolean = creditY !== undefined && creditY !== null;
                     const creditYInfo: number = creditYGiven ? parseFloat(creditY) : Number.MIN_VALUE;
                     if (creditYGiven && creditYInfo > systemYCoordinates) {

+ 1 - 1
src/MusicalScore/ScoreIO/MusicSymbolModules/ArticulationReader.ts

@@ -155,7 +155,7 @@ export class ArticulationReader {
       currentTechnicalInstruction.value = nodeFingering.value;
       currentTechnicalInstruction.placement = PlacementEnum.NotYetDefined;
       const placement: Attr = nodeFingering.attribute("placement");
-      if (placement !== undefined && placement !== null) {
+      if (placement) {
         switch (placement.value) {
           case "above":
             currentTechnicalInstruction.placement = PlacementEnum.Above;

+ 4 - 4
src/MusicalScore/ScoreIO/MusicSymbolModules/ChordSymbolReader.ts

@@ -39,7 +39,7 @@ export class ChordSymbolReader {
         let rootAlteration: AccidentalEnum = AccidentalEnum.NONE;
         if (rootAlter) {
             try {
-                rootAlteration = Pitch.AccidentalFromHalfTones(parseInt(rootAlter.value, undefined));
+                rootAlteration = Pitch.AccidentalFromHalfTones(parseInt(rootAlter.value, 10));
             } catch (ex) {
                 const errorMsg: string = ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError",
                                                                         "Invalid chord symbol");
@@ -94,7 +94,7 @@ export class ChordSymbolReader {
             let bassAlteration: AccidentalEnum = AccidentalEnum.NONE;
             if (bassAlter) {
                 try {
-                    bassAlteration = Pitch.AccidentalFromHalfTones(parseInt(bassAlter.value, undefined));
+                    bassAlteration = Pitch.AccidentalFromHalfTones(parseInt(bassAlter.value, 10));
                 } catch (ex) {
                     const errorMsg: string = ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError",
                                                                             "Invalid chord symbol");
@@ -118,7 +118,7 @@ export class ChordSymbolReader {
 
             let value: number;
             try {
-                value = parseInt(degreeValue.value.trim(), undefined);
+                value = parseInt(degreeValue.value.trim(), 10);
             } catch (ex) {
                 const errorMsg: string = ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError",
                                                                         "Invalid chord symbol");
@@ -129,7 +129,7 @@ export class ChordSymbolReader {
 
             let alter: AccidentalEnum;
             try {
-                alter = Pitch.AccidentalFromHalfTones(parseInt(degreeAlter.value, undefined));
+                alter = Pitch.AccidentalFromHalfTones(parseInt(degreeAlter.value, 10));
             } catch (ex) {
                 const errorMsg: string = ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError",
                                                                         "Invalid chord symbol");

+ 4 - 4
src/MusicalScore/ScoreIO/MusicSymbolModules/ExpressionReader.ts

@@ -72,7 +72,7 @@ export class ExpressionReader {
         }
 
         const placeAttr: IXmlAttribute = xmlNode.attribute("placement");
-        if (placeAttr !== undefined && placeAttr !== null) {
+        if (placeAttr) {
             try {
                 const placementString: string = placeAttr.value;
                 if (placementString === "below") {
@@ -96,21 +96,21 @@ export class ExpressionReader {
                     const dynamicsNode: IXmlElement = directionTypeNode.element("dynamics");
                     if (dynamicsNode) {
                         const defAttr: IXmlAttribute = dynamicsNode.attribute("default-y");
-                        if (defAttr !== undefined && defAttr !== null) {
+                        if (defAttr) {
                             this.readExpressionPlacement(defAttr, "read dynamics y pos");
                         }
                     }
                     const wedgeNode: IXmlElement = directionTypeNode.element("wedge");
                     if (wedgeNode) {
                         const defAttr: IXmlAttribute = wedgeNode.attribute("default-y");
-                        if (defAttr !== undefined && defAttr !== null) {
+                        if (defAttr) {
                             this.readExpressionPlacement(defAttr, "read wedge y pos");
                         }
                     }
                     const wordsNode: IXmlElement = directionTypeNode.element("words");
                     if (wordsNode) {
                         const defAttr: IXmlAttribute = wordsNode.attribute("default-y");
-                        if (defAttr !== undefined && defAttr !== null) {
+                        if (defAttr) {
                             this.readExpressionPlacement(defAttr, "read words y pos");
                         }
                     }

+ 1 - 1
src/MusicalScore/ScoreIO/MusicSymbolModules/LyricsReader.ts

@@ -6,7 +6,7 @@ import {ITextTranslation} from "../../Interfaces/ITextTranslation";
 import {MusicSheet} from "../../MusicSheet";
 
 export class LyricsReader {
-    private openLyricWords: { [_: number]: LyricWord; } = {};
+    private openLyricWords: { [_: number]: LyricWord } = {};
     private currentLyricWord: LyricWord;
     private musicSheet: MusicSheet;
 

+ 0 - 1
src/MusicalScore/VoiceData/NoteType.ts

@@ -24,7 +24,6 @@ export enum NoteType {
 }
 
 export class NoteTypeHandler {
-    // tslint:disable-next-line: variable-name
     public static NoteTypeXmlValues: string[] = ["", "1024th", "512th", "256th", "128th", "64th", "32nd", "16th",
         "eigth", "quarter", "half", "whole", "breve", "long", "maxima"];
     // alternative to array: use switch/case

+ 1 - 1
src/OpenSheetMusicDisplay/OSMDOptions.ts

@@ -4,7 +4,7 @@ import { FontStyles } from "../Common/Enums/FontStyles";
 /** Possible options for the OpenSheetMusicDisplay constructor and osmd.setOptions(). None are mandatory.
  *  Note that after using setOptions(), you have to call osmd.render() again to make changes visible.
  *  Example: osmd.setOptions({defaultColorRest: "#AAAAAA", drawSubtitle: false}); osmd.render();
- * 
+ *
  *  Note that some additional, usually more small scale options are available in EngravingRules,
  *  though not all of them are meant to be manipulated.
  *  The OSMDOptions are the main options we support.

+ 3 - 3
test/Common/FileIO/Mxl_Test.ts

@@ -1,12 +1,12 @@
+/* eslint-disable @typescript-eslint/no-unused-expressions */
 import { IXmlElement } from "../../../src/Common/FileIO/Xml";
 import { TestUtils } from "../../Util/TestUtils";
 import { MXLHelper } from "../../../src/Common/FileIO/Mxl";
 
-/* tslint:disable:no-unused-expression */
 describe("MXL Tests", () => {
   // Generates a test for a mxl file name
   function testFile(scoreName: string): void {
-    it(`reads ${scoreName}`, (done: MochaDone) => {
+    it(`reads ${scoreName}`, (done: Mocha.Done) => {
       // Load the xml file content
       const mxl: string = TestUtils.getMXL(scoreName);
       chai.expect(mxl).to.not.be.undefined;
@@ -35,7 +35,7 @@ describe("MXL Tests", () => {
   }
 
   // Test failure
-  it("Corrupted file", (done: MochaDone) => {
+  it("Corrupted file", (done: Mocha.Done) => {
     MXLHelper.MXLtoIXmlElement("").then(
       (score: IXmlElement) => {
         chai.expect(score).to.not.be.undefined;

+ 0 - 1
test/MusicalScore/Graphical/VexFlow/VexFlowConverter_Clef_Test.ts

@@ -2,7 +2,6 @@ import {IXmlElement} from "../../../../src/Common/FileIO/Xml";
 import {MusicSheet} from "../../../../src/MusicalScore/MusicSheet";
 import {MusicSheetReader} from "../../../../src/MusicalScore/ScoreIO/MusicSheetReader";
 
-/* tslint:disable:no-unused-expression */
 describe("Clef Converter MusicXML to VexFlow", () => {
 
     let reader: MusicSheetReader;

+ 1 - 1
test/MusicalScore/Graphical/VexFlow/VexFlowMeasure_Test.ts

@@ -1,3 +1,4 @@
+/* eslint-disable @typescript-eslint/no-unused-expressions */
 import {GraphicalMusicSheet} from "../../../../src/MusicalScore/Graphical/GraphicalMusicSheet";
 import {IXmlElement} from "../../../../src/Common/FileIO/Xml";
 import {MusicSheet} from "../../../../src/MusicalScore/MusicSheet";
@@ -10,7 +11,6 @@ import {GraphicalMeasure} from "../../../../src/MusicalScore/Graphical/Graphical
 import {MusicSheetCalculator} from "../../../../src/MusicalScore/Graphical/MusicSheetCalculator";
 import {EngravingRules} from "../../../../src/MusicalScore/Graphical/EngravingRules";
 
-/* tslint:disable:no-unused-expression */
 describe("VexFlow Measure", () => {
 
    it("GraphicalMusicSheet", (done: MochaDone) => {

+ 1 - 1
test/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetDrawer_Test.ts

@@ -1,3 +1,4 @@
+/* eslint-disable @typescript-eslint/no-unused-expressions */
 import {VexFlowMusicSheetDrawer} from "../../../../src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetDrawer";
 import {GraphicalMusicSheet} from "../../../../src/MusicalScore/Graphical/GraphicalMusicSheet";
 import {MusicSheet} from "../../../../src/MusicalScore/MusicSheet";
@@ -8,7 +9,6 @@ import {IXmlElement} from "../../../../src/Common/FileIO/Xml";
 import {VexFlowBackend} from "../../../../src/MusicalScore/Graphical/VexFlow/VexFlowBackend";
 import {CanvasVexFlowBackend} from "../../../../src/MusicalScore/Graphical/VexFlow/CanvasVexFlowBackend";
 
-/* tslint:disable:no-unused-expression */
 describe("VexFlow Music Sheet Drawer", () => {
 
     it("draws sheet \"Clementi pt. 1\"", (done: MochaDone) => {

+ 1 - 1
test/MusicalScore/ScoreCalculation/MusicSheetCalculator_Test.ts

@@ -1,3 +1,4 @@
+/* eslint-disable @typescript-eslint/no-unused-expressions */
 import {MusicSheetReader} from "../../../src/MusicalScore/ScoreIO/MusicSheetReader";
 import {MusicSheet} from "../../../src/MusicalScore/MusicSheet";
 import {IXmlElement} from "../../../src/Common/FileIO/Xml";
@@ -8,7 +9,6 @@ import {VexFlowTextMeasurer} from "../../../src/MusicalScore/Graphical/VexFlow/V
 import {TestUtils} from "../../Util/TestUtils";
 import {EngravingRules} from "../../../src";
 
-/* tslint:disable:no-unused-expression */
 describe("Music Sheet Calculator", () => {
     const filename: string = "MuzioClementi_SonatinaOpus36No1_Part1.xml";
     const reader: MusicSheetReader = new MusicSheetReader();

+ 0 - 1
test/MusicalScore/ScoreIO/Key_Test.ts

@@ -11,7 +11,6 @@ import { RhythmInstruction, RhythmSymbolEnum } from "../../../src/MusicalScore/V
 let reader: MusicSheetReader;
 let parser: DOMParser;
 
-/* tslint:disable:no-unused-expression */
 describe("MusicXML parser for element 'key'", () => {
 
   before((): void => {

+ 1 - 1
test/MusicalScore/ScoreIO/MusicSheetReader_Test.ts

@@ -1,8 +1,8 @@
+/* eslint-disable @typescript-eslint/no-unused-expressions */
 import {MusicSheetReader} from "../../../src/MusicalScore/ScoreIO/MusicSheetReader";
 import {MusicSheet} from "../../../src/MusicalScore/MusicSheet";
 import {IXmlElement} from "../../../src/Common/FileIO/Xml";
 
-/* tslint:disable:no-unused-expression */
 describe("Music Sheet Reader", () => {
     const path: string = "test/data/MuzioClementi_SonatinaOpus36No1_Part1.xml";
     const reader: MusicSheetReader = new MusicSheetReader();

+ 0 - 1
test/MusicalScore/VoiceData/NoteType_Test.ts

@@ -1,6 +1,5 @@
 import { NoteType, NoteTypeHandler } from "../../../src/MusicalScore/VoiceData/NoteType";
 
-/* tslint:disable:no-unused-expression */
 describe("NoteType", () => {
     it("parses 32nd note correctly (sample value)", (done: MochaDone) => {
         chai.expect(NoteTypeHandler.StringToNoteType("32nd")).to.equal(NoteType._32nd);