Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activate ESLint 'semi' rule #4651

Closed
wants to merge 2 commits 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 .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"rules": {
"no-console": "off",
"no-var": "error",
"semi": "error",
"strict": "error",
"valid-jsdoc": ["error", {
"requireReturn": false,
Expand Down
8 changes: 4 additions & 4 deletions lib/elements/array-selector.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@
value: false
}

}
};
}

static get observers() {
return ['__updateSelection(multi, items.*)']
return ['__updateSelection(multi, items.*)'];
}

constructor() {
Expand Down Expand Up @@ -222,7 +222,7 @@
// order: selected array index
this.__selectedMap = new Map();
// Initialize selection
this.selected = this.multi ? [] : null
this.selected = this.multi ? [] : null;
this.selectedItem = null;
}

Expand Down Expand Up @@ -416,7 +416,7 @@
class ArraySelector extends baseArraySelector {
// Not needed to find template; can be removed once the analyzer
// can find the tag name from customElements.define call
static get is() { return 'array-selector' }
static get is() { return 'array-selector'; }
}
customElements.define(ArraySelector.is, ArraySelector);
Polymer.ArraySelector = ArraySelector;
Expand Down
4 changes: 2 additions & 2 deletions lib/elements/dom-bind.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
*/
class DomBind extends domBindBase {

static get observedAttributes() { return ['mutable-data'] }
static get observedAttributes() { return ['mutable-data']; }

constructor() {
super();
Expand Down Expand Up @@ -104,7 +104,7 @@
} else {
throw new Error('dom-bind requires a <template> child');
}
})
});
observer.observe(this, {childList: true});
return;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/elements/dom-if.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
observer: '__debounceRender'
}

}
};

}

Expand Down Expand Up @@ -181,7 +181,7 @@
} else {
throw new Error('dom-if requires a <template> child');
}
})
});
observer.observe(this, {childList: true});
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/elements/dom-module.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
*/
class DomModule extends HTMLElement {

static get observedAttributes() { return ['id'] }
static get observedAttributes() { return ['id']; }

/**
* Retrieves the element specified by the css `selector` in the module
Expand Down
6 changes: 3 additions & 3 deletions lib/elements/dom-repeat.html
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,12 @@
type: String
}

}
};

}

static get observers() {
return [ '__itemsChanged(items.*)' ]
return [ '__itemsChanged(items.*)' ];
}

constructor() {
Expand Down Expand Up @@ -353,7 +353,7 @@
} else {
throw new Error('dom-repeat requires a <template> child');
}
})
});
observer.observe(this, {childList: true});
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/legacy/class.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
attributeChanged: true,
// meta objects
behaviors: true
}
};

/**
* Applies a "legacy" behavior or array of behaviors to the provided class.
Expand Down Expand Up @@ -240,7 +240,7 @@
}
}

PolymerGenerated.generatedFrom = info
PolymerGenerated.generatedFrom = info;

for (let p in info) {
// NOTE: cannot copy `metaProps` methods onto prototype at least because
Expand Down Expand Up @@ -335,7 +335,7 @@
// decorate klass with registration info
klass.is = info.is;
return klass;
}
};

Polymer.mixinBehaviors = mixinBehaviors;

Expand Down
6 changes: 3 additions & 3 deletions lib/legacy/legacy-element-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@
});
event.detail = detail;
let node = options.node || this;
node.dispatchEvent(event)
node.dispatchEvent(event);
return event;
}

Expand Down Expand Up @@ -681,7 +681,7 @@
* @param {string} jobName The name of the debouncer started with `debounce`
*/
cancelDebouncer(jobName) {
this._debouncers = this._debouncers || {}
this._debouncers = this._debouncers || {};
let debouncer = this._debouncers[jobName];
if (debouncer) {
debouncer.cancel();
Expand Down Expand Up @@ -921,7 +921,7 @@
* @param {...*} args Array of strings or objects to log
*/
_error(...args) {
this._logger('error', args)
this._logger('error', args);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/legacy/polymer.dom.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/
const matchesSelector = function(node, selector) {
return normalizedMatchesSelector.call(node, selector);
}
};

/**
* Node API wrapper class returned from `Polymer.dom.(target)` when
Expand Down Expand Up @@ -196,7 +196,7 @@
let method = methods[i];
proto[method] = /** @this {DomApi} */ function() {
return this.node[method].apply(this.node, arguments);
}
};
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/mixins/element-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@
* @private
*/
_regLog: function(prototype) {
console.log('[' + prototype.is + ']: registered')
console.log('[' + prototype.is + ']: registered');
},
/**
* Registers a class prototype for telemetry purposes.
Expand Down
4 changes: 2 additions & 2 deletions lib/mixins/property-accessors.html
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@
*/
_setPendingProperty(property, value) {
let old = this.__data[property];
let changed = this._shouldPropertyChange(property, value, old)
let changed = this._shouldPropertyChange(property, value, old);
if (changed) {
if (!this.__dataPending) {
this.__dataPending = {};
Expand Down Expand Up @@ -528,7 +528,7 @@
this._initializeInstanceProperties(this.__dataInstanceProps);
this.__dataInstanceProps = null;
}
this.ready()
this.ready();
}
}

Expand Down
6 changes: 3 additions & 3 deletions lib/mixins/property-effects.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
PROPAGATE: '__propagateEffects',
OBSERVE: '__observeEffects',
READ_ONLY: '__readOnly'
}
};

/**
* @typedef {{
Expand Down Expand Up @@ -1979,7 +1979,7 @@
if (protectedSetter) {
this['_set' + upper(property)] = /** @this {PropertyEffects} */function(value) {
this._setProperty(property, value);
}
};
}
}

Expand Down Expand Up @@ -2687,7 +2687,7 @@
}
}

}
};

})();
</script>
2 changes: 1 addition & 1 deletion lib/utils/array-splice.html
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
* of items added at this location.
*/
calculateSplices
}
};

})();
</script>
6 changes: 3 additions & 3 deletions lib/utils/async.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
try {
cb();
} catch (e) {
setTimeout(() => { throw e });
setTimeout(() => { throw e; });
}
}
}
Expand Down Expand Up @@ -72,9 +72,9 @@
*/
after(delay) {
return {
run(fn) { return setTimeout(fn, delay) },
run(fn) { return setTimeout(fn, delay); },
cancel: window.clearTimeout.bind(window)
}
};
},
/**
* Enqueues a function called in the next task.
Expand Down
6 changes: 3 additions & 3 deletions lib/utils/boot.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/
window.Polymer = function(info) {
return window.Polymer._polymerFn(info);
}
};

// support user settings on the Polymer object
if (userPolymer) {
Expand All @@ -46,7 +46,7 @@
*/
window.Polymer._polymerFn = function(info) { // eslint-disable-line no-unused-vars
throw new Error('Load polymer.html to use the Polymer() function.');
}
};
/* eslint-enable */

window.Polymer.version = '2.0.1';
Expand All @@ -58,7 +58,7 @@
*/
window.JSCompiler_renameProperty = function(prop, obj) {
return prop;
}
};
/* eslint-enable */

})();
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/debounce.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
this._callback = callback;
this._timer = this._asyncModule.run(() => {
this._timer = null;
this._callback()
this._callback();
});
}
/**
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/flattened-nodes-observer.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
/** @type {function()} */
this._boundSchedule = () => {
this._schedule();
}
};
this.connect();
this._schedule();
}
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/flush.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
Polymer.enqueueDebouncer = function(debouncer) {
debouncerQueue.push(debouncer);
}
};

function flushDebouncers() {
const didFlush = Boolean(debouncerQueue.length);
Expand Down Expand Up @@ -54,7 +54,7 @@
}
debouncers = flushDebouncers();
} while (shadyDOM || debouncers);
}
};

})();
</script>
2 changes: 1 addition & 1 deletion lib/utils/gestures.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
let SUPPORTS_PASSIVE = false;
(function() {
try {
let opts = Object.defineProperty({}, 'passive', {get: function() {SUPPORTS_PASSIVE = true;}})
let opts = Object.defineProperty({}, 'passive', {get: function() {SUPPORTS_PASSIVE = true;}});
window.addEventListener('test', null, opts);
window.removeEventListener('test', null, opts);
} catch(e) {}
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/import-href.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
let cleanup = function() {
link.removeEventListener('load', loadListener);
link.removeEventListener('error', errorListener);
}
};
let loadListener = function(event) {
cleanup();
// In case of a successful load, cache the load event on the link so
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/render-status.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
} catch(e) {
setTimeout(() => {
throw e;
})
});
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/utils/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
*/
Polymer.setRootPath = function(path) {
Polymer.rootPath = path;
}
};

/**
* A global callback used to sanitize any value before inserting it into the DOM. The callback signature is:
Expand Down Expand Up @@ -92,6 +92,6 @@
*/
Polymer.setSanitizeDOMValue = function(newSanitizeDOMValue) {
Polymer.sanitizeDOMValue = newSanitizeDOMValue;
}
};
})();
</script>
Loading