Skip to content

Commit 835d06a

Browse files
committed
add editorconfig & jshintrc
1 parent 6708bb0 commit 835d06a

File tree

2 files changed

+104
-0
lines changed

2 files changed

+104
-0
lines changed

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
11+
# 4 space indentation
12+
[*.js]
13+
indent_style = space
14+
indent_size = 2
15+
16+
17+
# Indentation override for all JS under lib directory
18+
#[lib/**.js]
19+
#indent_style = space
20+
#indent_size = 2

.jshintrc

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"maxerr" : 50, // {int} Maximum error before stopping
3+
4+
// Enforcing
5+
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
6+
"camelcase" : false, // true: Identifiers must be in camelCase
7+
"curly" : true, // true: Require {} for every new block or scope
8+
"eqeqeq" : true, // true: Require triple equals (===) for comparison
9+
"forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
10+
"immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
11+
"indent" : 2, // {int} Number of spaces to use for indentation
12+
"latedef" : false, // true: Require variables/functions to be defined before being used
13+
"newcap" : false, // true: Require capitalization of all constructor functions e.g. `new F()`
14+
"noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
15+
"noempty" : true, // true: Prohibit use of empty blocks
16+
"nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment)
17+
"plusplus" : false, // true: Prohibit use of `++` & `--`
18+
"quotmark" : false, // Quotation mark consistency:
19+
// false : do nothing (default)
20+
// true : ensure whatever is used is consistent
21+
// "single" : require single quotes
22+
// "double" : require double quotes
23+
"undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
24+
"unused" : true, // true: Require all defined variables be used
25+
"strict" : false, // true: Requires all functions run in ES5 Strict Mode
26+
"trailing" : false, // true: Prohibit trailing whitespaces
27+
"maxparams" : 5, // {int} Max number of formal params allowed per function
28+
"maxdepth" : 4, // {int} Max depth of nested blocks (within functions)
29+
"maxstatements" : 25, // {int} Max number statements per function
30+
"maxcomplexity" : 7, // {int} Max cyclomatic complexity per function
31+
"maxlen" : false, // {int} Max number of characters per line
32+
33+
// Relaxing
34+
"asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
35+
"boss" : false, // true: Tolerate assignments where comparisons would be expected
36+
"debug" : false, // true: Allow debugger statements e.g. browser breakpoints.
37+
"eqnull" : false, // true: Tolerate use of `== null`
38+
"es5" : false, // true: Allow ES5 syntax (ex: getters and setters)
39+
"esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`)
40+
"moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
41+
// (ex: `for each`, multiple try/catch, function expression…)
42+
"evil" : false, // true: Tolerate use of `eval` and `new Function()`
43+
"expr" : false, // true: Tolerate `ExpressionStatement` as Programs
44+
"funcscope" : false, // true: Tolerate defining variables inside control statements"
45+
"globalstrict" : false, // true: Allow global "use strict" (also enables 'strict')
46+
"iterator" : false, // true: Tolerate using the `__iterator__` property
47+
"lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
48+
"laxbreak" : false, // true: Tolerate possibly unsafe line breakings
49+
"laxcomma" : true, // true: Tolerate comma-first style coding
50+
"loopfunc" : false, // true: Tolerate functions being defined in loops
51+
"multistr" : true, // true: Tolerate multi-line strings
52+
"proto" : false, // true: Tolerate using the `__proto__` property
53+
"scripturl" : false, // true: Tolerate script-targeted URLs
54+
"smarttabs" : false, // true: Tolerate mixed tabs/spaces when used for alignment
55+
"shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
56+
"sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
57+
"supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;`
58+
"validthis" : false, // true: Tolerate using this in a non-constructor function
59+
60+
// Environments
61+
"browser" : true, // Web Browser (window, document, etc)
62+
"couch" : false, // CouchDB
63+
"devel" : true, // Development/debugging (alert, confirm, etc)
64+
"dojo" : false, // Dojo Toolkit
65+
"jquery" : false, // jQuery
66+
"mootools" : false, // MooTools
67+
"node" : true, // Node.js
68+
"mocha" : true, // Mocha
69+
"nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
70+
"prototypejs" : false, // Prototype and Scriptaculous
71+
"rhino" : false, // Rhino
72+
"worker" : false, // Web Workers
73+
"wsh" : false, // Windows Scripting Host
74+
"yui" : false, // Yahoo User Interface
75+
76+
// Legacy
77+
"nomen" : false, // true: Prohibit dangling `_` in variables
78+
"onevar" : false, // true: Allow only one `var` statement per function
79+
"passfail" : false, // true: Stop on first error
80+
"white" : false, // true: Check against strict whitespace and indentation rules
81+
82+
// Custom Globals
83+
"predef" : [] // additional predefined global variables
84+
}

0 commit comments

Comments
 (0)