Skip to content

Commit

Permalink
Updating JSCS and fixing linting errors.
Browse files Browse the repository at this point in the history
Also removing custom JSCS rule for Closure.
  • Loading branch information
Sérgio Gomes committed Dec 15, 2016
1 parent 76b1fc9 commit 7d7c86b
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 110 deletions.
5 changes: 1 addition & 4 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
{
"preset": "google",
"esnext": true,
"disallowSpacesInAnonymousFunctionExpression": null,
"validateLineBreaks": "LF",
"validateIndentation": 2,
"excludeFiles": ["node_modules/**"],
"maximumLineLength": 130,
"validateQuoteMarks": "'",
"requireDotNotation": false,
"requireCamelCaseOrUpperCaseIdentifiers": null,
"additionalRules": ["./utils/jscs-rules/*.js", "../utils/jscs-rules/*.js"],
"closureCamelCase": true,
"requireCamelCaseOrUpperCaseIdentifiers": {"allowedPrefixes": ["opt_"]},
"jsDoc": {
"checkAnnotations": {
"preset": "closurecompiler",
Expand Down
6 changes: 3 additions & 3 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
*/

// jscs:disable jsDoc
// jscs:disable jsDoc

'use strict';

Expand Down Expand Up @@ -219,12 +219,12 @@ gulp.task('closure', () => {
compilerPath: 'node_modules/google-closure-compiler/compiler.jar',
fileName: 'material.closure.min.js',
compilerFlags: {
// jscs:disable closureCamelCase
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
compilation_level: 'ADVANCED_OPTIMIZATIONS',
language_in: 'ECMASCRIPT6_STRICT',
language_out: 'ECMASCRIPT5_STRICT',
warning_level: 'VERBOSE'
// jscs:enable closureCamelCase
// jscs:enable requireCamelCaseOrUpperCaseIdentifiers
}
}))
.pipe(gulp.dest('./dist'));
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"gulp-if": "^2.0.0",
"gulp-iife": "^0.3.0",
"gulp-imagemin": "^3.1.0",
"gulp-jscs": "^3.0.1",
"gulp-jscs": "^4.0.0",
"gulp-jshint": "^2.0.4",
"gulp-load-plugins": "^1.3.0",
"gulp-marked": "^1.0.0",
Expand Down
68 changes: 34 additions & 34 deletions src/third_party/rAF.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,42 @@
// MIT license

(function() {
'use strict';
'use strict';

if (!Date.now) {
/**
* Date.now polyfill.
* @return {number} the current Date
*/
Date.now = function() { return new Date().getTime(); };
Date['now'] = Date.now;
}
if (!Date.now) {
/**
* Date.now polyfill.
* @return {number} the current Date
*/
Date.now = function() { return new Date().getTime(); };
Date['now'] = Date.now;
}

var vendors = ['webkit', 'moz'];
for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {
var vp = vendors[i];
window.requestAnimationFrame = window[vp + 'RequestAnimationFrame'];
window.cancelAnimationFrame = (window[vp + 'CancelAnimationFrame'] ||
window[vp + 'CancelRequestAnimationFrame']);
window['requestAnimationFrame'] = window.requestAnimationFrame;
window['cancelAnimationFrame'] = window.cancelAnimationFrame;
}
var vendors = ['webkit', 'moz'];
for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {
var vp = vendors[i];
window.requestAnimationFrame = window[vp + 'RequestAnimationFrame'];
window.cancelAnimationFrame = (window[vp + 'CancelAnimationFrame'] ||
window[vp + 'CancelRequestAnimationFrame']);
window['requestAnimationFrame'] = window.requestAnimationFrame;
window['cancelAnimationFrame'] = window.cancelAnimationFrame;
}

if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) || !window.requestAnimationFrame || !window.cancelAnimationFrame) {
var lastTime = 0;
/**
* requestAnimationFrame polyfill.
* @param {!Function} callback the callback function.
*/
window.requestAnimationFrame = function(callback) {
var now = Date.now();
var nextTime = Math.max(lastTime + 16, now);
return setTimeout(function() { callback(lastTime = nextTime); },
nextTime - now);
};
window.cancelAnimationFrame = clearTimeout;
window['requestAnimationFrame'] = window.requestAnimationFrame;
window['cancelAnimationFrame'] = window.cancelAnimationFrame;
}
if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) || !window.requestAnimationFrame || !window.cancelAnimationFrame) {
var lastTime = 0;
/**
* requestAnimationFrame polyfill.
* @param {!Function} callback the callback function.
*/
window.requestAnimationFrame = function(callback) {
var now = Date.now();
var nextTime = Math.max(lastTime + 16, now);
return setTimeout(function() { callback(lastTime = nextTime); },
nextTime - now);
};
window.cancelAnimationFrame = clearTimeout;
window['requestAnimationFrame'] = window.requestAnimationFrame;
window['cancelAnimationFrame'] = window.cancelAnimationFrame;
}

})();
68 changes: 0 additions & 68 deletions utils/jscs-rules/closure-camel-case.js

This file was deleted.

0 comments on commit 7d7c86b

Please sign in to comment.