Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 7ee1ede

Browse files
author
fractaltheory
committed
Revert "Remove JSCS/JSHint rule configurations"
This reverts commit 6ed7dd9.
1 parent f2784e7 commit 7ee1ede

2 files changed

Lines changed: 93 additions & 0 deletions

File tree

javascript/.jscsrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"disallowEmptyBlocks": true,
3+
"disallowKeywords": ["with"],
4+
"disallowMixedSpacesAndTabs": true,
5+
"disallowMultipleLineStrings": true,
6+
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
7+
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
8+
"disallowTrailingWhitespace": true,
9+
"requireCamelCaseOrUpperCaseIdentifiers": true,
10+
"disallowSpaceBeforeBinaryOperators": [","],
11+
"requireLineFeedAtFileEnd": true,
12+
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="],
13+
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
14+
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="],
15+
"requireSpacesInConditionalExpression": true,
16+
"requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true },
17+
"validateIndentation": 4,
18+
"validateLineBreaks": "LF",
19+
"validateQuoteMarks": "'"
20+
}

javascript/.jshintrc

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
// JSHint options
3+
// http://www.jshint.com/docs/options/
4+
5+
// Environments
6+
// ------------
7+
//
8+
"predef": [ "Mobify", "define", "require", "Zepto", "Adaptive" ],
9+
"node": true,
10+
"browser": true,
11+
"jquery": true,
12+
"devel": "console",
13+
14+
// Enforcing options
15+
// -----------------
16+
//
17+
// Setting to true ENABLES a check
18+
19+
// Enforce === instead of ==
20+
"eqeqeq": true,
21+
// Force hasOwnProperty checks within `for in`
22+
"forin": true,
23+
// Prohibits overwriting native types like `Array` or `Date`
24+
"freeze": true,
25+
// Immediate invocations must be wrapped in parentheses
26+
"immed": true,
27+
// Tab width
28+
"indent": 4,
29+
// Prevents usage of a variable before declaration, but functions can be
30+
// used before declaration
31+
"latedef": "nofunc",
32+
// Capitalize constructor functions
33+
"newcap": true,
34+
// Prevent arguments.callee and arguments.caller
35+
"noarg": true,
36+
// Warn when you have empty blocks in code
37+
"noempty": true,
38+
// Warns about non-breaking space
39+
"nonbsp": true,
40+
"quotmark": "single",
41+
// Warn about using undeclared variables
42+
"undef": true,
43+
// Warn about declaring but not using variables
44+
// Disabled to prevent errors about unused function variables
45+
"unused": false,
46+
// Enforce 'use strict;' in functions to force functions to run in ECMA5
47+
// script mode
48+
"strict": false,
49+
// Prevents leaving trailing whitespace in code
50+
"trailing": true,
51+
// Maximum formal parameters per function
52+
"maxparams": 10,
53+
// Maximum nesting depth
54+
"maxdepth": 5,
55+
// Maximum statements per function
56+
"maxstatements": 25,
57+
// Enforce reducing cyclomatic complexity
58+
// (http://en.wikipedia.org/wiki/Cyclomatic_complexity)
59+
"maxcomplexity": false,
60+
61+
"maxlen": 1000,
62+
63+
// Relaxing options
64+
// ----------------
65+
//
66+
// Setting to true DISABLES a check
67+
68+
// Don't enforce semi-colons
69+
"asi": false,
70+
// Allow expression statements, like `typeof x !== 'undefined' && x.hello()`
71+
// instead of requiring function calls
72+
"expr": true
73+
}

0 commit comments

Comments
 (0)