diff --git a/.eslintrc b/.eslintrc index 41b24fab63..e8ee6fab5b 100644 --- a/.eslintrc +++ b/.eslintrc @@ -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 } } diff --git a/package.json b/package.json index e1263e99f9..850d1d5574 100644 --- a/package.json +++ b/package.json @@ -20,18 +20,17 @@ "author": "Paulus Schoutsen (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" diff --git a/src/components/ha-cards.js b/src/components/ha-cards.js index 4b2ea5825f..7ceeb3858e 100644 --- a/src/components/ha-cards.js +++ b/src/components/ha-cards.js @@ -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); } ); diff --git a/src/components/ha-color-picker.js b/src/components/ha-color-picker.js index 63b5922a9c..63eb3c7369 100644 --- a/src/components/ha-color-picker.js +++ b/src/components/ha-color-picker.js @@ -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) { diff --git a/src/components/state-history-chart-timeline.js b/src/components/state-history-chart-timeline.js index 4c7aff9195..3c426935ef 100644 --- a/src/components/state-history-chart-timeline.js +++ b/src/components/state-history-chart-timeline.js @@ -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; diff --git a/src/components/state-history-charts.js b/src/components/state-history-charts.js index 5fc12e439f..1ae24f803c 100644 --- a/src/components/state-history-charts.js +++ b/src/components/state-history-charts.js @@ -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; }, }); }, diff --git a/src/dialogs/more-info-dialog.js b/src/dialogs/more-info-dialog.js index 4d246db935..0c5e242257 100644 --- a/src/dialogs/more-info-dialog.js +++ b/src/dialogs/more-info-dialog.js @@ -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; diff --git a/src/home-assistant.js b/src/home-assistant.js index a1bcfdb257..47a8ea0baa 100644 --- a/src/home-assistant.js +++ b/src/home-assistant.js @@ -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() { diff --git a/src/layouts/partial-cards.js b/src/layouts/partial-cards.js index a9f16125ee..e3ef2c7f0a 100644 --- a/src/layouts/partial-cards.js +++ b/src/layouts/partial-cards.js @@ -140,9 +140,7 @@ export default new Polymer({ }, computeRefreshButtonClass(isFetching) { - if (isFetching) { - return 'ha-spin'; - } + return isFetching ? 'ha-spin' : ''; }, computeShowIntroduction(currentView, introductionLoaded, states) { diff --git a/src/layouts/partial-dev-info.js b/src/layouts/partial-dev-info.js index 8c79ba9cd2..de9489b445 100644 --- a/src/layouts/partial-dev-info.js +++ b/src/layouts/partial-dev-info.js @@ -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.'; }); }, }); diff --git a/src/util/dynamic-content-updater.js b/src/util/dynamic-content-updater.js index 4a52f6533b..bbba4f5118 100644 --- a/src/util/dynamic-content-updater.js +++ b/src/util/dynamic-content-updater.js @@ -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);