Skip to content

Commit addeea9

Browse files
Gaurav0sivakumar-kailasam
authored andcommitted
fix lint and tests
1 parent fbe6006 commit addeea9

File tree

12 files changed

+67
-342
lines changed

12 files changed

+67
-342
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports = {
2323
rules: {
2424
'ember/no-jquery': 'off',
2525
'no-console': 'off',
26-
'ember/avoid-leaking-state-in-ember-objects': 1
26+
'ember/no-new-mixins': 'off'
2727
},
2828
overrides: [
2929
// node files

.template-lintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ module.exports = {
77
'attribute-indentation': false,
88
'no-unnecessary-concat': false,
99
'no-inline-styles': false,
10+
'no-implicit-this': false,
11+
'no-curly-component-invocation': false,
12+
'no-action': false,
1013
quotes: false
1114
}
1215
};

app/router.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,28 @@ class AppRouter extends Router {
1010
@service metrics;
1111
@service fastboot;
1212

13-
init() {
14-
this._super(...arguments);
13+
constructor() {
14+
super(...arguments);
1515

1616
if (!this.get('fastboot.isFastBoot')) {
17-
this.on('routeDidChange', () => this._trackPage());
17+
this.on('routeDidChange', this, this._trackPage);
1818
}
19-
},
19+
}
2020

2121
_trackPage() {
22-
scheduleOnce('afterRender', this, () => {
22+
scheduleOnce('afterRender', this, this.__trackPage);
23+
}
2324

24-
// this is constant for this app and is only used to identify page views in the GA dashboard
25-
const hostname = config.APP.domain.replace(/(http|https)?:?\/\//g, '');
25+
__trackPage() {
2626

27-
const page = this.url;
28-
const title = this.getWithDefault('currentRouteName', 'unknown');
29-
this.metrics.trackPage({ page, title, hostname });
30-
});
27+
// this is constant for this app and is only used to identify page views in the GA dashboard
28+
const hostname = config.APP.domain.replace(/(http|https)?:?\/\//g, '');
29+
30+
const page = this.url;
31+
const title = this.getWithDefault('currentRouteName', 'unknown');
32+
this.metrics.trackPage({ page, title, hostname });
3133
}
32-
});
34+
}
3335

3436
AppRouter.map(function() {
3537
this.route('404');

app/templates/404.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="whoops__message">
55
<p>
66
This page wasn't found. Please try the {{#link-to 'index'}}API docs page{{/link-to}}.
7-
If you expected something else to be here, please file a <a href="https://github.com/ember-learn/ember-api-docs/issues/new" target="_blank" rel="noopener">ticket</a>.
7+
If you expected something else to be here, please file a <a href="https://github.com/ember-learn/ember-api-docs/issues/new" target="_blank" rel="noopener noreferrer">ticket</a>.
88
</p>
99
</div>
1010
</article>

app/templates/components/class-field-description.hbs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<section class="{{type}}">
2+
{{!-- TODO: Fix this link for a11y --}}
23
<h3 class="class-field-description--link" data-anchor="{{field.name}}" role="link" onclick={{action updateAnchor field.name}}>
3-
<a class="anchor">
4+
<a class="anchor" {{!-- template-lint-disable link-href-attributes --}}>
45
{{svg-jar 'fa-link' class="class-field-description--link-hover" width="20px" height="20px"}}
56
</a>
67
<span class="{{type}}-name">{{field.name}}</span>
@@ -30,12 +31,12 @@
3031
<p class="github-link" data-test-file={{field.file}}>
3132
{{#if field.inherited}}
3233
Inherited from
33-
<a href="{{github-link model.project.id model.projectVersion.version field.file field.line}}" target="_blank" rel="noopener">
34+
<a href="{{github-link model.project.id model.projectVersion.version field.file field.line}}" target="_blank" rel="noopener noreferrer">
3435
{{field.inheritedFrom}} {{field.file}}:{{field.line}}
3536
</a>
3637
{{else}}
3738
Defined in
38-
<a href="{{github-link model.project.id model.projectVersion.version field.file field.line}}" target="_blank" rel="noopener">
39+
<a href="{{github-link model.project.id model.projectVersion.version field.file field.line}}" target="_blank" rel="noopener noreferrer">
3940
{{field.file}}:{{field.line}}
4041
</a>
4142
{{/if}}

app/templates/error.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="whoops__message">
55
<p>
66
This page wasn't found. Please try the {{#link-to 'index'}}API docs page{{/link-to}}.
7-
If you expected something else to be here, please file a <a href="https://github.com/fivetanley/ember-api-docs/issues/new" target="_blank" rel="noopener">ticket</a>.
7+
If you expected something else to be here, please file a <a href="https://github.com/fivetanley/ember-api-docs/issues/new" target="_blank" rel="noopener noreferrer">ticket</a>.
88
</p>
99
</div>
1010
{{else}}

app/templates/project-version/classes/class.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<article class="chapter">
22
{{#if (is-latest version=model.projectVersion.version allVersions=allVersions)}}
3-
<a data-tooltip="Edit on Github" class="heading__link__edit" href="{{github-link model.project.id model.projectVersion.version model.file model.line isEdit=true}}" target="_blank" rel="noopener">{{svg-jar "fa-pencil"}}</a>
3+
<a data-tooltip="Edit on Github" class="heading__link__edit" href="{{github-link model.project.id model.projectVersion.version model.file model.line isEdit=true}}" target="_blank" rel="noopener noreferrer">{{svg-jar "fa-pencil"}}</a>
44
{{/if}}
55
<h1 class="module-name">Class {{model.name}}</h1>
66
{{#if model.access}}<span class="access">{{model.access}}</span>{{/if}}
@@ -27,7 +27,7 @@
2727
<div class="attribute">
2828
<span class="attribute-label">Defined in:</span>
2929
<span class="attribute-value">
30-
<a href="{{github-link model.project.id model.projectVersion.version model.file model.line}}" target="_blank" rel="noopener">{{model.file}}:{{model.line}}</a>
30+
<a href="{{github-link model.project.id model.projectVersion.version model.file model.line}}" target="_blank" rel="noopener noreferrer">{{model.file}}:{{model.line}}</a>
3131
</span>
3232
</div>
3333
{{/if}}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"broccoli-merge-trees": "^2.0.0",
3434
"ember-a11y-testing": "^0.5.4",
3535
"ember-anchor": "^1.0.3",
36-
"ember-auto-import": "^1.5.3",
36+
"ember-auto-import": "1.2.21",
3737
"ember-cli": "~3.16.1",
3838
"ember-cli-app-version": "^3.2.0",
3939
"ember-cli-autoprefixer": "^1.0.0",

tests/acceptance/analytics-page-tracking-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module('Acceptance | analytics page tracking', function(hooks) {
1818
const applicationRouter = this.owner.lookup('router:main');
1919
const metricsService = this.owner.lookup('service:metrics');
2020

21-
const routerTrackPageSpy = sinon.spy(applicationRouter, '_trackPage');
21+
const routerTrackPageSpy = sinon.spy(applicationRouter, '__trackPage');
2222
const serviceTrackPageSpy = sinon.spy(metricsService, 'trackPage');
2323

2424
await visit(pages[0]);
@@ -29,7 +29,7 @@ module('Acceptance | analytics page tracking', function(hooks) {
2929

3030
assert.ok(
3131
routerTrackPageSpy.calledThrice,
32-
`_trackPage() was not called 3 times it was called ${routerTrackPageSpy.callCount} times`
32+
`__trackPage() was not called 3 times it was called ${routerTrackPageSpy.callCount} times`
3333
);
3434
assert.ok(
3535
serviceTrackPageSpy.calledThrice,

tests/integration/helpers/better-get-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import hbs from 'htmlbars-inline-precompile';
66
module('helper:better-get', function(hooks) {
77
setupRenderingTest(hooks);
88

9-
// Replace this with your real tests.
109
test('should get dot separated', async function(assert) {
1110
let obj = {
1211
'Ember.Object': 'hello'
@@ -16,7 +15,7 @@ module('helper:better-get', function(hooks) {
1615

1716
await render(hbs`{{better-get dataStructure key}}`);
1817

19-
assert.dom('*').hasText('hello');
18+
assert.dom(this.element).hasText('hello');
2019
});
2120

2221
test('should get rfc 176 module', async function(assert) {
@@ -28,6 +27,6 @@ module('helper:better-get', function(hooks) {
2827

2928
await render(hbs`{{better-get dataStructure key}}`);
3029

31-
assert.dom('*').hasText('hello');
30+
assert.dom(this.element).hasText('hello');
3231
});
3332
});

tests/integration/helpers/function-heading-id-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ module('helper:function-heading-id', function(hooks) {
1111

1212
await render(hbs`{{function-heading-id inputValue}}`);
1313

14-
assert.dom('*').hasText('functions-computed');
14+
assert.dom(this.element).hasText('functions-computed');
1515
});
1616
});

0 commit comments

Comments
 (0)