Skip to content

Commit 7d7c86b

Browse files
author
Sérgio Gomes
committed
Updating JSCS and fixing linting errors.
Also removing custom JSCS rule for Closure.
1 parent 76b1fc9 commit 7d7c86b

File tree

5 files changed

+39
-110
lines changed

5 files changed

+39
-110
lines changed

.jscsrc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
{
22
"preset": "google",
3-
"esnext": true,
43
"disallowSpacesInAnonymousFunctionExpression": null,
54
"validateLineBreaks": "LF",
65
"validateIndentation": 2,
76
"excludeFiles": ["node_modules/**"],
87
"maximumLineLength": 130,
98
"validateQuoteMarks": "'",
109
"requireDotNotation": false,
11-
"requireCamelCaseOrUpperCaseIdentifiers": null,
12-
"additionalRules": ["./utils/jscs-rules/*.js", "../utils/jscs-rules/*.js"],
13-
"closureCamelCase": true,
10+
"requireCamelCaseOrUpperCaseIdentifiers": {"allowedPrefixes": ["opt_"]},
1411
"jsDoc": {
1512
"checkAnnotations": {
1613
"preset": "closurecompiler",

gulpfile.babel.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
*/
1919

20-
// jscs:disable jsDoc
20+
// jscs:disable jsDoc
2121

2222
'use strict';
2323

@@ -219,12 +219,12 @@ gulp.task('closure', () => {
219219
compilerPath: 'node_modules/google-closure-compiler/compiler.jar',
220220
fileName: 'material.closure.min.js',
221221
compilerFlags: {
222-
// jscs:disable closureCamelCase
222+
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
223223
compilation_level: 'ADVANCED_OPTIMIZATIONS',
224224
language_in: 'ECMASCRIPT6_STRICT',
225225
language_out: 'ECMASCRIPT5_STRICT',
226226
warning_level: 'VERBOSE'
227-
// jscs:enable closureCamelCase
227+
// jscs:enable requireCamelCaseOrUpperCaseIdentifiers
228228
}
229229
}))
230230
.pipe(gulp.dest('./dist'));

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"gulp-if": "^2.0.0",
3434
"gulp-iife": "^0.3.0",
3535
"gulp-imagemin": "^3.1.0",
36-
"gulp-jscs": "^3.0.1",
36+
"gulp-jscs": "^4.0.0",
3737
"gulp-jshint": "^2.0.4",
3838
"gulp-load-plugins": "^1.3.0",
3939
"gulp-marked": "^1.0.0",

src/third_party/rAF.js

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,42 @@
99
// MIT license
1010

1111
(function() {
12-
'use strict';
12+
'use strict';
1313

14-
if (!Date.now) {
15-
/**
16-
* Date.now polyfill.
17-
* @return {number} the current Date
18-
*/
19-
Date.now = function() { return new Date().getTime(); };
20-
Date['now'] = Date.now;
21-
}
14+
if (!Date.now) {
15+
/**
16+
* Date.now polyfill.
17+
* @return {number} the current Date
18+
*/
19+
Date.now = function() { return new Date().getTime(); };
20+
Date['now'] = Date.now;
21+
}
2222

23-
var vendors = ['webkit', 'moz'];
24-
for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {
25-
var vp = vendors[i];
26-
window.requestAnimationFrame = window[vp + 'RequestAnimationFrame'];
27-
window.cancelAnimationFrame = (window[vp + 'CancelAnimationFrame'] ||
28-
window[vp + 'CancelRequestAnimationFrame']);
29-
window['requestAnimationFrame'] = window.requestAnimationFrame;
30-
window['cancelAnimationFrame'] = window.cancelAnimationFrame;
31-
}
23+
var vendors = ['webkit', 'moz'];
24+
for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {
25+
var vp = vendors[i];
26+
window.requestAnimationFrame = window[vp + 'RequestAnimationFrame'];
27+
window.cancelAnimationFrame = (window[vp + 'CancelAnimationFrame'] ||
28+
window[vp + 'CancelRequestAnimationFrame']);
29+
window['requestAnimationFrame'] = window.requestAnimationFrame;
30+
window['cancelAnimationFrame'] = window.cancelAnimationFrame;
31+
}
3232

33-
if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) || !window.requestAnimationFrame || !window.cancelAnimationFrame) {
34-
var lastTime = 0;
35-
/**
36-
* requestAnimationFrame polyfill.
37-
* @param {!Function} callback the callback function.
38-
*/
39-
window.requestAnimationFrame = function(callback) {
40-
var now = Date.now();
41-
var nextTime = Math.max(lastTime + 16, now);
42-
return setTimeout(function() { callback(lastTime = nextTime); },
43-
nextTime - now);
44-
};
45-
window.cancelAnimationFrame = clearTimeout;
46-
window['requestAnimationFrame'] = window.requestAnimationFrame;
47-
window['cancelAnimationFrame'] = window.cancelAnimationFrame;
48-
}
33+
if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) || !window.requestAnimationFrame || !window.cancelAnimationFrame) {
34+
var lastTime = 0;
35+
/**
36+
* requestAnimationFrame polyfill.
37+
* @param {!Function} callback the callback function.
38+
*/
39+
window.requestAnimationFrame = function(callback) {
40+
var now = Date.now();
41+
var nextTime = Math.max(lastTime + 16, now);
42+
return setTimeout(function() { callback(lastTime = nextTime); },
43+
nextTime - now);
44+
};
45+
window.cancelAnimationFrame = clearTimeout;
46+
window['requestAnimationFrame'] = window.requestAnimationFrame;
47+
window['cancelAnimationFrame'] = window.cancelAnimationFrame;
48+
}
4949

5050
})();

utils/jscs-rules/closure-camel-case.js

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)