diff --git a/.jscsrc b/.jscsrc new file mode 100644 index 00000000000..285ada95c3e --- /dev/null +++ b/.jscsrc @@ -0,0 +1,58 @@ +{ + "maximumLineLength": { + "value": 140, + "allowComments": true + }, + "requireCurlyBraces": [ + "for", + "do", + "try", + "catch" + ], + "requireSpaceAfterKeywords": [ + "if", + "else", + "for", + "while", + "do", + "switch", + "case", + "return", + "try", + "catch", + "function", + "typeof" + ], + "requireSpaceBeforeBlockStatements": true, + "requireParenthesesAroundIIFE": true, + "requireSpacesInConditionalExpression": true, + "disallowSpacesInNamedFunctionExpression": { + "beforeOpeningRoundBrace": true + }, + "disallowSpacesInFunctionDeclaration": { + "beforeOpeningRoundBrace": true + }, + "requireSpaceBetweenArguments": true, + "disallowMultipleVarDecl": "exceptUndefined", + "disallowEmptyBlocks": true, + "requireCommaBeforeLineBreak": true, + "disallowSpaceAfterPrefixUnaryOperators": true, + "disallowSpaceBeforePostfixUnaryOperators": true, + "disallowSpaceBeforeBinaryOperators": [ + "," + ], + "requireSpacesInForStatement": true, + "requireSpaceBeforeBinaryOperators": true, + "requireSpaceAfterBinaryOperators": true, + "disallowKeywords": [ + "with" + ], + "validateIndentation": 2, + "validateQuoteMarks": { "mark": "'", "escape": true }, + "disallowMixedSpacesAndTabs": true, + "disallowTrailingWhitespace": true, + "requireCapitalizedConstructors": true, + "requireDotNotation": true, + "disallowNewlineBeforeBlockStatements": true, + "disallowMultipleLineStrings": true +} diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 00000000000..8e5b2febb1b --- /dev/null +++ b/.jshintrc @@ -0,0 +1,27 @@ +{ + // for files at project root + "node": true, + + // shared with .jshintrc files for browser and node + "unused": false, + "bitwise": false, + "eqnull": true, + "eqeqeq": true, + "forin": true, + "immed": true, + "expr": true, + "latedef": "nofunc", + "noarg": true, + "noempty": true, + "undef": true, + "quotmark": "single", + "plusplus": false, + "boss": true, + "laxbreak": true, + "laxcomma": true, + "validthis": true, + "sub": true, + "-W084": true, + "scripturl": true, + "evil": true +} diff --git a/.jshintrc.browser b/.jshintrc.browser new file mode 100644 index 00000000000..09cdd36321a --- /dev/null +++ b/.jshintrc.browser @@ -0,0 +1,14 @@ +{ + "extends": "./.jshintrc", + "node": false, + "browser": true, + + "predef": { + // require.js + "define": true, + "require": true, + "console": false, + "-event": true, + "-name": true + } +} diff --git a/.jshintrc.node b/.jshintrc.node new file mode 100644 index 00000000000..a77f81af35e --- /dev/null +++ b/.jshintrc.node @@ -0,0 +1,9 @@ +{ + "extends": "./.jshintrc", + "node": true, + + "globals": { + "Promise": true, + "status": true + } +}