removed console logs; added jscs and jshint resource files
This commit is contained in:
parent
d014ee2d6f
commit
3b2e65e5ad
65
.jscsrc
Executable file
65
.jscsrc
Executable file
@ -0,0 +1,65 @@
|
||||
{
|
||||
"excludeFiles": ["node_modules/**", "mynode/**"],
|
||||
|
||||
"requireCurlyBraces": [
|
||||
"if",
|
||||
"else",
|
||||
"for",
|
||||
"while",
|
||||
"do",
|
||||
"try",
|
||||
"catch"
|
||||
],
|
||||
"requireOperatorBeforeLineBreak": true,
|
||||
"requireCamelCaseOrUpperCaseIdentifiers": true,
|
||||
"maximumLineLength": {
|
||||
"value": 200,
|
||||
"allowComments": true,
|
||||
"allowRegex": true
|
||||
},
|
||||
"validateIndentation": 2,
|
||||
"validateQuoteMarks": "'",
|
||||
|
||||
"disallowMultipleLineStrings": true,
|
||||
"disallowMixedSpacesAndTabs": true,
|
||||
"disallowTrailingWhitespace": true,
|
||||
"disallowSpaceAfterPrefixUnaryOperators": true,
|
||||
"disallowMultipleVarDecl": null,
|
||||
|
||||
"requireSpaceAfterKeywords": [
|
||||
"if",
|
||||
"else",
|
||||
"for",
|
||||
"while",
|
||||
"do",
|
||||
"switch",
|
||||
"return",
|
||||
"try",
|
||||
"catch"
|
||||
],
|
||||
"requireSpaceBeforeBinaryOperators": [
|
||||
"=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=",
|
||||
"&=", "|=", "^=", "+=",
|
||||
|
||||
"+", "-", "*", "/", "%", "<<", ">>", ">>>", "&",
|
||||
"|", "^", "&&", "||", "===", "==", ">=",
|
||||
"<=", "<", ">", "!=", "!=="
|
||||
],
|
||||
"requireSpaceAfterBinaryOperators": true,
|
||||
"requireSpacesInConditionalExpression": true,
|
||||
"requireSpaceBeforeBlockStatements": true,
|
||||
"disallowSpacesInsideObjectBrackets": "all",
|
||||
"disallowSpacesInsideArrayBrackets": "all",
|
||||
"disallowSpacesInsideParentheses": true,
|
||||
|
||||
"disallowMultipleLineBreaks": true,
|
||||
|
||||
"disallowCommaBeforeLineBreak": null,
|
||||
"disallowDanglingUnderscores": null,
|
||||
"disallowEmptyBlocks": null,
|
||||
"disallowTrailingComma": null,
|
||||
"requireCommaBeforeLineBreak": null,
|
||||
"requireDotNotation": null,
|
||||
"requireMultipleVarDecl": null,
|
||||
"requireParenthesesAroundIIFE": true
|
||||
}
|
||||
43
.jshintrc
Normal file
43
.jshintrc
Normal file
@ -0,0 +1,43 @@
|
||||
{
|
||||
"node": true, // Enable globals available when code is running inside of the NodeJS runtime environment.
|
||||
"browser": true, // Standard browser globals e.g. `window`, `document`.
|
||||
"esnext": true, // Allow ES.next specific features such as `const` and `let`.
|
||||
"bitwise": false, // Prohibit bitwise operators (&, |, ^, etc.).
|
||||
"camelcase": false, // Permit only camelcase for `var` and `object indexes`.
|
||||
"curly": false, // Require {} for every new block or scope.
|
||||
"eqeqeq": true, // Require triple equals i.e. `===`.
|
||||
"immed": true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
|
||||
"latedef": true, // Prohibit variable use before definition.
|
||||
"newcap": true, // Require capitalization of all constructor functions e.g. `new F()`.
|
||||
"noarg": true, // Prohibit use of `arguments.caller` and `arguments.callee`.
|
||||
"quotmark": "single", // Define quotes to string values.
|
||||
"regexp": true, // Prohibit `.` and `[^...]` in regular expressions.
|
||||
"undef": true, // Require all non-global variables be declared before they are used.
|
||||
"unused": true, // Warn unused variables.
|
||||
"strict": true, // Require `use strict` pragma in every file.
|
||||
"trailing": true, // Prohibit trailing whitespaces.
|
||||
"smarttabs": false, // Suppresses warnings about mixed tabs and spaces
|
||||
"globals": { // Globals variables.
|
||||
"angular": true
|
||||
},
|
||||
"predef": [ // Extra globals.
|
||||
"define",
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"describe",
|
||||
"before",
|
||||
"beforeEach",
|
||||
"after",
|
||||
"afterEach",
|
||||
"it",
|
||||
"inject",
|
||||
"$",
|
||||
"io",
|
||||
"app",
|
||||
"moment"
|
||||
],
|
||||
"indent": false, // Specify indentation spacing
|
||||
"devel": true, // Allow development statements e.g. `console.log();`.
|
||||
"noempty": true // Prohibit use of empty blocks.
|
||||
}
|
||||
@ -7,7 +7,6 @@ var exec = require('child_process').exec;
|
||||
var pkg = require('../app/package.json');
|
||||
|
||||
var InsightUI = function(options) {
|
||||
console.log('options are', options);
|
||||
BaseService.call(this, options);
|
||||
this.apiPrefix = options.apiPrefix || 'api';
|
||||
this.routePrefix = options.routePrefix || '';
|
||||
@ -20,14 +19,12 @@ inherits(InsightUI, BaseService);
|
||||
InsightUI.prototype.start = function(callback) {
|
||||
|
||||
var self = this;
|
||||
console.log('pkg before', pkg);
|
||||
pkg.insightConfig.apiPrefix = self.apiPrefix;
|
||||
pkg.insightConfig.routePrefix = self.routePrefix;
|
||||
console.log('pkg after', pkg);
|
||||
console.log('dirname', __dirname);
|
||||
|
||||
fs.writeFileSync(__dirname + '/../app/package.json', JSON.stringify(pkg, null, 2));
|
||||
/*
|
||||
* TODO implement properly with this version of insight
|
||||
exec('cd ' + __dirname + '/../;' +
|
||||
' npm run install-and-build', function(err) {
|
||||
if (err) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user