diff --git a/lib/js-yaml/loader.js b/lib/js-yaml/loader.js index 456133da..9188da1f 100644 --- a/lib/js-yaml/loader.js +++ b/lib/js-yaml/loader.js @@ -86,6 +86,7 @@ function fromDecimalCode(c) { } function simpleEscapeSequence(c) { + /* eslint-disable indent */ return (c === 0x30/* 0 */) ? '\x00' : (c === 0x61/* a */) ? '\x07' : (c === 0x62/* b */) ? '\x08' : @@ -112,8 +113,10 @@ function charFromCodepoint(c) { } // Encode UTF-16 surrogate pair // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF - return String.fromCharCode(((c - 0x010000) >> 10) + 0xD800, - ((c - 0x010000) & 0x03FF) + 0xDC00); + return String.fromCharCode( + ((c - 0x010000) >> 10) + 0xD800, + ((c - 0x010000) & 0x03FF) + 0xDC00 + ); } var simpleEscapeCheck = new Array(256); // integer, for fast access @@ -245,9 +248,7 @@ function captureSegment(state, start, end, checkJson) { _result = state.input.slice(start, end); if (checkJson) { - for (_position = 0, _length = _result.length; - _position < _length; - _position += 1) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { _character = _result.charCodeAt(_position); if (!(_character === 0x09 || (0x20 <= _character && _character <= 0x10FFFF))) { @@ -1365,9 +1366,7 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact if (state.tag !== null && state.tag !== '!') { if (state.tag === '?') { - for (typeIndex = 0, typeQuantity = state.implicitTypes.length; - typeIndex < typeQuantity; - typeIndex += 1) { + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { type = state.implicitTypes[typeIndex]; // Implicit resolving is not allowed for non-scalar types, and '?' diff --git a/package.json b/package.json index 2965b33e..16b090d8 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "benchmark": "^2.1.4", "browserify": "^14.3.0", "codemirror": "^5.13.4", - "eslint": "^3.10.0", + "eslint": "^4.1.1", "istanbul": "^0.4.5", "mocha": "^3.3.0", "uglify-js": "^3.0.1" diff --git a/test/issues/0085.js b/test/issues/0085.js index 68de8a1b..403b7e47 100644 --- a/test/issues/0085.js +++ b/test/issues/0085.js @@ -15,8 +15,10 @@ test('Dumper should take into account booleans syntax from YAML 1.0/1.1', functi DEPRECATED_BOOLEANS_SYNTAX.forEach(function (string) { var dump = yaml.dump(string).trim(); - assert(((dump === "'" + string + "'") || (dump === '"' + string + '"')), - ('"' + string + '" string is dumped without quoting; actual dump: ' + dump)); + assert( + ((dump === "'" + string + "'") || (dump === '"' + string + '"')), + ('"' + string + '" string is dumped without quoting; actual dump: ' + dump) + ); }); }); diff --git a/test/issues/0217.js b/test/issues/0217.js index 95d85a72..b3b11d16 100644 --- a/test/issues/0217.js +++ b/test/issues/0217.js @@ -79,8 +79,8 @@ test('Folding Javascript functions preserves content', function () { assertFunctionPreserved(fnRot13, [ 'nggnpxngqnja', 'orjnergurvqrfbsznepu' ], - [ 'attackatdawn', 'bewaretheidesofmarch' ] - , 'ROT13'); + [ 'attackatdawn', 'bewaretheidesofmarch' ], + 'ROT13'); }); test('Folding long regular expressions preserves content', function () { diff --git a/test/issues/0266.js b/test/issues/0266.js index 9422d98d..8d818984 100644 --- a/test/issues/0266.js +++ b/test/issues/0266.js @@ -15,7 +15,9 @@ test('Dumper should not take into account booleans syntax from YAML 1.0/1.1 in n DEPRECATED_BOOLEANS_SYNTAX.forEach(function (string) { var dump = yaml.dump(string, { noCompatMode: true }).trim(); - assert((dump === string), - ('"' + string + '" string is not dumped as-is; actual dump: ' + dump)); + assert( + (dump === string), + ('"' + string + '" string is not dumped as-is; actual dump: ' + dump) + ); }); }); diff --git a/test/units/dump-scalar-styles.js b/test/units/dump-scalar-styles.js index c77e8de2..49f178a0 100644 --- a/test/units/dump-scalar-styles.js +++ b/test/units/dump-scalar-styles.js @@ -197,16 +197,16 @@ suite('Scalar style dump:', function () { var indeed = repeat('word. ', 31) + '\n' + [ 2, 3, 5, 7, 11, 13, 17 ] - .map(function (n) { return repeat(' ', n); }) - .join('\n'); + .map(function (n) { return repeat(' ', n); }) + .join('\n'); assert.strictEqual(dump(indeed), - '>-\n' + indent( - 'word. word. word. word. word. word. word. word. word. word. word. word. word.\n' + - 'word. word. word. word. word. word. word. word. word. word. word. word. word.\n' + - 'word. word. word. word. word. \n' + - [ 2, 3, 5, 7, 11, 13, 17 ] - .map(function (n) { return repeat(' ', n); }) - .join('\n') + '\n')); + '>-\n' + indent( + 'word. word. word. word. word. word. word. word. word. word. word. word. word.\n' + + 'word. word. word. word. word. word. word. word. word. word. word. word. word.\n' + + 'word. word. word. word. word. \n' + + [ 2, 3, 5, 7, 11, 13, 17 ] + .map(function (n) { return repeat(' ', n); }) + .join('\n') + '\n')); }); var story = 'Call me Ishmael. Some years ago—never mind how long precisely—'