Skip to content

Commit 52a090e

Browse files
committed
update jscs
1 parent 4c1d5a6 commit 52a090e

File tree

5 files changed

+102
-16
lines changed

5 files changed

+102
-16
lines changed

.jscsrc

+94-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,95 @@
11
{
2-
"preset": "google",
3-
"excludeFiles": [
4-
"*.js",
5-
"tests/**/assets",
6-
"node_modules/**"
7-
]
8-
}
2+
"excludeFiles": [
3+
"*.js",
4+
"tests/**/assets",
5+
"node_modules/**"
6+
],
7+
"requireCurlyBraces": [
8+
"if",
9+
"else",
10+
"for",
11+
"while",
12+
"do",
13+
"try",
14+
"catch"
15+
],
16+
"requireOperatorBeforeLineBreak": true,
17+
"requireCamelCaseOrUpperCaseIdentifiers": true,
18+
"maximumLineLength": {
19+
"value": 120,
20+
"allowComments": true,
21+
"allowRegex": true
22+
},
23+
"validateIndentation": 4,
24+
"validateQuoteMarks": "'",
25+
"disallowMultipleLineStrings": true,
26+
"disallowMixedSpacesAndTabs": true,
27+
"disallowTrailingWhitespace": true,
28+
"disallowSpaceAfterPrefixUnaryOperators": true,
29+
"requireSpaceAfterKeywords": [
30+
"if",
31+
"else",
32+
"for",
33+
"while",
34+
"do",
35+
"switch",
36+
"return",
37+
"try",
38+
"catch"
39+
],
40+
"requireSpaceBeforeBinaryOperators": [
41+
"=",
42+
"+=",
43+
"-=",
44+
"*=",
45+
"/=",
46+
"%=",
47+
"<<=",
48+
">>=",
49+
">>>=",
50+
"&=",
51+
"|=",
52+
"^=",
53+
"+=",
54+
"+",
55+
"-",
56+
"*",
57+
"/",
58+
"%",
59+
"<<",
60+
">>",
61+
">>>",
62+
"&",
63+
"|",
64+
"^",
65+
"&&",
66+
"||",
67+
"===",
68+
"==",
69+
">=",
70+
"<=",
71+
"<",
72+
">",
73+
"!=",
74+
"!=="
75+
],
76+
"requireSpaceAfterBinaryOperators": true,
77+
"requireSpacesInConditionalExpression": true,
78+
"requireSpaceBeforeBlockStatements": true,
79+
"requireLineFeedAtFileEnd": true,
80+
"requireSpacesInFunctionExpression": {
81+
"beforeOpeningCurlyBrace": true
82+
},
83+
"disallowSpacesInAnonymousFunctionExpression": {
84+
"beforeOpeningRoundBrace": true
85+
},
86+
"disallowSpacesInsideObjectBrackets": "all",
87+
"disallowSpacesInsideArrayBrackets": "all",
88+
"disallowSpacesInsideParentheses": true,
89+
"validateJSDoc": {
90+
"checkParamNames": true,
91+
"requireParamTypes": true
92+
},
93+
"disallowMultipleLineBreaks": true,
94+
"disallowNewlineBeforeBlockStatements": true
95+
}

Gruntfile.coffee

+1-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ module.exports = (grunt) ->
8181
jscs:
8282
src: [
8383
'src/**/*.js'
84-
'tests/unit/*.js'
8584
]
8685
options:
8786
config: "./.jscsrc"
@@ -113,7 +112,7 @@ module.exports = (grunt) ->
113112
grunt.loadNpmTasks 'grunt-contrib-connect'
114113
grunt.loadNpmTasks 'grunt-string-replace'
115114
grunt.loadNpmTasks 'grunt-banner'
116-
grunt.loadNpmTasks 'grunt-jscs-checker'
115+
grunt.loadNpmTasks 'grunt-jscs'
117116

118117
# Default task(s)
119118
grunt.registerTask 'default', ['connect', 'watch']

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"grunt-contrib-qunit": "^0.5.1",
3636
"grunt-contrib-uglify": "0.4.x",
3737
"grunt-contrib-watch": "0.6.x",
38-
"grunt-jscs-checker": "^0.4.1",
38+
"grunt-jscs": "^0.8.0",
3939
"grunt-string-replace": "^0.2.7",
4040
"jquery-hammerjs": "2.0.x",
4141
"hammer-simulator": "git://github.com/hammerjs/simulator#master"

src/hammer.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ Hammer.defaults = {
6565
*/
6666
preset: [
6767
// RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
68-
[RotateRecognizer, { enable: false }],
69-
[PinchRecognizer, { enable: false }, ['rotate']],
70-
[SwipeRecognizer,{ direction: DIRECTION_HORIZONTAL }],
71-
[PanRecognizer, { direction: DIRECTION_HORIZONTAL }, ['swipe']],
68+
[RotateRecognizer, {enable: false}],
69+
[PinchRecognizer, {enable: false}, ['rotate']],
70+
[SwipeRecognizer, {direction: DIRECTION_HORIZONTAL}],
71+
[PanRecognizer, {direction: DIRECTION_HORIZONTAL}, ['swipe']],
7272
[TapRecognizer],
73-
[TapRecognizer, { event: 'doubletap', taps: 2 }, ['tap']],
73+
[TapRecognizer, {event: 'doubletap', taps: 2}, ['tap']],
7474
[PressRecognizer]
7575
],
7676

src/recognizers/tap.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ inherit(TapRecognizer, Recognizer, {
106106
},
107107

108108
emit: function() {
109-
if (this.state == STATE_RECOGNIZED ) {
109+
if (this.state == STATE_RECOGNIZED) {
110110
this._input.tapCount = this.count;
111111
this.manager.emit(this.options.event, this._input);
112112
}

0 commit comments

Comments
 (0)