Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

chore(jscs): active disallowMultipleLineBreaks rule #11794

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .jscs.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"disallowKeywordsOnNewLine": ["else"],
"disallowMixedSpacesAndTabs": true,
"disallowMultipleLineStrings": true,
"disallowMultipleLineBreaks": true,
"disallowNewlineBeforeBlockStatements": true,
"disallowSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
Expand Down
1 change: 0 additions & 1 deletion .jscs.json.todo
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"validateParameterSeparator": ", ", // Re-assert this rule when JSCS allows multiple spaces
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"],
"disallowImplicitTypeConversion": ["string"],
"disallowMultipleLineBreaks": true,
"validateJSDoc": {
"checkParamNames": true,
"requireParamTypes": true
Expand Down
45 changes: 0 additions & 45 deletions src/Angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ var hasOwnProperty = Object.prototype.hasOwnProperty;
*/
var uppercase = function(string) {return isString(string) ? string.toUpperCase() : string;};


var manualLowercase = function(s) {
/* jshint bitwise: false */
return isString(s)
Expand All @@ -157,7 +156,6 @@ var manualUppercase = function(s) {
: s;
};


// String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish
// locale, for this reason we need to detect this case and redefine lowercase/uppercase methods
// with correct but slower alternatives.
Expand All @@ -166,7 +164,6 @@ if ('i' !== 'I'.toLowerCase()) {
uppercase = manualUppercase;
}


var
msie, // holds major version number for IE, or NaN if UA is not IE.
jqLite, // delay binding since jQuery could be loaded after us.
Expand All @@ -188,7 +185,6 @@ var
*/
msie = document.documentMode;


/**
* @private
* @param {*} obj
Expand Down Expand Up @@ -284,7 +280,6 @@ function forEachSorted(obj, iterator, context) {
return keys;
}


/**
* when using forEach the params are value, key, but it is often useful to have key, value.
* @param {function(string, *)} iteratorFn
Expand All @@ -308,7 +303,6 @@ function nextUid() {
return ++uid;
}


/**
* Set or clear the hashkey for an object.
* @param obj object
Expand All @@ -322,7 +316,6 @@ function setHashKey(obj, h) {
}
}


function baseExtend(dst, objs, deep) {
var h = dst.$$hashKey;

Expand Down Expand Up @@ -369,7 +362,6 @@ function extend(dst) {
return baseExtend(dst, slice.call(arguments, 1), false);
}


/**
* @ngdoc function
* @name angular.merge
Expand All @@ -392,13 +384,10 @@ function merge(dst) {
return baseExtend(dst, slice.call(arguments, 1), true);
}



function toInt(str) {
return parseInt(str, 10);
}


function inherit(parent, extra) {
return extend(Object.create(parent), extra);
}
Expand All @@ -422,7 +411,6 @@ function inherit(parent, extra) {
function noop() {}
noop.$inject = [];


/**
* @ngdoc function
* @name angular.identity
Expand All @@ -444,7 +432,6 @@ noop.$inject = [];
function identity($) {return $;}
identity.$inject = [];


function valueFn(value) {return function() {return value;};}

/**
Expand All @@ -461,7 +448,6 @@ function valueFn(value) {return function() {return value;};}
*/
function isUndefined(value) {return typeof value === 'undefined';}


/**
* @ngdoc function
* @name angular.isDefined
Expand All @@ -476,7 +462,6 @@ function isUndefined(value) {return typeof value === 'undefined';}
*/
function isDefined(value) {return typeof value !== 'undefined';}


/**
* @ngdoc function
* @name angular.isObject
Expand All @@ -495,7 +480,6 @@ function isObject(value) {
return value !== null && typeof value === 'object';
}


/**
* @ngdoc function
* @name angular.isString
Expand All @@ -510,7 +494,6 @@ function isObject(value) {
*/
function isString(value) {return typeof value === 'string';}


/**
* @ngdoc function
* @name angular.isNumber
Expand All @@ -531,7 +514,6 @@ function isString(value) {return typeof value === 'string';}
*/
function isNumber(value) {return typeof value === 'number';}


/**
* @ngdoc function
* @name angular.isDate
Expand All @@ -548,7 +530,6 @@ function isDate(value) {
return toString.call(value) === '[object Date]';
}


/**
* @ngdoc function
* @name angular.isArray
Expand Down Expand Up @@ -577,7 +558,6 @@ var isArray = Array.isArray;
*/
function isFunction(value) {return typeof value === 'function';}


/**
* Determines if a value is a regular expression object.
*
Expand All @@ -589,7 +569,6 @@ function isRegExp(value) {
return toString.call(value) === '[object RegExp]';
}


/**
* Checks if `obj` is a window object.
*
Expand All @@ -601,43 +580,35 @@ function isWindow(obj) {
return obj && obj.window === obj;
}


function isScope(obj) {
return obj && obj.$evalAsync && obj.$watch;
}


function isFile(obj) {
return toString.call(obj) === '[object File]';
}


function isFormData(obj) {
return toString.call(obj) === '[object FormData]';
}


function isBlob(obj) {
return toString.call(obj) === '[object Blob]';
}


function isBoolean(value) {
return typeof value === 'boolean';
}


function isPromiseLike(obj) {
return obj && isFunction(obj.then);
}


var TYPED_ARRAY_REGEXP = /^\[object (Uint8(Clamped)?)|(Uint16)|(Uint32)|(Int8)|(Int16)|(Int32)|(Float(32)|(64))Array\]$/;
function isTypedArray(value) {
return TYPED_ARRAY_REGEXP.test(toString.call(value));
}


var trim = function(value) {
return isString(value) ? value.trim() : value;
};
Expand All @@ -650,7 +621,6 @@ var escapeForRegexp = function(s) {
replace(/\x08/g, '\\x08');
};


/**
* @ngdoc function
* @name angular.isElement
Expand Down Expand Up @@ -681,7 +651,6 @@ function makeMap(str) {
return obj;
}


function nodeName_(element) {
return lowercase(element.nodeName || (element[0] && element[0].nodeName));
}
Expand Down Expand Up @@ -860,7 +829,6 @@ function shallowCopy(src, dst) {
return dst || src;
}


/**
* @ngdoc function
* @name angular.equals
Expand Down Expand Up @@ -1012,7 +980,6 @@ function sliceArgs(args, startIndex) {
return slice.call(args, startIndex || 0);
}


/* jshint -W101 */
/**
* @ngdoc function
Expand Down Expand Up @@ -1052,7 +1019,6 @@ function bind(self, fn) {
}
}


function toJsonReplacer(key, value) {
var val = value;

Expand All @@ -1069,7 +1035,6 @@ function toJsonReplacer(key, value) {
return val;
}


/**
* @ngdoc function
* @name angular.toJson
Expand All @@ -1093,7 +1058,6 @@ function toJson(obj, pretty) {
return JSON.stringify(obj, toJsonReplacer, pretty);
}


/**
* @ngdoc function
* @name angular.fromJson
Expand All @@ -1112,27 +1076,23 @@ function fromJson(json) {
: json;
}


function timezoneToOffset(timezone, fallback) {
var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;
return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;
}


function addDateMinutes(date, minutes) {
date = new Date(date.getTime());
date.setMinutes(date.getMinutes() + minutes);
return date;
}


function convertTimezoneToLocal(date, timezone, reverse) {
reverse = reverse ? -1 : 1;
var timezoneOffset = timezoneToOffset(timezone, date.getTimezoneOffset());
return addDateMinutes(date, reverse * (timezoneOffset - date.getTimezoneOffset()));
}


/**
* @returns {string} Returns the string representation of the element.
*/
Expand All @@ -1155,7 +1115,6 @@ function startingTag(element) {

}


/////////////////////////////////////////////////

/**
Expand All @@ -1174,7 +1133,6 @@ function tryDecodeURIComponent(value) {
}
}


/**
* Parses an escaped url query string into key-value pairs.
* @returns {Object.<string,boolean|Array>}
Expand Down Expand Up @@ -1216,7 +1174,6 @@ function toKeyValue(obj) {
return parts.length ? parts.join('&') : '';
}


/**
* We need our custom method because encodeURIComponent is too aggressive and doesn't follow
* http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path
Expand All @@ -1235,7 +1192,6 @@ function encodeUriSegment(val) {
replace(/%2B/gi, '+');
}


/**
* This method is intended for encoding *key* or *value* parts of query component. We need a custom
* method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be
Expand Down Expand Up @@ -1721,7 +1677,6 @@ function getBlockNodes(nodes) {
return jqLite(blockNodes);
}


/**
* Creates a new object without a prototype. This object is useful for lookup without having to
* guard against prototypically inherited properties via hasOwnProperty.
Expand Down
2 changes: 0 additions & 2 deletions src/AngularPublic.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
$$CookieReaderProvider
*/


/**
* @ngdoc object
* @name angular.version
Expand All @@ -116,7 +115,6 @@ var version = {
codeName: '"NG_VERSION_CODENAME"'
};


function publishExternalAPI(angular) {
extend(angular, {
'bootstrap': bootstrap,
Expand Down
1 change: 0 additions & 1 deletion src/apis.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';


/**
* Computes a hash of an 'obj'.
* Hash of a:
Expand Down
Loading