-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add eslint and jscs linters. Fix linting errors.
- Loading branch information
1 parent
9ef585d
commit 4bd8914
Showing
16 changed files
with
243 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"amd": true, | ||
"node": true | ||
}, | ||
|
||
"globals": { | ||
"define": false, | ||
"require": true, | ||
|
||
"alert": true, | ||
"console": true, | ||
"module": true, | ||
|
||
"describe": true, | ||
"it": true, | ||
"before": true, | ||
"beforeEach": true, | ||
"after": true, | ||
"afterEach": true, | ||
"expect": true, | ||
"should": true, | ||
|
||
"Promise": true, // allow possibly overwriting Promise | ||
}, | ||
|
||
"rules": { | ||
"dot-notation": 0, // allow obj['somePropertyName'] | ||
"new-cap": 0, // do not require 'new' keyword, allows i.e. "var promise = $.Deferred()" | ||
"no-alert": 0, // disencourage alert() and confirm() | ||
"no-console": 0, | ||
"no-mixed-spaces-and-tabs": 1, | ||
"semi-spacing": [2, {"before": false, "after": true}], | ||
"no-spaced-func": 1, | ||
"no-undef": 1, | ||
"no-shadow": 1, | ||
"no-trailing-spaces": 1, | ||
"no-extra-parens": 1, | ||
"no-underscore-dangle": 0, // allow _variableName | ||
"no-new": 0, | ||
"no-nested-ternary": 1, | ||
"no-process-exit": 0, | ||
|
||
// requires local variable names to be used, but allows unused arguments | ||
"no-unused-vars": [2, { "vars": "all", "args": "none" }], | ||
"no-use-before-define": 0, | ||
|
||
// disable requirements for strict spacing rules in object properties or assignments | ||
"key-spacing": 0, | ||
"no-multi-spaces": 0, | ||
|
||
"quotes": 0, // allow both single and double quotes | ||
"space-after-keywords": 1, | ||
"space-infix-ops": 1, | ||
"space-return-throw-case": 1, | ||
"strict": 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"disallowImplicitTypeConversion": ["string"], | ||
"disallowMixedSpacesAndTabs": true, | ||
"disallowMultipleLineBreaks": true, | ||
"disallowMultipleVarDecl": true, | ||
"disallowNewlineBeforeBlockStatements": true, | ||
"disallowMultipleLineStrings": true, | ||
"disallowMultipleVarDecl": null, | ||
"disallowSpaceAfterPrefixUnaryOperators": true, | ||
"disallowSpacesInAnonymousFunctionExpression": { | ||
"beforeOpeningRoundBrace": true | ||
}, | ||
"disallowSpacesInsideObjectBrackets": null, | ||
"disallowSpacesInsideArrayBrackets": "all", | ||
"disallowSpacesInsideParentheses": true, | ||
"disallowTrailingWhitespace": true, | ||
|
||
"maximumLineLength": { | ||
"value": 100, | ||
"allowComments": true, | ||
"allowRegex": true | ||
}, | ||
|
||
"fileExtensions": [".js", ".jsx"], | ||
|
||
"requireCamelCaseOrUpperCaseIdentifiers": true, | ||
"requireCommaBeforeLineBreak": true, | ||
"requireCurlyBraces": [ | ||
"if", | ||
"else", | ||
"for", | ||
"while", | ||
"do", | ||
"try", | ||
"catch" | ||
], | ||
"requireSpaceAfterBinaryOperators": true, | ||
"requireSpaceAfterKeywords": [ | ||
"do", | ||
"for", | ||
"if", | ||
"else", | ||
"switch", | ||
"case", | ||
"try", | ||
"catch", | ||
"void", | ||
"while", | ||
"with", | ||
"return", | ||
"typeof" | ||
], | ||
"requireSpaceBeforeBinaryOperators": [ | ||
"=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", | ||
"&=", "|=", "^=", "+=", | ||
|
||
"+", "-", "*", "/", "%", "<<", ">>", ">>>", "&", | ||
"|", "^", "&&", "||", "===", "==", ">=", | ||
"<=", "<", ">", "!=", "!==" | ||
], | ||
"requireSpacesInConditionalExpression": true, | ||
"requireSpaceBeforeBlockStatements": true, | ||
"requireSpacesInForStatement": true, | ||
"requireLineFeedAtFileEnd": true, | ||
"requireSpacesInFunctionExpression": { | ||
"beforeOpeningCurlyBrace": true | ||
}, | ||
|
||
"validateLineBreaks": "LF", | ||
"validateIndentation": 4, | ||
"validateQuoteMarks": { | ||
"mark": "'", "escape": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.