Fix "operator-linebreak" linter

Change-Id: I5f0083302e35c8e88080db8c0ee4f154ebb62304
This commit is contained in:
Tao Zhou
2019-12-13 13:44:14 +01:00
parent 061bf2bc19
commit 3206b1d882
22 changed files with 52 additions and 52 deletions

View File

@@ -256,8 +256,8 @@ limitations under the License.
});
test('tab wrapper style', () => {
const pattern = new RegExp('^<span class="style-scope gr-diff tab" '
+ 'style="(?:-moz-)?tab-size: (\\d+);">\\t<\\/span>$');
const pattern = new RegExp('^<span class="style-scope gr-diff tab" ' +
'style="(?:-moz-)?tab-size: (\\d+);">\\t<\\/span>$');
for (const size of [1, 3, 8, 55]) {
const html = builder._getTabWrapper(size).outerHTML;

View File

@@ -91,9 +91,9 @@
const sanitizer = window.Polymer.sanitizeDOMValue;
for (const [name, value] of Object.entries(attributes)) {
wrapper.setAttribute(
name, sanitizer
? sanitizer(value, name, 'attribute', wrapper)
: value);
name, sanitizer ?
sanitizer(value, name, 'attribute', wrapper) :
value);
}
for (const inner of nestedNodes) {
parent.replaceChild(wrapper, inner);

View File

@@ -228,13 +228,13 @@ limitations under the License.
assert.equal(
container.innerHTML,
'0'
+ '<test-wrapper>'
+ '1234'
+ '<hl class="testclass">567890</hl>'
+ '</test-wrapper>'
+ '<hl class="testclass">1234</hl>'
+ '56789');
'0' +
'<test-wrapper>' +
'1234' +
'<hl class="testclass">567890</hl>' +
'</test-wrapper>' +
'<hl class="testclass">1234</hl>' +
'56789');
});
test('annotates text node', () => {

View File

@@ -101,9 +101,9 @@
* @return {number} The length of the text.
*/
_getLength(node) {
return node
? node.textContent.replace(REGEX_ASTRAL_SYMBOL, '_').length
: 0;
return node ?
node.textContent.replace(REGEX_ASTRAL_SYMBOL, '_').length :
0;
},
};

View File

@@ -357,8 +357,8 @@
this.filesWeblinks = this._getFilesWeblinks(diff);
return new Promise(resolve => {
const callback = event => {
const needsSyntaxHighlighting = event.detail
&& event.detail.contentRendered;
const needsSyntaxHighlighting = event.detail &&
event.detail.contentRendered;
if (needsSyntaxHighlighting) {
this.$.reporting.time(TimingLabel.SYNTAX);
this.$.syntaxLayer.process().then(() => {

View File

@@ -302,8 +302,8 @@
showNoChangeMessage(loading, prefs, diffLength) {
return !loading &&
prefs && prefs.ignore_whitespace !== 'IGNORE_NONE'
&& diffLength === 0;
prefs && prefs.ignore_whitespace !== 'IGNORE_NONE' &&
diffLength === 0;
}
_enableSelectionObserver(loggedIn, isAttached) {

View File

@@ -155,8 +155,8 @@
_computeText(patchNum, prefix, changeComments, sha) {
return `${prefix}${patchNum}` +
`${this._computePatchSetCommentsString(changeComments, patchNum)}`
+ (` | ${sha}`);
`${this._computePatchSetCommentsString(changeComments, patchNum)}` +
(` | ${sha}`);
}
_createDropdownEntry(patchNum, prefix, sortedRevisions, changeComments,