Skip to content
This repository has been archived by the owner on Mar 13, 2021. It is now read-only.

Commit

Permalink
Lint handlebars templates #7
Browse files Browse the repository at this point in the history
  • Loading branch information
ed-asriyan committed Aug 19, 2018
1 parent 7ba8f2d commit e52ffe5
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 35 deletions.
12 changes: 12 additions & 0 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
extends: 'recommended',

rules: {
'no-trailing-dot-in-path-expression': true,
'no-duplicate-attributes': true,
'no-inline-styles': true,
'no-trailing-spaces': true,
'no-outlet-outside-routes': true,
'quotes': 'double',
},
};
10 changes: 5 additions & 5 deletions app/templates/account.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="grid-static vp-height vp-width">
<div class="menu left full-height col-3 no-margin no-padding">
{{#link-to 'account.index' class="layout h-center v-center full-width menu-header-height menu"}}
<img src="/images/logo.svg" class="menu__logo"/>
{{#link-to "account.index" class="layout h-center v-center full-width menu-header-height menu"}}
{{core/image-component name="logo" class="menu__logo"}}
{{/link-to}}
<div class="full-width">
{{#menu-option
Expand All @@ -12,7 +12,7 @@
{{#each model.objects as |object|}}
{{#menu-option
caption=object.name
linkTo='account.subject'
linkTo="account.subject"
linkParam=object.id
}}{{/menu-option}}
{{/each}}
Expand All @@ -21,7 +21,7 @@
{{menu-option
caption="Finance"
icon="credit-card"
linkTo='account.finance'
linkTo="account.finance"
}}

{{menu-option
Expand All @@ -38,7 +38,7 @@
<div class="col-3 col-center">
{{menu-user user=model.user
class="full-height"
onLogOut=(action 'onLogOutAction')
onLogOut=(action "onLogOutAction")
}}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/account/subject.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="grid-static full-width">
{{#each (await model.sensors) as |sensor|}}
{{sensor-card sensor=sensor}}
{{sensor-card sensor=sensor}}
{{/each}}
</div>
3 changes: 2 additions & 1 deletion app/templates/auth.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{! template-lint-disable no-inline-styles }}
<div class="fixed vp-width h-center v-center margin-top-3x overflow-hidden" style="height: 25%;">
{{core/image-component name='logo-black' style="height: 20%"}}
{{core/image-component name="logo-black" style="height: 20%"}}
</div>
<div class="vp-height vp-width v-center h-center">
{{outlet}}
Expand Down
2 changes: 1 addition & 1 deletion app/templates/auth/log-in.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
{{core/loader-component}}
{{else}}
{{log-in-form error=logInError
onLogIn=(action 'onLogInAction')
onLogIn=(action "onLogInAction")
}}
{{/if}}
4 changes: 2 additions & 2 deletions app/templates/components/menu-user.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="grid-fluid col-center full-height">
{{core/icon-component name="man" class="col avatar"}}
<div class="clickable col-full" onClick={{action "onClickAction"}}>
<div class="clickable col-full" role="button" onclick={{action "onClickAction"}}>
{{user.fullName}}
</div>
{{core/icon-component
Expand All @@ -17,7 +17,7 @@
{{#link-to "account.finance" class="menu-item text-default"}}
Finance
{{/link-to}}
<div class="menu-item text-dangerous" onclick={{action 'onLogOutClickAction'}}>
<div class="menu-item text-dangerous" role="button" onclick={{action "onLogOutClickAction"}}>
Log Out
</div>
</div>
Expand Down
44 changes: 22 additions & 22 deletions app/templates/components/object-card.hbs
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{{#link-to 'account.subject' object.id class="object" tagName='div'}}
{{#link-to "account.subject" object.id class="object" tagName="div"}}
<div class="header-wrapper">
<div class="header grid-fluid">
<div class="col-7">
<div class="header__title text-caption layout v-center">
{{object.name}}
</div>
<div class="header__description">
<span class="text-bubble">
{{#if (is-pending object.sensors)}}
-
{{else}}
{{get (await object.sensors) 'length'}}
{{/if}}
</span>
<span class="text-bubble">
{{#if (is-pending object.sensors)}}
-
{{else}}
{{get (await object.sensors) "length"}}
{{/if}}
</span>
active sensors
</div>
</div>
<div class="col-5 col-center">
<div class="pull-right">
{{#link-to 'account.subject' object.id class='btn btn-ok'}}
{{#link-to "account.subject" object.id class="btn btn-ok"}}
More
{{/link-to}}
</div>
Expand All @@ -34,9 +34,9 @@
<div class="grid-fluid full-height items-center">
{{#each (await object.sensors) as |sensor|}}
<div class="col col-min-6 object__amount margin-top-1x">
<span class="text-default pull-left">
{{sensor.name}}
</span>
<span class="text-default pull-left">
{{sensor.name}}
</span>
<span class="text-bubble pull-right">
{{sensor.value}}
</span>
Expand All @@ -52,32 +52,32 @@
<div class="object__footer grid-fluid padding-top-1x">
<div class="col-6 full-height padding-right-2x">
<div class="object__amount">
<span class="text-default pull-left">
Current month
</span>
<span class="text-default pull-left">
Current month
</span>
<span class="pull-right">
{{object.curMonthAmount}}
</span>
</div>
<div class="object__amount">
<span class="text-default pull-left">
Last month
</span>
<span class="text-default pull-left">
Last month
</span>
<span class="pull-right">
{{object.lastMonthAmount}}
</span>
</div>
<div class="object__amount ">
<span class="text-default pull-left">
Last year average
</span>
<span class="text-default pull-left">
Last year average
</span>
<span class="pull-right">
{{object.yearAverageAmount}}
</span>
</div>
</div>
<div class="col-6 col-center">
{{#link-to 'account.index' class='btn btn-ok pull-right'}}
{{#link-to "account.index" class="btn btn-ok pull-right"}}
Pay
{{/link-to}}
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/templates/components/sensor-card.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</div>
<div class="col-5 col-center">
<div class="pull-right">
{{#link-to 'account.subject' object.id class='btn btn-ok'}}
{{#link-to "account.subject" object.id class="btn btn-ok"}}
More
{{/link-to}}
</div>
Expand Down Expand Up @@ -59,7 +59,7 @@
</div>
</div>
<div class="col-6 col-center">
{{#link-to 'account.index' class='btn btn-ok pull-right'}}
{{#link-to "account.index" class="btn btn-ok pull-right"}}
Pay
{{/link-to}}
</div>
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"repository": "",
"scripts": {
"build": "ember build",
"lint": "eslint app/ tests/",
"lint": "eslint app/ tests/ && ./node_modules/.bin/ember-template-lint app/templates/",
"start": "ember serve",
"test": "ember test"
},
Expand Down Expand Up @@ -43,6 +43,7 @@
"ember-promise-helpers": "^1.0.6",
"ember-resolver": "^5.0.1",
"ember-source": "^3.3.1",
"ember-template-lint": "^0.8.23",
"ember-truth-helpers": "^2.0.0",
"ember-welcome-page": "^3.0.0",
"eslint": "^5.2.0",
Expand Down

0 comments on commit e52ffe5

Please sign in to comment.