Merge pull request #818 from fewieden/fix-typo

fixed typo + eslint
This commit is contained in:
Michael Teeuw 2017-04-03 20:21:35 +02:00 committed by GitHub
commit 22e4e4125a
5 changed files with 51 additions and 21 deletions

View File

@ -6,12 +6,20 @@ module.exports = function(grunt) {
options: {
configFile: ".eslintrc.json"
},
target: ["js/*.js", "modules/default/*.js", "modules/default/*/*.js",
"serveronly/*.js", "*.js", "tests/*/*.js", "!modules/default/alert/notificationFx.js",
"!modules/default/alert/modernizr.custom.js", "!modules/default/alert/classie.js",
target: [
"js/*.js",
"modules/default/*.js",
"modules/default/*/*.js",
"serveronly/*.js",
"*.js",
"tests/**/*.js",
"!modules/default/alert/notificationFx.js",
"!modules/default/alert/modernizr.custom.js",
"!modules/default/alert/classie.js",
"config/*",
"translations/translations.js", "vendor/vendor.js"
"translations/translations.js",
"vendor/vendor.js",
"modules/node_modules/node_helper/index.js"
]
},
stylelint: {
@ -19,14 +27,26 @@ module.exports = function(grunt) {
options: {
configFile: ".stylelintrc"
},
src: ["css/main.css", "modules/default/calendar/calendar.css", "modules/default/clock/clock_styles.css", "modules/default/currentweather/currentweather.css", "modules/default/weatherforcast/weatherforcast.css"]
src: [
"css/main.css",
"modules/default/calendar/calendar.css",
"modules/default/clock/clock_styles.css",
"modules/default/currentweather/currentweather.css",
"modules/default/weatherforcast/weatherforcast.css"
]
}
},
jsonlint: {
main: {
src: ["package.json", ".eslintrc.json", ".stylelintrc", "translations/*.json",
"modules/default/*/translations/*.json", "installers/pm2_MagicMirror.json",
"vendor/package.js"],
src: [
"package.json",
".eslintrc.json",
".stylelintrc",
"translations/*.json",
"modules/default/*/translations/*.json",
"installers/pm2_MagicMirror.json",
"vendor/package.js"
],
options: {
reporter: "jshint"
}
@ -58,11 +78,20 @@ module.exports = function(grunt) {
"MD038": false
}
},
src: ["README.md", "CHANGELOG.md", "LICENSE.md", "modules/README.md", "modules/default/**/*.md", "!modules/default/calendar/vendor/ical.js/readme.md"]
src: [
"README.md",
"CHANGELOG.md",
"LICENSE.md",
"modules/README.md",
"modules/default/**/*.md",
"!modules/default/calendar/vendor/ical.js/readme.md"
]
}
},
yamllint: {
all: [".travis.yml"]
all: [
".travis.yml"
]
}
});
grunt.loadNpmTasks("grunt-eslint");

View File

@ -20,7 +20,7 @@ NodeHelper = Class.extend({
},
start: function() {
console.log("Staring module helper: " + this.name);
console.log("Starting module helper: " + this.name);
},
/* socketNotificationReceived(notification, payload)
@ -45,7 +45,7 @@ NodeHelper = Class.extend({
/* setPath(path)
* Set the module path.
*
* argument name string - Module name.
* argument path string - Module path.
*/
setPath: function(path) {
this.path = path;
@ -98,9 +98,10 @@ NodeHelper = Class.extend({
// register catch all.
socket.on("*", function(notification, payload) {
if (notification !== "*")
//console.log('received message in namespace: ' + namespace);
self.socketNotificationReceived(notification, payload);
if (notification !== "*") {
//console.log('received message in namespace: ' + namespace);
self.socketNotificationReceived(notification, payload);
}
});
});

View File

@ -24,8 +24,8 @@ var config = {
// Using exotic content. This is why dont accept go to JSON configuration file
(function() {
var positions = ["top_bar", "top_left", "top_center", "top_right", "upper_third",
"middle_center", "lower_third", "bottom_left", "bottom_center", "bottom_right",
"bottom_bar", "fullscreen_above", "fullscreen_below"];
"middle_center", "lower_third", "bottom_left", "bottom_center", "bottom_right",
"bottom_bar", "fullscreen_above", "fullscreen_below"];
var modules = Array();
for (idx in positions) {
modules.push({

View File

@ -63,8 +63,8 @@ describe("'global.root_path' set in js/app.js", function() {
});
it("should expect the global.version equals package.json file", function() {
version_package = JSON.parse(fs.readFileSync("package.json", "utf8")).version;
expect(this.sandbox.global.version).to.equal(version_package);
versionPackage = JSON.parse(fs.readFileSync("package.json", "utf8")).version;
expect(this.sandbox.global.version).to.equal(versionPackage);
});
});