Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve no-unused-vars, no-undef eslint warnings #14870

Closed
wants to merge 10 commits into from
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ var options = {
rules: {
'ember-internal/require-yuidoc-access': 'error',
'ember-internal/no-const-outside-module-scope': 'error',
'no-unused-vars': ["error", { "args": "none" }],

// temporarily disabled
'no-unused-vars': 'off',
'comma-dangle': 'off',
},
};
Expand Down
2 changes: 1 addition & 1 deletion packages/ember-application/lib/system/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ const Application = Engine.extend({
*/
_globalsMode: true,

init(options) {
init() {
this._super(...arguments);

if (!this.$) {
Expand Down
2 changes: 1 addition & 1 deletion packages/ember-application/lib/system/resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export default EmberObject.extend({
return description;
},

makeToString(factory, fullName) {
makeToString(factory) {
return factory.toString();
},

Expand Down
1 change: 1 addition & 0 deletions packages/ember-console/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* global console */
import { context } from 'ember-environment';

function K() {}
Expand Down
2 changes: 1 addition & 1 deletion packages/ember-glimmer/lib/components/link-to.js
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ const LinkComponent = EmberComponent.extend({
@private
*/
disabled: computed({
get(key, value) {
get() {
return false;
},
set(key, value) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { observer, set, computed } from 'ember-metal';
import { set } from 'ember-metal';
import { Controller } from 'ember-runtime';
import { RenderingTest, moduleFor } from '../../utils/test-case';
import { EMBER_GLIMMER_ALLOW_BACKTRACKING_RERENDER } from 'ember/features';
Expand Down Expand Up @@ -235,12 +235,8 @@ moduleFor('Helpers test: {{render}}', class extends RenderingTest {
this.owner.register('controller:post', Controller.extend());
this.registerTemplate('post', '<p>{{model.title}}</p>');

let postDidChange = 0;
expectDeprecation(() => {
this.render(`<h1>HI</h1>{{render 'post' post}}`, {
postDidChange: observer('post', function() {
postDidChange++;
}),
post: {
title: `It's Simple Made Easy`
}
Expand Down
1 change: 0 additions & 1 deletion packages/ember-metal/lib/mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import {
removeListener
} from './events';

const a_slice = Array.prototype.slice;
const a_concat = Array.prototype.concat;
const { isArray } = Array;

Expand Down
5 changes: 0 additions & 5 deletions packages/ember-metal/tests/accessors/get_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ testBoth('should call unknownProperty on watched values if the value is undefine
}
};

let count = 0;
addObserver(obj, 'foo', function() {
count++;
});

equal(get(obj, 'foo'), 'FOO', 'should return value from unknown');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ function assertHasClass(className) {
}
}

let updateCount, replaceCount;

function sharedSetup() {
App = Application.create({
name: 'App',
Expand All @@ -35,16 +33,13 @@ function sharedSetup() {

App.deferReadiness();

updateCount = replaceCount = 0;
App.Router.reopen({
location: NoneLocation.create({
setURL(path) {
updateCount++;
set(this, 'path', path);
},

replaceURL(path) {
replaceCount++;
set(this, 'path', path);
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ function checkActive(selector, active) {
equal(classList.indexOf('active') > -1, active, selector + ' active should be ' + active.toString());
}

let updateCount, replaceCount;

function sharedSetup() {
App = Application.create({
name: 'App',
Expand All @@ -37,16 +35,13 @@ function sharedSetup() {

App.deferReadiness();

updateCount = replaceCount = 0;
App.Router.reopen({
location: NoneLocation.create({
setURL(path) {
updateCount++;
set(this, 'path', path);
},

replaceURL(path) {
replaceCount++;
set(this, 'path', path);
}
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { inject } from 'ember-runtime';
import { Component } from 'ember-glimmer';
import { Route, NoneLocation } from 'ember-routing';
import {
get,
set
} from 'ember-metal';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
readOnly
} from 'ember-runtime';
import { Component } from 'ember-glimmer';
import { Route, NoneLocation } from 'ember-routing';
import { Route } from 'ember-routing';
import { get } from 'ember-metal';
import {
RouterTestCase,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { Component } from 'ember-glimmer';
import { Route, NoneLocation } from 'ember-routing';
import {
run,
get,
set
get
} from 'ember-metal';
import {
RouterTestCase,
Expand Down
2 changes: 1 addition & 1 deletion packages/external-helpers/lib/external-helpers-prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ export const possibleConstructorReturn = (function (self, call) {
return call && (typeof call === 'object' || typeof call === 'function') ? call : self;
});

export const slice = Array.prototype.slice;
export const slice = Array.prototype.slice;
3 changes: 3 additions & 0 deletions packages/loader/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* global process */
var enifed, requireModule, Ember;

// eslint-disable-next-line no-unused-vars
var mainContext = this; // Used in ember-environment/lib/global.js

(function() {
Expand Down