From 19f57ec030b71a8ee6bbccc36006c5752bdb95a3 Mon Sep 17 00:00:00 2001 From: Alexey Gurianov Date: Fri, 5 Jun 2015 17:24:33 +0400 Subject: [PATCH] jshint and jscs config files added added config files to configure hinting and style guides test and lint npm tasks tech edits according jscs highlights --- .editorconfig | 12 ++++++++++ .jscs.js | 55 +++++++++++++++++++++++++++++++++++++++++++ .jshintignore | 1 + .jshintrc | 17 +++++++++++++ README.md | 2 +- package.json | 8 ++++++- techs/ng-annotate.js | 6 ++--- techs/ng-templates.js | 2 +- 8 files changed, 97 insertions(+), 6 deletions(-) create mode 100644 .editorconfig create mode 100644 .jscs.js create mode 100644 .jshintignore create mode 100644 .jshintrc diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..4636b9c --- /dev/null +++ b/.editorconfig @@ -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 diff --git a/.jscs.js b/.jscs.js new file mode 100644 index 0000000..d70a66a --- /dev/null +++ b/.jscs.js @@ -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 +}; diff --git a/.jshintignore b/.jshintignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.jshintignore @@ -0,0 +1 @@ +node_modules diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..e390752 --- /dev/null +++ b/.jshintrc @@ -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 +} diff --git a/README.md b/README.md index 538f277..ff17917 100644 --- a/README.md +++ b/README.md @@ -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 `