firmata-electron
Version:
A library to control an arduino running firmata
96 lines (93 loc) • 2.41 kB
JavaScript
module.exports = function (grunt) {
grunt.initConfig({
mochaTest: {
files: [ "test/*.test.js"]
},
jshint: {
all: [ "gruntfile.js", "lib/*.js", "test/*.js", "examples/*.js"],
options: {
globals: {
it: true,
describe: true,
beforeEach: true,
afterEach: true,
before: true
},
curly: true,
eqeqeq: true,
immed: true,
latedef: false,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
node: true,
strict: false,
es5: true
}
},
jscs: {
files: {
src: [ "gruntfile.js", "lib/*.js", "test/*.js", "examples/*.js"]
},
options: {
config: ".jscsrc",
requireCurlyBraces: [
"if",
"else",
"for",
"while",
"do",
"try",
"catch",
],
requireSpaceBeforeBlockStatements: true,
requireParenthesesAroundIIFE: true,
requireSpacesInConditionalExpression: true,
// requireSpaceBeforeKeywords: true,
requireSpaceAfterKeywords: [
"if", "else",
"switch", "case",
"try", "catch",
"do", "while", "for",
"return", "typeof", "void",
],
validateQuoteMarks: {
mark: "\"",
escape: true
}
}
},
jsbeautifier: {
files: [ "gruntfile.js", "lib/*.js", "test/*.js", "examples/*.js"],
options: {
js: {
braceStyle: "collapse",
breakChainedMethods: false,
e4x: false,
evalCode: false,
indentChar: " ",
indentLevel: 0,
indentSize: 2,
indentWithTabs: false,
jslintHappy: false,
keepArrayIndentation: false,
keepFunctionIndentation: false,
maxPreserveNewlines: 10,
preserveNewlines: true,
spaceBeforeConditional: true,
spaceInParen: false,
unescapeStrings: false,
wrapLineLength: 0
}
}
},
});
grunt.registerTask("default", ["jshint:all", "jscs", "mochaTest"]);
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-mocha-test");
grunt.loadNpmTasks("grunt-jsbeautifier");
grunt.loadNpmTasks("grunt-jscs");
};