Skip to content

Commit 32fb0ee

Browse files
author
Robert Jackson
committed
Fix linting issues
1 parent cdbfa5c commit 32fb0ee

20 files changed

Lines changed: 52 additions & 35 deletions

File tree

addon/components/head-layout.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{{#in-element this.headElement insertBefore=null}}
2+
{{! template-lint-disable no-forbidden-elements }}
23
<meta name="ember-cli-head-start" content=""><HeadContent/><meta name="ember-cli-head-end" content="">
34
{{/in-element}}

addon/components/head-layout.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ import Component from '@glimmer/component';
22
import { inject as service } from '@ember/service';
33

44
export default class HeadLayout extends Component {
5-
@service('-document') document
5+
@service('-document') document;
66

77
/**
88
* If true, this will tear down any existing head on init of this component.
99
* This is useful if there is a head built with fastboot - it will then be torn down when this is initialized in the browser.
1010
* If you do not want this behavior, you can set this to false.
1111
* @public
1212
*/
13-
shouldTearDownOnInit = true
13+
shouldTearDownOnInit = true;
1414

1515
/**
1616
* The element to render into. Defaults to <head> in `init`, overridable for our own tests only.
1717
* @private
1818
*/
19-
headElement = this.args.headElement || this.document.head
19+
headElement = this.args.headElement || this.document.head;
2020

2121
constructor() {
2222
super(...arguments);
@@ -51,7 +51,6 @@ export default class HeadLayout extends Component {
5151
}
5252

5353
_isFastboot() {
54-
return typeof FastBoot !== 'undefined'
54+
return typeof FastBoot !== 'undefined';
5555
}
56-
5756
}

addon/services/head-data.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
import Service from '@ember/service';
22

3-
export default class HeadData extends Service {
4-
}
3+
export default class HeadData extends Service {}

app/components/head-content.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ import layout from '../templates/head';
55
export default Component.extend({
66
tagName: '',
77
model: inject('head-data'),
8-
layout
8+
layout,
99
});

app/components/head-layout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { default } from 'ember-cli-head/components/head-layout';
1+
export { default } from 'ember-cli-head/components/head-layout';

app/instance-initializers/head-browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ export default {
44
// do nothing!
55
// this functionality has been moved into addon/components/head-layout.js
66
// This is only here in order to not break existing addons relying on this, e.g. ember-page-title.
7-
}
7+
},
88
};

app/templates/head.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
{{! template-lint-disable no-html-comments }}
12
<!-- ember-cli-head/templates/head.hbs -->
23
<!-- If you see this your application's `head.hbs` has gone missing. -->

fastboot-tests/fixtures/fastboot/app/templates/head.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{! template-lint-disable no-forbidden-elements no-html-comments }}
12
<!-- Add content you wish automatically added to the documents head-->
23
<!-- here. The 'model' available in this template can be populated by-->
34
<!-- setting values on the 'head-data' service. -->

tests/.eslintrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
22
env: {
3-
embertest: true
4-
}
3+
embertest: true,
4+
},
55
};

tests/acceptance/head-component-test.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,22 @@ import { module, test } from 'qunit';
22
import { visit } from '@ember/test-helpers';
33
import { setupApplicationTest } from 'ember-qunit';
44

5-
module('Acceptance | head component', function(hooks) {
5+
module('Acceptance | head component', function (hooks) {
66
setupApplicationTest(hooks);
77

8-
test('has head-data service content', async function(assert) {
8+
test('has head-data service content', async function (assert) {
99
await visit('/');
1010

1111
assert.dom('h1').hasText('Hello page');
12-
assert.dom('head meta[property="og:title"]', document).hasAttribute('content', 'Hello page');
12+
assert
13+
.dom('head meta[property="og:title"]', document)
14+
.hasAttribute('content', 'Hello page');
1315

1416
await visit('/other-page');
1517

1618
assert.dom('h1').hasText('Other page');
17-
assert.dom('head meta[property="og:title"]', document).hasAttribute('content', 'Other page');
19+
assert
20+
.dom('head meta[property="og:title"]', document)
21+
.hasAttribute('content', 'Other page');
1822
});
1923
});

0 commit comments

Comments
 (0)