mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +00:00
Update eslint
This commit is contained in:
parent
a60ebb040c
commit
cdc1437944
@ -1,4 +1,5 @@
|
||||
{
|
||||
"parser": "babel-eslint",
|
||||
"extends": "airbnb/base",
|
||||
"globals": {
|
||||
"__DEV__": false,
|
||||
|
@ -35,8 +35,8 @@
|
||||
"babel-preset-es2015": "^6.0.0",
|
||||
"bower": "^1.6.5",
|
||||
"eslint": "^1.10.3",
|
||||
"eslint-config-airbnb": "^0.1.0",
|
||||
"html-minifier": "^1.0.0",
|
||||
"eslint-config-airbnb": "^3.1.0",
|
||||
"vulcanize": "^1.14.0",
|
||||
"webpack": "^1.12"
|
||||
}
|
||||
|
@ -22,6 +22,6 @@ export default new Polymer({
|
||||
|
||||
entitySelected(ev) {
|
||||
ev.preventDefault();
|
||||
this.fire('entity-selected', {entityId: ev.model.entity.entityId});
|
||||
this.fire('entity-selected', { entityId: ev.model.entity.entityId });
|
||||
},
|
||||
});
|
||||
|
@ -40,7 +40,7 @@ export default new Polymer({
|
||||
},
|
||||
|
||||
listeners: {
|
||||
'tap': 'badgeTap',
|
||||
tap: 'badgeTap',
|
||||
},
|
||||
|
||||
badgeTap(ev) {
|
||||
|
@ -72,7 +72,7 @@ export default new Polymer({
|
||||
service = turnOn ? 'turn_on' : 'turn_off';
|
||||
}
|
||||
|
||||
serviceActions.callService(domain, service, {entity_id: this.stateObj.entityId})
|
||||
serviceActions.callService(domain, service, { entity_id: this.stateObj.entityId })
|
||||
.then(() => this.forceStateChange());
|
||||
},
|
||||
});
|
||||
|
@ -21,7 +21,7 @@ export default new Polymer({
|
||||
},
|
||||
|
||||
listeners: {
|
||||
'tap': 'badgeTap',
|
||||
tap: 'badgeTap',
|
||||
},
|
||||
|
||||
badgeTap(ev) {
|
||||
|
@ -22,6 +22,6 @@ export default new Polymer({
|
||||
|
||||
eventSelected(ev) {
|
||||
ev.preventDefault();
|
||||
this.fire('event-selected', {eventType: ev.model.event.event});
|
||||
this.fire('event-selected', { eventType: ev.model.event.event });
|
||||
},
|
||||
});
|
||||
|
@ -25,10 +25,10 @@ export default new Polymer({
|
||||
},
|
||||
|
||||
listeners: {
|
||||
'mousedown': 'onMouseDown',
|
||||
'mouseup': 'onMouseUp',
|
||||
'touchstart': 'onTouchStart',
|
||||
'touchend': 'onTouchEnd',
|
||||
mousedown: 'onMouseDown',
|
||||
mouseup: 'onMouseUp',
|
||||
touchstart: 'onTouchStart',
|
||||
touchend: 'onTouchEnd',
|
||||
},
|
||||
|
||||
onMouseDown(ev) {
|
||||
@ -82,13 +82,13 @@ export default new Polymer({
|
||||
onColorSelect(x, y) {
|
||||
const data = this.context.getImageData(x, y, 1, 1).data;
|
||||
|
||||
this.setColor({r: data[0], g: data[1], b: data[2]});
|
||||
this.setColor({ r: data[0], g: data[1], b: data[2] });
|
||||
},
|
||||
|
||||
setColor(rgb) {
|
||||
this.color = rgb;
|
||||
|
||||
this.fire('colorselected', {rgb: this.color});
|
||||
this.fire('colorselected', { rgb: this.color });
|
||||
},
|
||||
|
||||
ready() {
|
||||
|
@ -84,7 +84,7 @@ export default new Polymer({
|
||||
return;
|
||||
}
|
||||
cards._columns[increaseIndex()].push(name);
|
||||
cards[name] = {entities, groupEntity};
|
||||
cards[name] = { entities, groupEntity };
|
||||
}
|
||||
|
||||
byDomain.keySeq().sortBy(domain => getPriority(domain))
|
||||
|
@ -30,7 +30,7 @@ export default new Polymer({
|
||||
serviceClicked(ev) {
|
||||
ev.preventDefault();
|
||||
this.fire(
|
||||
'service-selected', {domain: ev.model.domain,
|
||||
service: ev.model.service});
|
||||
'service-selected', { domain: ev.model.domain,
|
||||
service: ev.model.service });
|
||||
},
|
||||
});
|
||||
|
@ -70,12 +70,12 @@ export default new Polymer({
|
||||
titlePosition: 'none',
|
||||
vAxes: {
|
||||
// Adds units to the left hand side of the graph
|
||||
0: {title: unit},
|
||||
0: { title: unit },
|
||||
},
|
||||
hAxis: {
|
||||
format: 'H:mm',
|
||||
},
|
||||
chartArea: { left: '60', width: '95%'},
|
||||
chartArea: { left: '60', width: '95%' },
|
||||
explorer: {
|
||||
actions: ['dragToZoom', 'rightClickToReset', 'dragToPan'],
|
||||
keepInBounds: true,
|
||||
|
@ -44,7 +44,7 @@ export default new Polymer({
|
||||
|
||||
computeGroupedStateHistory(isLoading, stateHistory) {
|
||||
if (isLoading || !stateHistory) {
|
||||
return {line: [], timeline: []};
|
||||
return { line: [], timeline: [] };
|
||||
}
|
||||
|
||||
const lineChartDevices = {};
|
||||
@ -75,7 +75,7 @@ export default new Polymer({
|
||||
const unitStates = Object.keys(lineChartDevices).map(
|
||||
(unit) => [unit, lineChartDevices[unit]]);
|
||||
|
||||
return {line: unitStates, timeline: timelineDevices};
|
||||
return { line: unitStates, timeline: timelineDevices };
|
||||
},
|
||||
|
||||
googleApiLoaded() {
|
||||
|
@ -91,9 +91,10 @@ export default new Polymer({
|
||||
|
||||
navigator.serviceWorker.register('./service_worker.js').catch(err => {
|
||||
if (__DEV__) {
|
||||
/* eslint-disable no-console */
|
||||
console.warn('Unable to register service worker', err);
|
||||
/* eslint-enable no-console */
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
});
|
||||
|
@ -47,7 +47,7 @@ export default new Polymer({
|
||||
},
|
||||
|
||||
listeners: {
|
||||
'keydown': 'passwordKeyDown',
|
||||
keydown: 'passwordKeyDown',
|
||||
'loginButton.tap': 'validatePassword',
|
||||
},
|
||||
|
||||
|
@ -37,6 +37,7 @@ export default new Polymer({
|
||||
|
||||
template: {
|
||||
type: String,
|
||||
/* eslint-disable max-len */
|
||||
value: '{%- if is_state("device_tracker.paulus", "home") and \n' +
|
||||
' is_state("device_tracker.anne_therese", "home") -%}\n' +
|
||||
'\n' +
|
||||
@ -55,6 +56,7 @@ export default new Polymer({
|
||||
' {%- if loop.first %}The {% elif loop.last %} and the {% else %}, the {% endif -%}\n' +
|
||||
' {{ state.name | lower }} is {{state.state}} {{- state.attributes.unit_of_measurement}}\n' +
|
||||
'{%- endfor -%}.',
|
||||
/* eslint-enable max-len */
|
||||
observer: 'templateChanged',
|
||||
},
|
||||
|
||||
|
@ -7,13 +7,13 @@ const { serviceActions } = hass;
|
||||
export default new Polymer({
|
||||
is: 'more-info-alarm_control_panel',
|
||||
handleDisarmTap() {
|
||||
this.callService('alarm_disarm', {code: this.enteredCode});
|
||||
this.callService('alarm_disarm', { code: this.enteredCode });
|
||||
},
|
||||
handleHomeTap() {
|
||||
this.callService('alarm_arm_home', {code: this.enteredCode});
|
||||
this.callService('alarm_arm_home', { code: this.enteredCode });
|
||||
},
|
||||
handleAwayTap() {
|
||||
this.callService('alarm_arm_away', {code: this.enteredCode});
|
||||
this.callService('alarm_arm_away', { code: this.enteredCode });
|
||||
},
|
||||
properties: {
|
||||
stateObj: {
|
||||
|
@ -25,16 +25,16 @@ export default new Polymer({
|
||||
|
||||
onMoveUpTap() {
|
||||
serviceActions.callService('rollershutter', 'move_up',
|
||||
{entity_id: this.stateObj.entityId});
|
||||
{ entity_id: this.stateObj.entityId });
|
||||
},
|
||||
|
||||
onMoveDownTap() {
|
||||
serviceActions.callService('rollershutter', 'move_down',
|
||||
{entity_id: this.stateObj.entityId});
|
||||
{ entity_id: this.stateObj.entityId });
|
||||
},
|
||||
|
||||
onStopTap() {
|
||||
serviceActions.callService('rollershutter', 'stop',
|
||||
{entity_id: this.stateObj.entityId});
|
||||
{ entity_id: this.stateObj.entityId });
|
||||
},
|
||||
});
|
||||
|
@ -16,7 +16,7 @@ export default new Polymer({
|
||||
},
|
||||
|
||||
listeners: {
|
||||
'tap': 'cardTapped',
|
||||
tap: 'cardTapped',
|
||||
},
|
||||
|
||||
cardTapped(ev) {
|
||||
|
@ -2,7 +2,7 @@ import hass from '../util/home-assistant-js-instance';
|
||||
|
||||
const { authActions, localStoragePreferences } = hass;
|
||||
|
||||
export default function(authToken, rememberAuth) {
|
||||
export default function (authToken, rememberAuth) {
|
||||
authActions.validate(authToken, {
|
||||
rememberAuth,
|
||||
useStreaming: localStoragePreferences.useStreaming,
|
||||
|
Loading…
x
Reference in New Issue
Block a user