Update and fix linting

This commit is contained in:
Paulus Schoutsen 2016-02-28 00:30:01 -08:00
parent 0b608c586c
commit c580a9eb89
11 changed files with 16 additions and 22 deletions

View File

@ -1,12 +1,7 @@
{
"parser": "babel-eslint",
"extends": "airbnb/base",
"globals": {
"__DEV__": false,
"__DEMO__": false
},
"rules": {
"comma-dangle": [2, "always-multiline"],
"no-underscore-dangle": 0
}
}

View File

@ -20,18 +20,17 @@
"author": "Paulus Schoutsen <Paulus@PaulusSchoutsen.nl> (http://paulusschoutsen.nl)",
"license": "MIT",
"dependencies": {
"home-assistant-js": "git+https://github.com/balloob/home-assistant-js.git#cd46830c19d3e9593d112def0202a832afa4d839",
"home-assistant-js": "git+https://github.com/balloob/home-assistant-js.git#9a93089d0e3e41cecb3c6e99d5672341ca6d4152",
"lodash": "^4.5.0",
"moment": "^2.11.2"
},
"devDependencies": {
"babel-core": "^6.5",
"babel-eslint": "^5.0.0",
"babel-loader": "^6.2",
"babel-preset-es2015": "^6.3.13",
"bower": "^1.7.7",
"eslint": "^1.10.3",
"eslint-config-airbnb": "^5.0.0",
"eslint": "^2.2.0",
"eslint-config-airbnb": "^6.0.2",
"html-minifier": "^1.2.0",
"vulcanize": "^1.14.6",
"webpack": "^1.12"

View File

@ -62,7 +62,7 @@ export default new Polymer({
updateCards(columns, states, showIntroduction) {
this.debounce(
'updateCards',
() => this.cards = this.computeCards(columns, states, showIntroduction),
() => { this.cards = this.computeCards(columns, states, showIntroduction); },
0
);
},
@ -147,7 +147,7 @@ export default new Polymer({
byDomain.get(domain).sortBy(entitySortBy)
.forEach(groupState => {
const entities = util.expandGroup(groupState, states);
entities.forEach(entity => hasGroup[entity.entityId] = true);
entities.forEach(entity => { hasGroup[entity.entityId] = true; });
addEntitiesCard(groupState.entityId, entities.toArray(), groupState);
}
);

View File

@ -55,7 +55,7 @@ export default new Polymer({
}
this.mouseMoveIsThrottled = false;
this.processColorSelect(ev.touches[0]);
this.async(() => this.mouseMoveIsThrottled = true, 100);
this.async(() => { this.mouseMoveIsThrottled = true; }, 100);
},
onMouseMove(ev) {
@ -64,7 +64,7 @@ export default new Polymer({
}
this.mouseMoveIsThrottled = false;
this.processColorSelect(ev);
this.async(() => this.mouseMoveIsThrottled = true, 100);
this.async(() => { this.mouseMoveIsThrottled = true; }, 100);
},
processColorSelect(ev) {

View File

@ -70,7 +70,9 @@ export default new Polymer({
if (stateInfo.length === 0) return;
const entityDisplay = stateInfo[0].entityDisplay;
/* eslint-disable prefer-const */
let newLastChanged;
/* eslint-enable prefer-const */
let prevState = null;
let prevLastChanged = null;

View File

@ -81,7 +81,7 @@ export default new Polymer({
googleApiLoaded() {
window.google.load('visualization', '1', {
packages: ['timeline', 'corechart'],
callback: () => this.apiLoaded = true,
callback: () => { this.apiLoaded = true; },
});
},

View File

@ -116,7 +116,7 @@ export default new Polymer({
dialogOpenChanged(newVal) {
if (newVal) {
this.async(() => this._delayedDialogOpen = true, 10);
this.async(() => { this._delayedDialogOpen = true; }, 10);
} else if (!newVal && this.stateObj) {
this.async(() => moreInfoActions.deselectEntity(), 10);
this._delayedDialogOpen = false;

View File

@ -58,10 +58,10 @@ export default new Polymer({
loadIcons() {
// If the import fails, we'll try to import again, must be a server glitch
// Since HTML imports only resolve once, we import another url.
const success = () => this.iconsLoaded = true;
const success = () => { this.iconsLoaded = true; };
this.importHref(`/static/mdi-${this.icons}.html`,
success,
() => this.importHref(`/static/mdi.html`, success, success));
() => this.importHref('/static/mdi.html', success, success));
},
created() {

View File

@ -140,9 +140,7 @@ export default new Polymer({
},
computeRefreshButtonClass(isFetching) {
if (isFetching) {
return 'ha-spin';
}
return isFetching ? 'ha-spin' : '';
},
computeShowIntroduction(currentView, introductionLoaded, states) {

View File

@ -57,6 +57,6 @@ export default new Polymer({
this.errorLog = 'Loading error log…';
errorLogActions.fetchErrorLog().then(
log => this.errorLog = log || 'No errors have been reported.');
log => { this.errorLog = log || 'No errors have been reported.'; });
},
});

View File

@ -14,7 +14,7 @@ export default function dynamicContentUpdater(root, newElementTag, attributes) {
customEl = document.createElement(newElementTag);
}
Object.keys(attributes).forEach(key => customEl[key] = attributes[key]);
Object.keys(attributes).forEach(key => { customEl[key] = attributes[key]; });
if (customEl.parentNode === null) {
rootEl.appendChild(customEl);