Permalink
Browse files

Use JSCS to check the coding style.

  • Loading branch information...
1 parent 71ea017 commit d12bf46c414e69157ee2f3f8036357031e17f45d @ariya committed Feb 5, 2014
Showing with 127 additions and 1 deletion.
  1. +119 −0 .jscs.json
  2. +8 −1 package.json
View
@@ -0,0 +1,119 @@
+{
+ "requireCurlyBraces": [
+ "if",
+ "else",
+ "for",
+ "while",
+ "do",
+ "try",
+ "catch"
+ ],
+ "requireSpaceAfterKeywords": [
+ "if",
+ "else",
+ "for",
+ "while",
+ "do",
+ "switch",
+ "return",
+ "try",
+ "catch"
+ ],
+ "requireParenthesesAroundIIFE": true,
+ "requireSpacesInFunctionExpression": {
+ "beforeOpeningCurlyBrace": true
+ },
+ "requireMultipleVarDecl": true,
+ "disallowEmptyBlocks": true,
+ "disallowSpacesInsideObjectBrackets": true,
+ "disallowSpacesInsideParentheses": true,
+ "requireSpacesInsideObjectBrackets": "all",
+ "disallowDanglingUnderscores": true,
+ "disallowSpaceAfterObjectKeys": true,
+ "requireCommaBeforeLineBreak": true,
+ "requireOperatorBeforeLineBreak": [
+ "?",
+ "+",
+ "-",
+ "/",
+ "*",
+ "=",
+ "==",
+ "===",
+ "!=",
+ "!==",
+ ">",
+ ">=",
+ "<",
+ "<="
+ ],
+ "disallowLeftStickedOperators": [
+ "?",
+ "+",
+ "-",
+ "/",
+ "*",
+ "=",
+ "==",
+ "===",
+ "!=",
+ "!==",
+ ">",
+ ">=",
+ "<",
+ "<="
+ ],
+ "requireRightStickedOperators": ["!"],
+ "disallowRightStickedOperators": [
+ "?",
+ "+",
+ "/",
+ "*",
+ ":",
+ "=",
+ "==",
+ "===",
+ "!=",
+ "!==",
+ ">",
+ ">=",
+ "<",
+ "<="
+ ],
+ "requireLeftStickedOperators": [","],
+ "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
+ "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
+ "requireSpaceBeforeBinaryOperators": [
+ "+",
+ "-",
+ "/",
+ "*",
+ "=",
+ "==",
+ "===",
+ "!=",
+ "!=="
+ ],
+ "requireSpaceAfterBinaryOperators": [
+ "+",
+ "-",
+ "/",
+ "*",
+ "=",
+ "==",
+ "===",
+ "!=",
+ "!=="
+ ],
+ "disallowImplicitTypeConversion": ["numeric", "boolean", "binary", "string"],
+ "requireCamelCaseOrUpperCaseIdentifiers": true,
+ "disallowKeywords": ["with"],
+ "disallowMultipleLineStrings": true,
+ "validateLineBreaks": "LF",
+ "validateQuoteMarks": "'",
+ "disallowMixedSpacesAndTabs": true,
+ "disallowTrailingWhitespace": true,
+ "disallowKeywordsOnNewLine": ["else"],
+ "requireLineFeedAtFileEnd": true,
+ "requireDotNotation": true
+}
View
@@ -30,6 +30,7 @@
"devDependencies": {
"jslint": "~0.1.9",
"eslint": "~0.3.0",
+ "jscs": "~1.2.4",
"istanbul": "~0.1.27",
"complexity-report": "~0.6.1",
"regenerate": "~0.5.4",
@@ -48,7 +49,13 @@
"generate-regex": "node tools/generate-identifier-regex.js",
"test": "npm run-script lint && node test/run.js && npm run-script coverage && npm run-script complexity",
- "lint": "node tools/check-version.js && node node_modules/eslint/bin/eslint.js esprima.js && node node_modules/jslint/bin/jslint.js esprima.js",
+
+ "lint": "npm run-script check-version && npm run-script eslint && npm run-script jscs && npm run-script jslint",
+ "check-version": "node tools/check-version.js",
+ "eslint": "node node_modules/eslint/bin/eslint.js esprima.js",
+ "jscs": "node node_modules/.bin/jscs esprima.js",
+ "jslint": "node node_modules/jslint/bin/jslint.js esprima.js",
+
"coverage": "npm run-script analyze-coverage && npm run-script check-coverage",
"analyze-coverage": "node node_modules/istanbul/lib/cli.js cover test/runner.js",
"check-coverage": "node node_modules/istanbul/lib/cli.js check-coverage --statement -8 --branch -19 --function 100",

0 comments on commit d12bf46

Please sign in to comment.