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

Commit 29c9262

Browse files
chore(npm): update grunt-jscs to 1.2.0 (jscs to 1.10.0), fix styles
Closes #10772
1 parent 9b6852a commit 29c9262

File tree

8 files changed

+69
-45
lines changed

8 files changed

+69
-45
lines changed

.jscs.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,5 @@
3636
"requireSpacesInFunction": {
3737
"beforeOpeningCurlyBrace": true
3838
},
39-
"validateLineBreaks": "LF",
40-
"validateParameterSeparator": ", "
39+
"validateLineBreaks": "LF"
4140
}

.jscs.json.todo

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// that correct the existing code base issues and make the new check pass.
55

66
{
7+
"validateParameterSeparator": ", ", // Re-assert this rule when JSCS allows multiple spaces
78
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"],
89
"disallowImplicitTypeConversion": ["string"],
910
"disallowMultipleLineBreaks": true,

npm-shrinkwrap.json

+54-30
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"grunt-contrib-jshint": "~0.10.0",
2525
"grunt-ddescribe-iit": "~0.0.1",
2626
"grunt-jasmine-node": "git://github.com/vojtajina/grunt-jasmine-node.git#fix-grunt-exit-code",
27-
"grunt-jscs": "~0.7.1",
27+
"grunt-jscs": "~1.2.0",
2828
"grunt-merge-conflict": "~0.0.1",
2929
"grunt-shell": "~1.1.1",
3030
"gulp": "~3.8.0",

src/Angular.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ function isElement(node) {
627627
function makeMap(str) {
628628
var obj = {}, items = str.split(","), i;
629629
for (i = 0; i < items.length; i++)
630-
obj[ items[i] ] = true;
630+
obj[items[i]] = true;
631631
return obj;
632632
}
633633

src/ngSanitize/sanitize.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -271,14 +271,14 @@ function htmlParser(html, handler) {
271271
}
272272
}
273273
var index, chars, match, stack = [], last = html, text;
274-
stack.last = function() { return stack[ stack.length - 1 ]; };
274+
stack.last = function() { return stack[stack.length - 1]; };
275275

276276
while (html) {
277277
text = '';
278278
chars = true;
279279

280280
// Make sure we're not in a script or style element
281-
if (!stack.last() || !specialElements[ stack.last() ]) {
281+
if (!stack.last() || !specialElements[stack.last()]) {
282282

283283
// Comment
284284
if (html.indexOf("<!--") === 0) {
@@ -360,17 +360,17 @@ function htmlParser(html, handler) {
360360

361361
function parseStartTag(tag, tagName, rest, unary) {
362362
tagName = angular.lowercase(tagName);
363-
if (blockElements[ tagName ]) {
364-
while (stack.last() && inlineElements[ stack.last() ]) {
363+
if (blockElements[tagName]) {
364+
while (stack.last() && inlineElements[stack.last()]) {
365365
parseEndTag("", stack.last());
366366
}
367367
}
368368

369-
if (optionalEndTagElements[ tagName ] && stack.last() == tagName) {
369+
if (optionalEndTagElements[tagName] && stack.last() == tagName) {
370370
parseEndTag("", tagName);
371371
}
372372

373-
unary = voidElements[ tagName ] || !!unary;
373+
unary = voidElements[tagName] || !!unary;
374374

375375
if (!unary)
376376
stack.push(tagName);
@@ -395,13 +395,13 @@ function htmlParser(html, handler) {
395395
if (tagName)
396396
// Find the closest opened tag of the same type
397397
for (pos = stack.length - 1; pos >= 0; pos--)
398-
if (stack[ pos ] == tagName)
398+
if (stack[pos] == tagName)
399399
break;
400400

401401
if (pos >= 0) {
402402
// Close all the open elements, up the stack
403403
for (i = stack.length - 1; i >= pos; i--)
404-
if (handler.end) handler.end(stack[ i ]);
404+
if (handler.end) handler.end(stack[i]);
405405

406406
// Remove the open elements from the stack
407407
stack.length = pos;

test/ng/compileSpec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6065,7 +6065,7 @@ describe('$compile', function() {
60656065
link: function(scope, element, attrs, ctrl, transclude) {
60666066

60676067
// We use timeout here to simulate how ng-if works
6068-
$timeout(function() {
6068+
$timeout(function() {
60696069
transclude(function(child) { element.append(child); });
60706070
});
60716071
}

test/ng/directive/inputSpec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1641,9 +1641,9 @@ describe('input', function() {
16411641
});
16421642
});
16431643

1644-
describe('max', function() {
1644+
describe('max', function() {
16451645

1646-
it('should invalidate', function() {
1646+
it('should invalidate', function() {
16471647
var inputElm = helper.compileInput('<input type="date" ng-model="value" name="alias" max="2019-01-01" />');
16481648
helper.changeInputValueTo('2019-12-31');
16491649
expect(inputElm).toBeInvalid();

0 commit comments

Comments
 (0)