Procházet zdrojové kódy

style: moved linting from grunt to npm script

tslint and jshint are no longer run by grunt but via npm script directly, using `npm run lint`

BREAKING CHANGE: Running `grunt lint` is no longer possible.
Sebastian Haas před 8 roky
rodič
revize
8dafc273d8

+ 91 - 0
.jshintrc

@@ -0,0 +1,91 @@
+{
+    // JSHint Default Configuration File (as on JSHint website)
+    // See http://jshint.com/docs/ for more details
+
+    "maxerr"        : 50,       // {int} Maximum error before stopping
+
+    // Enforcing
+    "bitwise"       : true,     // true: Prohibit bitwise operators (&, |, ^, etc.)
+    "camelcase"     : true,     // true: Identifiers must be in camelCase
+    "curly"         : true,     // true: Require {} for every new block or scope
+    "eqeqeq"        : true,     // true: Require triple equals (===) for comparison
+    "forin"         : true,     // true: Require filtering for..in loops with obj.hasOwnProperty()
+    "freeze"        : true,     // true: prohibits overwriting prototypes of native objects such as Array, Date etc.
+    "immed"         : false,    // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
+    "latedef"       : false,    // true: Require variables/functions to be defined before being used
+    "newcap"        : false,    // true: Require capitalization of all constructor functions e.g. `new F()`
+    "noarg"         : true,     // true: Prohibit use of `arguments.caller` and `arguments.callee`
+    "noempty"       : true,     // true: Prohibit use of empty blocks
+    "nonbsp"        : true,     // true: Prohibit "non-breaking whitespace" characters.
+    "nonew"         : false,    // true: Prohibit use of constructors for side-effects (without assignment)
+    "plusplus"      : false,    // true: Prohibit use of `++` and `--`
+    "quotmark"      : true,     // Quotation mark consistency:
+                                //   false    : do nothing (default)
+                                //   true     : ensure whatever is used is consistent
+                                //   "single" : require single quotes
+                                //   "double" : require double quotes
+    "undef"         : true,     // true: Require all non-global variables to be declared (prevents global leaks)
+    "unused"        : true,     // Unused variables:
+                                //   true     : all variables, last function parameter
+                                //   "vars"   : all variables only
+                                //   "strict" : all variables, all function parameters
+    "strict"        : true,     // true: Requires all functions run in ES5 Strict Mode
+    "maxparams"     : false,    // {int} Max number of formal params allowed per function
+    "maxdepth"      : false,    // {int} Max depth of nested blocks (within functions)
+    "maxstatements" : false,    // {int} Max number statements per function
+    "maxcomplexity" : false,    // {int} Max cyclomatic complexity per function
+    "maxlen"        : false,    // {int} Max number of characters per line
+    "varstmt"       : false,    // true: Disallow any var statements. Only `let` and `const` are allowed.
+
+    // Relaxing
+    "asi"           : false,     // true: Tolerate Automatic Semicolon Insertion (no semicolons)
+    "boss"          : false,     // true: Tolerate assignments where comparisons would be expected
+    "debug"         : false,     // true: Allow debugger statements e.g. browser breakpoints.
+    "eqnull"        : false,     // true: Tolerate use of `== null`
+    "esversion"     : 5,         // {int} Specify the ECMAScript version to which the code must adhere.
+    "moz"           : false,     // true: Allow Mozilla specific syntax (extends and overrides esnext features)
+                                 // (ex: `for each`, multiple try/catch, function expression…)
+    "evil"          : false,     // true: Tolerate use of `eval` and `new Function()`
+    "expr"          : false,     // true: Tolerate `ExpressionStatement` as Programs
+    "funcscope"     : false,     // true: Tolerate defining variables inside control statements
+    "globalstrict"  : false,     // true: Allow global "use strict" (also enables 'strict')
+    "iterator"      : false,     // true: Tolerate using the `__iterator__` property
+    "lastsemic"     : false,     // true: Tolerate omitting a semicolon for the last statement of a 1-line block
+    "laxbreak"      : false,     // true: Tolerate possibly unsafe line breakings
+    "laxcomma"      : false,     // true: Tolerate comma-first style coding
+    "loopfunc"      : false,     // true: Tolerate functions being defined in loops
+    "multistr"      : false,     // true: Tolerate multi-line strings
+    "noyield"       : false,     // true: Tolerate generator functions with no yield statement in them.
+    "notypeof"      : false,     // true: Tolerate invalid typeof operator values
+    "proto"         : false,     // true: Tolerate using the `__proto__` property
+    "scripturl"     : false,     // true: Tolerate script-targeted URLs
+    "shadow"        : false,     // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
+    "sub"           : false,     // true: Tolerate using `[]` notation when it can still be expressed in dot notation
+    "supernew"      : false,     // true: Tolerate `new function () { ... };` and `new Object;`
+    "validthis"     : false,     // true: Tolerate using this in a non-constructor function
+
+    // Environments
+    "browser"       : true,     // Web Browser (window, document, etc)
+    "browserify"    : false,    // Browserify (node.js code in the browser)
+    "couch"         : false,    // CouchDB
+    "devel"         : true,     // Development/debugging (alert, confirm, etc)
+    "dojo"          : false,    // Dojo Toolkit
+    "jasmine"       : false,    // Jasmine
+    "jquery"        : false,    // jQuery
+    "mocha"         : true,     // Mocha
+    "mootools"      : false,    // MooTools
+    "node"          : false,    // Node.js
+    "nonstandard"   : false,    // Widely adopted globals (escape, unescape, etc)
+    "phantom"       : false,    // PhantomJS
+    "prototypejs"   : false,    // Prototype and Scriptaculous
+    "qunit"         : false,    // QUnit
+    "rhino"         : false,    // Rhino
+    "shelljs"       : false,    // ShellJS
+    "typed"         : false,    // Globals for typed array constructions
+    "worker"        : false,    // Web Workers
+    "wsh"           : false,    // Windows Scripting Host
+    "yui"           : false,    // Yahoo User Interface
+
+    // Custom Globals
+    "globals"       : {}        // additional predefined global variables
+}

+ 6 - 31
Gruntfile.js

@@ -34,7 +34,7 @@ module.exports = function (grunt) {
                 src: ['src/OSMD/OSMD.ts'],
                 dest: '<%= outputDir.build %>/osmd.js',
                 options: {
-                    banner: "<%= banner %>",
+                    banner: '<%= banner %>',
                     browserifyOptions: {
                         standalone: 'opensheetmusicdisplay'
                     }
@@ -44,10 +44,10 @@ module.exports = function (grunt) {
                 src: ['src/OSMD/OSMD.ts'],
                 dest: '<%= outputDir.build %>/osmd-debug.js',
                 options: {
-                    banner: "<%= banner %>",
+                    banner: '<%= banner %>',
                     browserifyOptions: {
                         debug: true,
-                        standalone: 'opensheetmusicdisplay'                        
+                        standalone: 'opensheetmusicdisplay'
                     }
                 }
             },
@@ -55,7 +55,7 @@ module.exports = function (grunt) {
                 src: [].concat(typings, src, test),
                 dest: '<%= outputDir.build %>/osmd-test.js',
                 options: {
-                    banner: "<%= banner %>",
+                    banner: '<%= banner %>',
                     browserifyOptions: {
                         debug: true
                     }
@@ -69,7 +69,7 @@ module.exports = function (grunt) {
         uglify: {
             options: {
                 compress: {
-                    drop_console: true
+                    'drop_console': true
                 },
                 banner: banner,
                 mangle: true,
@@ -105,25 +105,6 @@ module.exports = function (grunt) {
                 }
             }
         },
-        // TSLint setup
-        tslint: {
-            options: {
-                configuration: 'tslint.json'
-            },
-            all: {
-                src: [].concat(src, test)
-            }
-        },
-        // JsHint setup
-        jshint: {
-            all: [
-                'Gruntfile.js', 'karma.conf.js', 'demo/**/*.js'
-            ]
-        },
-        // TypeScript Type Definitions
-        typings: {
-            install: {}
-        },
         // Typescript compilation for ES6 module (npm package)
         ts: {
           default : {
@@ -172,17 +153,11 @@ module.exports = function (grunt) {
     grunt.loadNpmTasks('grunt-browserify');
     grunt.loadNpmTasks('grunt-contrib-clean');
     grunt.loadNpmTasks('grunt-contrib-copy');
-    grunt.loadNpmTasks('grunt-contrib-jshint');
     grunt.loadNpmTasks('grunt-contrib-uglify');
     grunt.loadNpmTasks('grunt-contrib-watch');
     grunt.loadNpmTasks('grunt-http-server');
     grunt.loadNpmTasks('grunt-karma');
     grunt.loadNpmTasks('grunt-ts');
-    grunt.loadNpmTasks('grunt-tslint');
-    grunt.loadNpmTasks('grunt-typings');
-
-    // Code quality
-    grunt.registerTask('lint',        'Lints all JavaScript and TypeScript files.',  ['jshint', 'tslint']);
 
     // Build tasks
     grunt.registerTask('build:demo',  'Builds the demo.',                            ['browserify:debug', 'copy:demo']);
@@ -193,5 +168,5 @@ module.exports = function (grunt) {
     grunt.registerTask('test',        'Runs unit, regression and e2e tests.',        ['build:test', 'karma:ci']);
 
     // Default task (if grunt is run without any argument, used in contiuous integration)
-    grunt.registerTask('default',     'Default task, running all other tasks. (CI)', ['lint', 'test', 'build:demo', 'build:dist']);
+    grunt.registerTask('default',     'Default task, running all other tasks. (CI)', ['test', 'build:demo', 'build:dist']);
 };

+ 5 - 5
package.json

@@ -6,8 +6,10 @@
   "typings": "dist/src/OSMD/OSMD",
   "scripts": {
     "docs": "typedoc --mode file --out build/docs --module commonjs --target ES5 --name opensheetmusicdisplay ./src",
-    "lint": "grunt lint",
+    "lint": "npm run jshint && npm run tslint",
+    "jshint": "jshint . --exclude node_modules,dist,build,bin,demo",
     "test": "npm run lint && grunt test",
+    "tslint": "tslint --type-check --project tsconfig.json \"src/**/*.ts\" \"test/**/*.ts\"",
     "postinstall": "rimraf typings",
     "prepublish": "grunt build:dist"
   },
@@ -64,15 +66,13 @@
     "grunt-browserify": "^5.0.0",
     "grunt-contrib-clean": "^1.0.0",
     "grunt-contrib-copy": "^1.0.0",
-    "grunt-contrib-jshint": "^1.0.0",
     "grunt-contrib-uglify": "^2.0.0",
     "grunt-contrib-watch": "^1.0.0",
     "grunt-http-server": "",
     "grunt-karma": "^2.0.0",
     "grunt-ts": "^6.0.0-beta.3",
-    "grunt-tslint": "^4.0.0",
-    "grunt-typings": "^0.1.5",
     "http-server": "^0.9.0",
+    "jshint": "^2.9.4",
     "karma": "^1.1.1",
     "karma-base64-to-js-preprocessor": "^0.0.1",
     "karma-chai": "^0.1.0",
@@ -89,7 +89,7 @@
     "tsify": "^3.0.0",
     "tslint": "^5.0.0",
     "typedoc": "^0.5.7",
-    "typescript": "^2.2.1"
+    "typescript": "^2.2.2"
   },
   "config": {
     "commitizen": {

+ 1 - 1
src/MusicalScore/Graphical/MusicSheetCalculator.ts

@@ -1165,7 +1165,7 @@ export abstract class MusicSheetCalculator {
                         verticalContainer.StaffEntries[j] = graphicalStaffEntry;
                         graphicalStaffEntry.parentVerticalContainer = verticalContainer;
                     } else {
-                        ;
+                        // TODO ?
                     }
                 }
             }

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

@@ -33,6 +33,8 @@ import {VexFlowGraphicalNote} from "./VexFlowGraphicalNote";
 export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
     constructor() {
         super(new VexFlowGraphicalSymbolFactory());
+        let a: LyricsEntry = new LyricsEntry(undefined, undefined, undefined);
+        a = a;
         MusicSheetCalculator.TextMeasurer = new VexFlowTextMeasurer();
     }
 

+ 37 - 14
src/MusicalScore/Interfaces/IGraphicalSymbolFactory.ts

@@ -1,34 +1,57 @@
+import {ClefInstruction} from "../VoiceData/Instructions/ClefInstruction";
+import {Fraction} from "../../Common/DataObjects/Fraction";
 import {GraphicalMusicPage} from "../Graphical/GraphicalMusicPage";
-import {MusicSystem} from "../Graphical/MusicSystem";
-import {Staff} from "../VoiceData/Staff";
-import {StaffLine} from "../Graphical/StaffLine";
-import {SourceMeasure} from "../VoiceData/SourceMeasure";
-import {StaffMeasure} from "../Graphical/StaffMeasure";
-import {SourceStaffEntry} from "../VoiceData/SourceStaffEntry";
+import {GraphicalNote} from "../Graphical/GraphicalNote";
 import {GraphicalStaffEntry} from "../Graphical/GraphicalStaffEntry";
+import {MusicSystem} from "../Graphical/MusicSystem";
 import {Note} from "../VoiceData/Note";
-import {ClefInstruction} from "../VoiceData/Instructions/ClefInstruction";
 import {OctaveEnum} from "../VoiceData/Expressions/ContinuousExpressions/OctaveShift";
-import {GraphicalNote} from "../Graphical/GraphicalNote";
 import {Pitch} from "../../Common/DataObjects/Pitch";
+import {SourceMeasure} from "../VoiceData/SourceMeasure";
+import {SourceStaffEntry} from "../VoiceData/SourceStaffEntry";
+import {Staff} from "../VoiceData/Staff";
+import {StaffLine} from "../Graphical/StaffLine";
+import {StaffMeasure} from "../Graphical/StaffMeasure";
 import {TechnicalInstruction} from "../VoiceData/Instructions/TechnicalInstruction";
-import {Fraction} from "../../Common/DataObjects/Fraction";
+
 export interface IGraphicalSymbolFactory {
+
     createMusicSystem(page: GraphicalMusicPage, systemIndex: number): MusicSystem;
+
     createStaffLine(parentSystem: MusicSystem, parentStaff: Staff): StaffLine;
+
     createStaffMeasure(sourceMeasure: SourceMeasure, staff: Staff): StaffMeasure;
+
     createExtraStaffMeasure(staffLine: StaffLine): StaffMeasure;
+
     createStaffEntry(sourceStaffEntry: SourceStaffEntry, measure: StaffMeasure): GraphicalStaffEntry;
+
     createGraceStaffEntry(staffEntryParent: GraphicalStaffEntry, measure: StaffMeasure): GraphicalStaffEntry;
-    createNote(note: Note, graphicalStaffEntry: GraphicalStaffEntry, activeClef: ClefInstruction,
-        octaveShift: OctaveEnum, graphicalNoteLength: Fraction): GraphicalNote;
-    createGraceNote(note: Note, graphicalStaffEntry: GraphicalStaffEntry, activeClef: ClefInstruction,
+
+    createNote(
+        note: Note, graphicalStaffEntry: GraphicalStaffEntry,
+        activeClef: ClefInstruction,
+        octaveShift: OctaveEnum,
+        graphicalNoteLength: Fraction): GraphicalNote;
+
+    createGraceNote(
+        note: Note,
+        graphicalStaffEntry: GraphicalStaffEntry,
+        activeClef: ClefInstruction,
         octaveShift: OctaveEnum): GraphicalNote;
+
     addGraphicalAccidental(graphicalNote: GraphicalNote, pitch: Pitch, grace: boolean, graceScalingFactor: number): void;
+
     addFermataAtTiedEndNote(tiedNote: Note, graphicalStaffEntry: GraphicalStaffEntry): void;
-    createGraphicalTechnicalInstruction(technicalInstruction: TechnicalInstruction,
+
+    createGraphicalTechnicalInstruction(
+        technicalInstruction: TechnicalInstruction,
         graphicalStaffEntry: GraphicalStaffEntry): void;
+
     createInStaffClef(graphicalStaffEntry: GraphicalStaffEntry, clefInstruction: ClefInstruction): void;
-    createChordSymbol(sourceStaffEntry: SourceStaffEntry, graphicalStaffEntry: GraphicalStaffEntry,
+
+    createChordSymbol(
+        sourceStaffEntry: SourceStaffEntry,
+        graphicalStaffEntry: GraphicalStaffEntry,
         transposeHalftones: number): void;
 }

+ 7 - 7
src/MusicalScore/VoiceData/VoiceEntry.ts

@@ -172,8 +172,8 @@ export class VoiceEntry {
                         this.createAlteratedVoiceEntry(currentTimestamp, length, baseVoice, higherPitch, alteration, voiceEntries);
                     }
                 }
-            }
                 break;
+            }
             case OrnamentEnum.Turn: {
                 let length: Fraction = new Fraction(baselength.Numerator, baselength.Denominator * 4);
                 let lowerPitch: Pitch = baseNote.Pitch.getTransposedPitch(-1);
@@ -191,8 +191,8 @@ export class VoiceEntry {
                 );
                 currentTimestamp.Add(length);
                 this.createBaseVoiceEntry(currentTimestamp, length, baseVoice, baseNote, voiceEntries);
-            }
                 break;
+            }
             case OrnamentEnum.InvertedTurn: {
                 let length: Fraction = new Fraction(baselength.Numerator, baselength.Denominator * 4);
                 let lowerPitch: Pitch = baseNote.Pitch.getTransposedPitch(-1);
@@ -210,8 +210,8 @@ export class VoiceEntry {
                 );
                 currentTimestamp.Add(length);
                 this.createBaseVoiceEntry(currentTimestamp, length, baseVoice, baseNote, voiceEntries);
-            }
                 break;
+            }
             case OrnamentEnum.DelayedTurn: {
                 let length: Fraction = new Fraction(baselength.Numerator, baselength.Denominator * 2);
                 let lowerPitch: Pitch = baseNote.Pitch.getTransposedPitch(-1);
@@ -228,8 +228,8 @@ export class VoiceEntry {
                 this.createAlteratedVoiceEntry(currentTimestamp, length, baseVoice, lowerPitch, lowerAlteration, voiceEntries);
                 currentTimestamp.Add(length);
                 this.createBaseVoiceEntry(currentTimestamp, length, baseVoice, baseNote, voiceEntries);
-            }
                 break;
+            }
             case OrnamentEnum.DelayedInvertedTurn: {
                 let length: Fraction = new Fraction(baselength.Numerator, baselength.Denominator * 2);
                 let lowerPitch: Pitch = baseNote.Pitch.getTransposedPitch(-1);
@@ -246,8 +246,8 @@ export class VoiceEntry {
                 this.createAlteratedVoiceEntry(currentTimestamp, length, baseVoice, higherPitch, higherAlteration, voiceEntries);
                 currentTimestamp.Add(length);
                 this.createBaseVoiceEntry(currentTimestamp, length, baseVoice, baseNote, voiceEntries);
-            }
                 break;
+            }
             case OrnamentEnum.Mordent: {
                 let length: Fraction = new Fraction(baselength.Numerator, baselength.Denominator * 4);
                 let higherPitch: Pitch = baseNote.Pitch.getTransposedPitch(1);
@@ -258,8 +258,8 @@ export class VoiceEntry {
                 length.Denominator = baselength.Denominator * 2;
                 currentTimestamp = Fraction.plus(baseTimestamp, length);
                 this.createBaseVoiceEntry(currentTimestamp, length, baseVoice, baseNote, voiceEntries);
-            }
                 break;
+            }
             case OrnamentEnum.InvertedMordent: {
                 let length: Fraction = new Fraction(baselength.Numerator, baselength.Denominator * 4);
                 let lowerPitch: Pitch = baseNote.Pitch.getTransposedPitch(-1);
@@ -270,8 +270,8 @@ export class VoiceEntry {
                 length.Denominator = baselength.Denominator * 2;
                 currentTimestamp = Fraction.plus(baseTimestamp, length);
                 this.createBaseVoiceEntry(currentTimestamp, length, baseVoice, baseNote, voiceEntries);
-            }
                 break;
+            }
             default:
                 throw new RangeError();
         }

+ 2 - 1
test/Common/FileIO/Mxl_Test.ts

@@ -2,10 +2,11 @@ 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(scoreName, (done: MochaDone) => {
+    it(`reads ${scoreName}`, (done: MochaDone) => {
       // Load the xml file content
       let mxl: string = TestUtils.getMXL(scoreName);
       chai.expect(mxl).to.not.be.undefined;

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

@@ -9,6 +9,7 @@ import {SourceStaffEntry} from "../../../../src/MusicalScore/VoiceData/SourceSta
 import {StaffMeasure} from "../../../../src/MusicalScore/Graphical/StaffMeasure";
 import {MusicSheetCalculator} from "../../../../src/MusicalScore/Graphical/MusicSheetCalculator";
 
+/* tslint:disable:no-unused-expression */
 describe("VexFlow Measure", () => {
 
    it.skip("GraphicalMusicSheet", (done: MochaDone) => {

+ 3 - 2
test/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetDrawer_Test.ts

@@ -8,9 +8,10 @@ import {TestUtils} from "../../../Util/TestUtils";
 import {IXmlElement} from "../../../../src/Common/FileIO/Xml";
 import {Fraction} from "../../../../src/Common/DataObjects/Fraction";
 
+/* tslint:disable:no-unused-expression */
 describe("VexFlow Music Sheet Drawer", () => {
 
-    it(".drawSheet (Clementi pt. 1)", (done: MochaDone) => {
+    it("draws sheet \"Clementi pt. 1\"", (done: MochaDone) => {
         let score: Document = TestUtils.getScore("MuzioClementi_SonatinaOpus36No1_Part1.xml");
         chai.expect(score).to.not.be.undefined;
         let partwise: Element = TestUtils.getPartWiseElement(score);
@@ -27,7 +28,7 @@ describe("VexFlow Music Sheet Drawer", () => {
         done();
     });
 
-    it.skip("With cursor (as rectangle)", (done: MochaDone) => {
+    it.skip("draws cursor (as rectangle)", (done: MochaDone) => {
         let score: Document = TestUtils.getScore("MuzioClementi_SonatinaOpus36No1_Part1.xml");
         chai.expect(score).to.not.be.undefined;
         let partwise: Element = TestUtils.getPartWiseElement(score);

+ 3 - 19
test/MusicalScore/ScoreCalculation/MusicSheetCalculator_Test.ts

@@ -1,6 +1,3 @@
-/**
- * Created by Matthias on 21.06.2016.
- */
 import {MusicSheetReader} from "../../../src/MusicalScore/ScoreIO/MusicSheetReader";
 import {MusicSheet} from "../../../src/MusicalScore/MusicSheet";
 import {IXmlElement} from "../../../src/Common/FileIO/Xml";
@@ -10,28 +7,15 @@ import {GraphicalMusicSheet} from "../../../src/MusicalScore/Graphical/Graphical
 import {VexFlowTextMeasurer} from "../../../src/MusicalScore/Graphical/VexFlow/VexFlowTextMeasurer";
 import {TestUtils} from "../../Util/TestUtils";
 
-
-describe("Music Sheet Calculator Tests", () => {
-    // Initialize variables
+/* tslint:disable:no-unused-expression */
+describe("Music Sheet Calculator", () => {
     let filename: string = "MuzioClementi_SonatinaOpus36No1_Part1.xml";
     let reader: MusicSheetReader = new MusicSheetReader();
     let calculator: MusicSheetCalculator = new VexFlowMusicSheetCalculator();
     let score: IXmlElement;
     let sheet: MusicSheet;
 
-    before((): void => {
-        // ???
-    });
-
-    beforeEach((): void => {
-        // ???
-    });
-
-    afterEach((): void => {
-        // cleanup?
-    });
-
-    it("Do Calculation", (done: MochaDone) => {
+    it("calculates music sheet", (done: MochaDone) => {
         this.timeout = 10000;
         MusicSheetCalculator.TextMeasurer = new VexFlowTextMeasurer();
         // Load the XML file

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

@@ -3,10 +3,12 @@ import { MusicSheet }             from "../../../src/MusicalScore/MusicSheet";
 import { IXmlElement }            from "../../../src/Common/FileIO/Xml";
 import { KeyInstruction }         from "../../../src/MusicalScore/VoiceData/Instructions/KeyInstruction";
 import { KeyEnum as KeyModeEnum } from "../../../src/MusicalScore/VoiceData/Instructions/KeyInstruction";
+import * as chai                  from "chai";
 
 let reader: MusicSheetReader;
 let parser: DOMParser;
 
+/* tslint:disable:no-unused-expression */
 describe("MusicXML parser for element 'key'", () => {
 
   before((): void => {

+ 9 - 19
test/MusicalScore/ScoreIO/MusicSheetReader_Test.ts

@@ -2,10 +2,8 @@ import {MusicSheetReader} from "../../../src/MusicalScore/ScoreIO/MusicSheetRead
 import {MusicSheet} from "../../../src/MusicalScore/MusicSheet";
 import {IXmlElement} from "../../../src/Common/FileIO/Xml";
 
-
-
-describe("Music Sheet Reader Tests", () => {
-    // Initialize variables
+/* tslint:disable:no-unused-expression */
+describe("Music Sheet Reader", () => {
     let path: string = "test/data/MuzioClementi_SonatinaOpus36No1_Part1.xml";
     let reader: MusicSheetReader = new MusicSheetReader();
     let score: IXmlElement;
@@ -24,30 +22,22 @@ describe("Music Sheet Reader Tests", () => {
         sheet = reader.createMusicSheet(score, path);
     });
 
-    beforeEach((): void => {
-      // ???
-    });
-
-    afterEach((): void => {
-      // cleanup?
+    it("checks XML", (done: MochaDone) => {
+      done(); // TODO implement test
     });
 
-    it("Check XML", (done: MochaDone) => {
-      done();
-    });
-
-    it("Read title and composer", (done: MochaDone) => {
+    it("reads title and composer", (done: MochaDone) => {
         chai.expect(sheet.TitleString).to.equal("Sonatina Op.36 No 1 Teil 1 Allegro");
         chai.expect(sheet.ComposerString).to.equal("Muzio Clementi");
         done();
     });
 
-    it("Measures", (done: MochaDone) => {
+    it("reads measures", (done: MochaDone) => {
         chai.expect(sheet.SourceMeasures.length).to.equal(38);
         done();
     });
 
-    it("Instruments", (done: MochaDone) => {
+    it("reads instruments", (done: MochaDone) => {
         chai.expect(reader.CompleteNumberOfStaves).to.equal(2);
         chai.expect(sheet.Instruments.length).to.equal(2);
         chai.expect(sheet.InstrumentalGroups.length).to.equal(2);
@@ -56,9 +46,9 @@ describe("Music Sheet Reader Tests", () => {
         done();
     });
 
-    it("Notes", (done: MochaDone) => {
+    it("reads notes", (done: MochaDone) => {
+        // TODO implement test
         // Staff Entries on first measure
-
         // chai.expect(sheet.SourceMeasures[0].VerticalSourceStaffEntryContainers[0].StaffEntries.length).to.equal(4);
         done();
     });

+ 0 - 1
tslint.json

@@ -57,7 +57,6 @@
     "no-trailing-whitespace": true,
     "no-unused-expression": true,
     "no-unused-variable": true,
-    "no-use-before-declare": true,
     "no-var-keyword": true,
     "no-var-requires": true,
     "object-literal-sort-keys": true,