Skip to content

Commit

Permalink
jshint and jscs config files added
Browse files Browse the repository at this point in the history
added config files to configure hinting and style guides
test and lint npm tasks
 tech edits according jscs highlights
  • Loading branch information
Alexey Gurianov committed Jun 5, 2015
1 parent be3d8e6 commit 19f57ec
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 6 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
end_of_line = lf

[package.json]
indent_size = 2
55 changes: 55 additions & 0 deletions .jscs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
module.exports = {
excludeFiles: [
'node_modules/**'
],
requireSpaceAfterKeywords: ['if', 'else', 'for', 'while', 'do', 'switch', 'return', 'try', 'catch'],
requireSpaceBeforeBlockStatements: true,
requireSpacesInConditionalExpression: true,
requireSpacesInFunction: {
beforeOpeningCurlyBrace: true
},
requireSpacesInAnonymousFunctionExpression: {
beforeOpeningRoundBrace: true
},
disallowSpacesInNamedFunctionExpression: {
beforeOpeningRoundBrace: true
},
requireMultipleVarDecl: true,
requireBlocksOnNewline: 1,
disallowPaddingNewlinesInBlocks: true,
disallowSpacesInsideArrayBrackets: 'nested',
disallowSpacesInsideParentheses: true,
requireSpacesInsideObjectBrackets: 'all',
disallowQuotedKeysInObjects: 'allButReserved',
disallowSpaceAfterObjectKeys: true,
requireCommaBeforeLineBreak: true,
requireOperatorBeforeLineBreak: true,
disallowSpaceAfterPrefixUnaryOperators: true,
disallowSpaceBeforePostfixUnaryOperators: true,
requireSpaceBeforeBinaryOperators: true,
requireSpaceAfterBinaryOperators: true,
requireCamelCaseOrUpperCaseIdentifiers: true,
disallowKeywords: ['with'],
disallowMultipleLineStrings: true,
disallowMultipleLineBreaks: true,
validateLineBreaks: 'LF',
validateQuoteMarks: {
mark: '\'',
escape: true
},
disallowMixedSpacesAndTabs: true,
disallowTrailingWhitespace: true,
disallowKeywordsOnNewLine: ['else', 'catch'],
requireLineFeedAtFileEnd: true,
maximumLineLength: 120,
requireCapitalizedConstructors: true,
safeContextKeyword: ['_this'],
disallowYodaConditions: true,
validateJSDoc: {
checkParamNames: true,
checkRedundantParams: true,
requireParamTypes: true
},
requireSpaceAfterLineComment: true,
disallowNewlineBeforeBlockStatements: true
};
1 change: 1 addition & 0 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
17 changes: 17 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"bitwise": true,
"eqeqeq": true,
"forin": true,
"freeze": true,
"immed": true,
"latedef": "nofunc",
"noarg": true,
"noempty": true,
"nonbsp": true,
"nonew": true,
"undef": true,
"unused": true,
"node": true,
"expr": true,
"sub": true
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ nodeConfig.addTech(require('enb-ng-techs/techs/ng-annotate'), {
ng-templates
==========

Combines `*.tmpl.html` files by deps wrapping them out with `<script type="text/ng-template">` tag and filename as `id`.
Combines `*.tmpl.html` files wrapping them out with `<script type="text/ng-template">` tag and filename as `id`.
You should fetch this file and compile it in your app using $compile service before any call to templates occurred.

**Опции**
Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@
"bem"
],
"devDependencies": {
"enb": "^0.15.0"
"enb": "^0.15.0",
"jscs": "^1.13.1",
"jshint": "^2.8.0"
},
"dependencies": {
"ng-annotate": "^1.0.0"
},
"scripts": {
"test": "npm run lint",
"lint": "jshint . && jscs -c .jscs.js ."
}
}
6 changes: 3 additions & 3 deletions techs/ng-annotate.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
* ```
*/

var ngAnnotate = require("ng-annotate");
var ngAnnotate = require('ng-annotate');
module.exports = require('enb/lib/build-flow').create()
.name('ng-annotate')
.defineOption('target')
.target('target', '?.js')
.defineRequiredOption('source')
.useSourceText('source')
.builder(function(source){
return ngAnnotate(source, { add : true }).src;
.builder(function (source) {
return ngAnnotate(source, { add: true }).src;
})
.createTech();
2 changes: 1 addition & 1 deletion techs/ng-templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* ng-templates
* ==========
*
* Combines `*.tmpl.html` files by deps wrapping them out with `<script type="text/ng-template">` tag and filename as `id`.
* Combines `*.tmpl.html` files wrapping them out with `<script type="text/ng-template">` tag and filename as `id`.
* You should fetch this file and compile it in your app using $compile service before any call to templates occurred.
*
* **Опции**
Expand Down

0 comments on commit 19f57ec

Please sign in to comment.