Selaa lähdekoodia

lint: fixed lint errors due to tslint updates

Signed-off-by: Sebastian Haas <sebastian@haas.tech>
Sebastian Haas 8 vuotta sitten
vanhempi
commit
c5f39fa87a

+ 1 - 1
package.json

@@ -77,7 +77,7 @@
     "mocha": "^3.0.1",
     "phantomjs-prebuilt": "^2.1.8",
     "tsify": "^3.0.0",
-    "tslint": "^4.3.1",
+    "tslint": "^4.5.1",
     "typedoc": "^0.5.7",
     "typescript": "^2.2.1",
     "typings": "^2.0.0"

+ 4 - 4
src/MusicalScore/Graphical/VexFlow/VexFlowConverter.ts

@@ -26,16 +26,16 @@ export class VexFlowConverter {
      * @type {[alterationsNo: number]: string; }
      */
     private static majorMap: {[_: number]: string; } = {
-        "0": "C", 1: "G", 2: "D", 3: "A", 4: "E", 5: "B", 6: "F#", 7: "C#",
-        8: "G#", "-1": "F", "-8": "Fb", "-7": "Cb", "-6": "Gb", "-5": "Db", "-4": "Ab", "-3": "Eb", "-2": "Bb",
+        "-1": "F", "-2": "Bb", "-3": "Eb", "-4": "Ab", "-5": "Db", "-6": "Gb", "-7": "Cb", "-8": "Fb",
+        "0": "C", "1": "G", "2": "D", "3": "A", "4": "E", "5": "B", "6": "F#", "7": "C#", "8": "G#"
     };
     /**
      * Mapping from numbers of alterations on the key signature to minor keys
      * @type {[alterationsNo: number]: string; }
      */
     private static minorMap: {[_: number]: string; } = {
-        "1": "E", "7": "A#", "0": "A", "6": "D#", "3": "F#", "-5": "Bb", "-4": "F", "-7": "Ab", "-6": "Eb",
-        "-1": "D", "4": "C#", "-3": "C", "-2": "G", "2": "B", "5": "G#", "-8": "Db", "8": "E#",
+        "-1": "D", "-2": "G", "-3": "C", "-4": "F", "-5": "Bb", "-6": "Eb", "-7": "Ab", "-8": "Db",
+        "0": "A", "1": "E", "2": "B", "3": "F#", "4": "C#", "5": "G#", "6": "D#", "7": "A#", "8": "E#"
     };
 
     /**

+ 32 - 32
src/MusicalScore/SubInstrument.ts

@@ -13,58 +13,58 @@ export class SubInstrument {
     }
 
     private static midiInstrument: { [key: string]: MidiInstrument; } = {
+        "alt": MidiInstrument.Synth_Voice,
+        "alto": MidiInstrument.Synth_Voice,
+        "banjo": MidiInstrument.Banjo,
+        "bariton": MidiInstrument.Synth_Voice,
+        "baritone": MidiInstrument.Synth_Voice,
+        "bass": MidiInstrument.Synth_Voice,
+        "blockflöte": MidiInstrument.Recorder,
+        "brass": MidiInstrument.Trombone,
+        "bratsche": MidiInstrument.Viola,
         "cello": MidiInstrument.Cello,
-        "violon-c": MidiInstrument.Cello,
-        "contrabass": MidiInstrument.Contrabass,
-        "kontrabass": MidiInstrument.Contrabass,
         "clarinet": MidiInstrument.Clarinet,
-        "klarinette": MidiInstrument.Clarinet,
+        "contrabass": MidiInstrument.Contrabass,
+        "drums": MidiInstrument.Percussion,
         "flute": MidiInstrument.Flute,
         "flöte": MidiInstrument.Flute,
         "frenchhorn": MidiInstrument.French_Horn,
-        "guitar": MidiInstrument.Acoustic_Guitar_nylon,
         "gitarre": MidiInstrument.Acoustic_Guitar_nylon,
-        "harp": MidiInstrument.Orchestral_Harp,
+        "guitar": MidiInstrument.Acoustic_Guitar_nylon,
         "harfe": MidiInstrument.Orchestral_Harp,
+        "harp": MidiInstrument.Orchestral_Harp,
+        "klarinette": MidiInstrument.Clarinet,
+        "klavier": MidiInstrument.Acoustic_Grand_Piano,
+        "kontrabass": MidiInstrument.Contrabass,
         "oboe": MidiInstrument.Oboe,
         "organ": MidiInstrument.Church_Organ,
-        "orgue": MidiInstrument.Church_Organ,
         "orgel": MidiInstrument.Church_Organ,
+        "orgue": MidiInstrument.Church_Organ,
+        "percussion": MidiInstrument.Percussion,
         "piano": MidiInstrument.Acoustic_Grand_Piano,
-        "klavier": MidiInstrument.Acoustic_Grand_Piano,
         "piccolo": MidiInstrument.Piccolo,
-        "strings": MidiInstrument.String_Ensemble_1,
-        "streicher": MidiInstrument.String_Ensemble_1,
+        "posaune": MidiInstrument.Trombone,
+        "recorder": MidiInstrument.Recorder,
+        "sax": MidiInstrument.Tenor_Sax,
+        "schlagwerk": MidiInstrument.Percussion,
+        "schlagzeug": MidiInstrument.Percussion,
+        "sopran": MidiInstrument.Synth_Voice,
         "steeldrum": MidiInstrument.Steel_Drums,
+        "streicher": MidiInstrument.String_Ensemble_1,
+        "strings": MidiInstrument.String_Ensemble_1,
+        "tenor": MidiInstrument.Synth_Voice,
+        "tpt": MidiInstrument.Trumpet,
         "trombone": MidiInstrument.Trombone,
-        "posaune": MidiInstrument.Trombone,
-        "brass": MidiInstrument.Trombone,
-        "trumpet": MidiInstrument.Trumpet,
         "trompete": MidiInstrument.Trumpet,
-        "tpt": MidiInstrument.Trumpet,
+        "trumpet": MidiInstrument.Trumpet,
         "tuba": MidiInstrument.Tuba,
-        "sax": MidiInstrument.Tenor_Sax,
+        "unnamed": MidiInstrument.Acoustic_Grand_Piano,
         "viola": MidiInstrument.Viola,
-        "bratsche": MidiInstrument.Viola,
         "violin": MidiInstrument.Violin,
+        "violon-c": MidiInstrument.Cello,
         "violon.": MidiInstrument.Violin,
-        "woodblock": MidiInstrument.Woodblock,
-        "alt": MidiInstrument.Synth_Voice,
-        "alto": MidiInstrument.Synth_Voice,
-        "tenor": MidiInstrument.Synth_Voice,
-        "bariton": MidiInstrument.Synth_Voice,
-        "baritone": MidiInstrument.Synth_Voice,
-        "bass": MidiInstrument.Synth_Voice,
-        "sopran": MidiInstrument.Synth_Voice,
         "voice": MidiInstrument.Synth_Voice,
-        "recorder": MidiInstrument.Recorder,
-        "blockflöte": MidiInstrument.Recorder,
-        "banjo": MidiInstrument.Banjo,
-        "drums": MidiInstrument.Percussion,
-        "percussion": MidiInstrument.Percussion,
-        "schlagzeug": MidiInstrument.Percussion,
-        "schlagwerk": MidiInstrument.Percussion,
-        "unnamed": MidiInstrument.Acoustic_Grand_Piano,
+        "woodblock": MidiInstrument.Woodblock
     };
 
     public idString: string;

+ 11 - 11
src/MusicalScore/VoiceData/Expressions/InstantaniousDynamicExpression.ts

@@ -14,12 +14,14 @@ export class InstantaniousDynamicExpression extends AbstractExpression {
         this.staffNumber = staffNumber;
     }
     public static dynamicToRelativeVolumeDict: { [_: string]: number; } = {
-        "ffffff": (127.0 / 127.0),
-        "fffff": (126.0 / 127.0) ,
-        "ffff": 125.0 / 127.0,
-        "fff": 124.0 / 127.0,
-        "ff": 108.0 / 127.0,
         "f": 92.0 / 127.0,
+        "ff": 108.0 / 127.0,
+        "fff": 124.0 / 127.0,
+        "ffff": 125.0 / 127.0,
+        "fffff": (126.0 / 127.0) ,
+        "ffffff": (127.0 / 127.0),
+        "fp": 0.5,
+        "fz": 0.5,
         "mf": 76.0 / 127.0,
         "mp": 60.0 / 127.0,
         "p": 44.0 / 127.0,
@@ -28,15 +30,13 @@ export class InstantaniousDynamicExpression extends AbstractExpression {
         "pppp": 10.0 / 127.0,
         "ppppp": 8.0 / 127.0,
         "pppppp": 6.0 / 127.0,
-        "sf": 0.5,
-        "sfp": 0.5,
-        "sfpp": 0.5,
-        "fp": 0.5,
         "rf": 0.5,
         "rfz": 0.5,
-        "sfz": 0.5,
+        "sf": 0.5,
         "sffz": 0.5,
-        "fz": 0.5,
+        "sfp": 0.5,
+        "sfpp": 0.5,
+        "sfz": 0.5
     };
 
     //private static weight: number;

+ 2 - 2
src/OSMD/OSMD.ts

@@ -68,8 +68,8 @@ export class OSMD {
             if (str.substr(0, 4) === "\x50\x4b\x03\x04") {
                 // This is a zip file, unpack it first
                 return MXLHelper.MXLtoXMLstring(str).then(
-                    (str: string) => {
-                        return self.load(str);
+                    (x: string) => {
+                        return self.load(x);
                     },
                     (err: any) => {
                         Logging.debug(err);

+ 3 - 22
tslint.json

@@ -22,18 +22,12 @@
     "interface-name": false,
     "jsdoc-format": true,
     "label-position": true,
-    "label-undefined": true,
     "max-line-length": [
       true,
       160
     ],
     "member-access": true,
-    "member-ordering": [
-      true,
-      "public-before-private",
-      "static-before-instance",
-      "variables-before-functions"
-    ],
+    "member-ordering": false,
     "no-any": false,
     "no-arg": true,
     "no-bitwise": true,
@@ -48,9 +42,8 @@
       "trace"
     ],
     "no-construct": true,
-    "no-constructor-vars": true,
+    "no-parameter-properties": true,
     "no-debugger": true,
-    "no-duplicate-key": true,
     "no-duplicate-variable": true,
     "no-empty": true,
     "no-eval": true,
@@ -62,7 +55,6 @@
     "no-string-literal": true,
     "no-switch-case-fall-through": true,
     "no-trailing-whitespace": true,
-    "no-unreachable": true,
     "no-unused-expression": true,
     "no-unused-variable": true,
     "no-use-before-declare": true,
@@ -84,13 +76,7 @@
     "radix": true,
     "semicolon": true,
     "switch-default": true,
-    "trailing-comma": [
-      true,
-      {
-        "multiline": "always",
-        "singleline": "never"
-      }
-    ],
+    "trailing-comma": false,
     "triple-equals": [
       true,
       "allow-null-check"
@@ -113,11 +99,6 @@
         "variable-declaration": "nospace"
       }
     ],
-    "use-strict": [
-      true,
-      "check-module",
-      "check-function"
-    ],
     "variable-name": [
       true,
       "check-format",