diff --git a/addon/.eslintrc.js b/addon/.eslintrc.js index a241daa..309c00c 100644 --- a/addon/.eslintrc.js +++ b/addon/.eslintrc.js @@ -1,6 +1,7 @@ -/* eslint-env node */ - module.exports = { root: true, - extends: '@clark/ember-typescript' + extends: '@clark/ember-typescript', + rules: { + '@typescript-eslint/no-invalid-this': 'off' + } }; diff --git a/addon/debounce.ts b/addon/debounce.ts index adadc5f..31d5308 100644 --- a/addon/debounce.ts +++ b/addon/debounce.ts @@ -1,8 +1,10 @@ import { decoratorWithRequiredParams } from '@ember-decorators/utils/decorator'; -import { debounceTask } from 'ember-lifeline'; -import hookDisposablesRunner from './hook-disposables-runner'; import { assert } from '@ember/debug'; import EmberObject from '@ember/object'; + +import { debounceTask } from 'ember-lifeline'; + +import hookDisposablesRunner from './hook-disposables-runner'; import privateAlias from './utils/private-alias'; import { Prototype } from './utils/type-helpers'; @@ -26,7 +28,7 @@ export default decoratorWithRequiredParams(function debounce< key, desc, alias => - function(this: InstanceType, ...args: any[]) { + function (this: InstanceType, ...args: any[]) { return debounceTask(this, alias, ...args, wait, immediate); } ); diff --git a/addon/disposable.ts b/addon/disposable.ts index 07945ea..67df5f2 100644 --- a/addon/disposable.ts +++ b/addon/disposable.ts @@ -1,10 +1,13 @@ -import { registerDisposable } from 'ember-lifeline'; -import hookDisposablesRunner from './hook-disposables-runner'; +import { decoratorWithParams } from '@ember-decorators/utils/decorator'; import { assert } from '@ember/debug'; -import { afterMethod } from 'patch-method'; import EmberObject from '@ember/object'; + +import { registerDisposable } from 'ember-lifeline'; + +import { afterMethod } from 'patch-method'; + +import hookDisposablesRunner from './hook-disposables-runner'; import { Prototype } from './utils/type-helpers'; -import { decoratorWithParams } from '@ember-decorators/utils/decorator'; export default decoratorWithParams(function disposable< Target extends Prototype @@ -20,7 +23,7 @@ export default decoratorWithParams(function disposable< hookDisposablesRunner(target.constructor); - afterMethod(target.constructor, 'init', function() { + afterMethod(target.constructor, 'init', function () { // `.bind` is required because ember-lifeline does not set the correct context registerDisposable(this, desc.value.bind(this)); }); diff --git a/addon/event-listener.ts b/addon/event-listener.ts index 55f98c1..a2926f7 100644 --- a/addon/event-listener.ts +++ b/addon/event-listener.ts @@ -1,20 +1,26 @@ import { decoratorWithRequiredParams } from '@ember-decorators/utils/decorator'; -import { addEventListener } from 'ember-lifeline'; -import hookDisposablesRunner from './hook-disposables-runner'; +import Component from '@ember/component'; import { assert } from '@ember/debug'; import EmberObject from '@ember/object'; + +import { addEventListener } from 'ember-lifeline'; + import { afterMethod } from 'patch-method'; -import Component from '@ember/component'; + +import hookDisposablesRunner from './hook-disposables-runner'; import { Prototype, Constructor } from './utils/type-helpers'; +// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-function function NOOP(): void {} function collapseProto(target: Prototype) { // We must collapse the superclass prototype to make sure that the `actions` // object will exist. Since collapsing doesn't generally happen until a class is // instantiated, we have to do it manually. + // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore if (typeof target.constructor.proto === 'function') { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore target.constructor.proto(); } @@ -29,6 +35,7 @@ export default decoratorWithRequiredParams(function eventListener< [eventTarget, eventName, options]: [ EventTarget | ((this: Component, obj: Component) => EventTarget), string, + // eslint-disable-next-line @typescript-eslint/ban-types object? ] ): PropertyDescriptor { @@ -45,9 +52,10 @@ export default decoratorWithRequiredParams(function eventListener< typeof target.constructor.prototype.didInsertElement === 'function' ? 'didInsertElement' : 'init', - function() { + function () { addEventListener( this, + // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore https://github.com/ember-lifeline/ember-lifeline/pull/249 typeof eventTarget === 'function' ? eventTarget.call(this, this) diff --git a/addon/hook-disposables-runner.ts b/addon/hook-disposables-runner.ts index 37998a8..1d5d542 100644 --- a/addon/hook-disposables-runner.ts +++ b/addon/hook-disposables-runner.ts @@ -1,5 +1,7 @@ import EmberObject from '@ember/object'; + import { runDisposables } from 'ember-lifeline'; + import { Constructor } from './utils/type-helpers'; const hookedWithDisposables = new WeakSet>(); @@ -16,7 +18,7 @@ export default function hookDisposablesRunner( prototype, 'willDestroy' ); - prototype.willDestroy = function(...args: any[]) { + prototype.willDestroy = function (...args: any[]) { runDisposables(this); if (originalMethod) { return originalMethod.value.apply(this, args); diff --git a/addon/later.ts b/addon/later.ts index a82e34f..d712ade 100644 --- a/addon/later.ts +++ b/addon/later.ts @@ -1,8 +1,10 @@ import { decoratorWithRequiredParams } from '@ember-decorators/utils/decorator'; -import { runTask } from 'ember-lifeline'; -import hookDisposablesRunner from './hook-disposables-runner'; import { assert } from '@ember/debug'; import EmberObject from '@ember/object'; + +import { runTask } from 'ember-lifeline'; + +import hookDisposablesRunner from './hook-disposables-runner'; import { Prototype } from './utils/type-helpers'; export default decoratorWithRequiredParams(function later< diff --git a/addon/schedule.ts b/addon/schedule.ts index 4930ec1..17780bb 100644 --- a/addon/schedule.ts +++ b/addon/schedule.ts @@ -1,8 +1,10 @@ import { decoratorWithRequiredParams } from '@ember-decorators/utils/decorator'; -import { scheduleTask } from 'ember-lifeline'; -import hookDisposablesRunner from './hook-disposables-runner'; import { assert } from '@ember/debug'; import EmberObject from '@ember/object'; + +import { scheduleTask } from 'ember-lifeline'; + +import hookDisposablesRunner from './hook-disposables-runner'; import { Prototype } from './utils/type-helpers'; /** diff --git a/addon/throttle.ts b/addon/throttle.ts index d801231..8414648 100644 --- a/addon/throttle.ts +++ b/addon/throttle.ts @@ -1,8 +1,10 @@ import { decoratorWithRequiredParams } from '@ember-decorators/utils/decorator'; -import { throttleTask } from 'ember-lifeline'; -import hookDisposablesRunner from './hook-disposables-runner'; import { assert } from '@ember/debug'; import EmberObject from '@ember/object'; + +import { throttleTask } from 'ember-lifeline'; + +import hookDisposablesRunner from './hook-disposables-runner'; import privateAlias from './utils/private-alias'; import { Prototype } from './utils/type-helpers'; @@ -26,7 +28,7 @@ export default decoratorWithRequiredParams(function throttle< key, desc, alias => - function(this: InstanceType, ...args: any[]) { + function (this: InstanceType, ...args: any[]) { return throttleTask(this, alias, ...args, spacing, immediate); } ); diff --git a/addon/utils/private-alias.ts b/addon/utils/private-alias.ts index e11c177..3b73649 100644 --- a/addon/utils/private-alias.ts +++ b/addon/utils/private-alias.ts @@ -1,12 +1,11 @@ +// eslint-disable-next-line @typescript-eslint/ban-types export default function privateAlias( target: Target, key: keyof Target, desc: PropertyDescriptor, makeValue: (alias: string) => any ): PropertyDescriptor { - const privateKey = `__${String(key)}-${Math.random() - .toString(36) - .slice(2)}`; + const privateKey = `__${String(key)}-${Math.random().toString(36).slice(2)}`; Object.defineProperty(target, privateKey, { ...desc, diff --git a/config/ember-try.js b/config/ember-try.js index 23305cd..936065f 100644 --- a/config/ember-try.js +++ b/config/ember-try.js @@ -2,7 +2,7 @@ const getChannelURL = require('ember-source-channel-url'); -module.exports = function() { +module.exports = function () { return Promise.all([ getChannelURL('release'), getChannelURL('beta'), diff --git a/config/environment.js b/config/environment.js index 9707ea6..331ab30 100644 --- a/config/environment.js +++ b/config/environment.js @@ -1,5 +1,5 @@ 'use strict'; -module.exports = function(/* environment, appConfig */) { +module.exports = function (/* environment, appConfig */) { return {}; }; diff --git a/ember-cli-build.js b/ember-cli-build.js index 8ecf29f..28e9e62 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -2,7 +2,7 @@ const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); -module.exports = function(defaults) { +module.exports = function (defaults) { const app = new EmberAddon(defaults, { // Add options here }); diff --git a/tests/.eslintrc.js b/tests/.eslintrc.js index a241daa..9974bec 100644 --- a/tests/.eslintrc.js +++ b/tests/.eslintrc.js @@ -1,6 +1,7 @@ -/* eslint-env node */ - module.exports = { root: true, - extends: '@clark/ember-typescript' + extends: '@clark/ember-typescript/test', + rules: { + '@typescript-eslint/no-invalid-this': 'off' + } }; diff --git a/tests/dummy/app/app.js b/tests/dummy/app/app.ts similarity index 50% rename from tests/dummy/app/app.js rename to tests/dummy/app/app.ts index b3b2bd6..fea0a7e 100644 --- a/tests/dummy/app/app.js +++ b/tests/dummy/app/app.ts @@ -1,14 +1,15 @@ import Application from '@ember/application'; -import Resolver from './resolver'; + import loadInitializers from 'ember-load-initializers'; + import config from './config/environment'; +import Resolver from './resolver'; -const App = Application.extend({ - modulePrefix: config.modulePrefix, - podModulePrefix: config.podModulePrefix, - Resolver -}); +export default class App extends Application { + modulePrefix = config.modulePrefix; + podModulePrefix = config.podModulePrefix; + // eslint-disable-next-line @typescript-eslint/naming-convention + Resolver = Resolver; +} loadInitializers(App, config.modulePrefix); - -export default App; diff --git a/tests/dummy/app/resolver.js b/tests/dummy/app/resolver.ts similarity index 100% rename from tests/dummy/app/resolver.js rename to tests/dummy/app/resolver.ts diff --git a/tests/dummy/app/router.js b/tests/dummy/app/router.js deleted file mode 100644 index 53c53c6..0000000 --- a/tests/dummy/app/router.js +++ /dev/null @@ -1,11 +0,0 @@ -import EmberRouter from '@ember/routing/router'; -import config from './config/environment'; - -const Router = EmberRouter.extend({ - location: config.locationType, - rootURL: config.rootURL -}); - -Router.map(function() {}); - -export default Router; diff --git a/tests/dummy/app/router.ts b/tests/dummy/app/router.ts new file mode 100644 index 0000000..bb6e77c --- /dev/null +++ b/tests/dummy/app/router.ts @@ -0,0 +1,10 @@ +import EmberRouter from '@ember/routing/router'; + +import config from './config/environment'; + +export default class Router extends EmberRouter { + location = config.locationType; + rootURL = config.rootURL; +} + +Router.map(function () {}); diff --git a/tests/dummy/config/environment.js b/tests/dummy/config/environment.js index 851dd0a..04c4c51 100644 --- a/tests/dummy/config/environment.js +++ b/tests/dummy/config/environment.js @@ -1,6 +1,6 @@ 'use strict'; -module.exports = function(environment) { +module.exports = function (environment) { const ENV = { modulePrefix: 'dummy', environment, diff --git a/tests/helpers/in-run-loop.ts b/tests/helpers/in-run-loop.ts index 75538f0..d158ac4 100644 --- a/tests/helpers/in-run-loop.ts +++ b/tests/helpers/in-run-loop.ts @@ -6,11 +6,11 @@ import { begin, end } from '@ember/runloop'; * @param {object} hooks QUnit Hooks */ export default function inRunLoop(hooks: NestedHooks): void { - hooks.beforeEach(function() { + hooks.beforeEach(function () { begin(); }); - hooks.afterEach(function() { + hooks.afterEach(function () { end(); }); } diff --git a/tests/integration/event-listener-test.ts b/tests/integration/event-listener-test.ts index e12cee0..d2db4a8 100644 --- a/tests/integration/event-listener-test.ts +++ b/tests/integration/event-listener-test.ts @@ -1,14 +1,17 @@ -import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; import { render, click } from '@ember/test-helpers'; -import hbs from 'htmlbars-inline-precompile'; -import { eventListener } from 'ember-lifeline-decorators'; +import { setupRenderingTest } from 'ember-qunit'; +import { module, test } from 'qunit'; + import Component from '@ember/component'; -module('@eventListener', function(hooks) { +import { eventListener } from 'ember-lifeline-decorators'; + +import hbs from 'htmlbars-inline-precompile'; + +module('@eventListener', function (hooks) { setupRenderingTest(hooks); - test('it can be used on a component', async function(assert) { + test('it can be used on a component', async function (assert) { assert.expect(1); class TestComponent extends Component { @@ -25,7 +28,7 @@ module('@eventListener', function(hooks) { await click(this.element.querySelector('#test-component')!); }); - test('it accepts `this.element` as target', async function(assert) { + test('it accepts `this.element` as target', async function (assert) { assert.expect(1); class TestComponent extends Component { @@ -42,7 +45,7 @@ module('@eventListener', function(hooks) { await click(this.element.querySelector('#test-component')!); }); - test('it calls the callback after `didInsertElement`', async function(assert) { + test('it calls the callback after `didInsertElement`', async function (assert) { assert.expect(1); let didCall = false; diff --git a/tests/test-helper.js b/tests/test-helper.js index 0382a84..d186e5f 100644 --- a/tests/test-helper.js +++ b/tests/test-helper.js @@ -1,8 +1,9 @@ -import Application from '../app'; -import config from '../config/environment'; import { setApplication } from '@ember/test-helpers'; import { start } from 'ember-qunit'; +import Application from '../app'; +import config from '../config/environment'; + setApplication(Application.create(config.APP)); start(); diff --git a/tests/unit/debounce-test.ts b/tests/unit/debounce-test.ts index 490b154..2327b11 100644 --- a/tests/unit/debounce-test.ts +++ b/tests/unit/debounce-test.ts @@ -1,41 +1,50 @@ -import EmberObject from '@ember/object'; +/* eslint-disable qunit/no-commented-tests */ import { module, test } from 'qunit'; + +import EmberObject from '@ember/object'; + import { debounce } from 'ember-lifeline-decorators'; + import delay from 'delay'; + import inRunLoop from 'dummy/tests/helpers/in-run-loop'; -module('@debounce', function(hooks) { +module('@debounce', function (hooks) { inRunLoop(hooks); - test('can decorate methods', async function(assert) { + test('can decorate methods', async function (assert) { assert.expect(4); let runCount = 0; - let runArg: string; + let runArgument: string; class TestObject extends EmberObject { @debounce(5) - doStuff(arg: string) { + doStuff(argument: string) { runCount++; // eslint-disable-next-line @typescript-eslint/no-use-before-define - assert.equal(this, obj, 'context is correct'); - runArg = arg; + assert.strictEqual(this, object, 'context is correct'); + runArgument = argument; } } - const obj = TestObject.create(); + const object = TestObject.create(); - obj.doStuff('arg1'); - obj.doStuff('arg2'); - obj.doStuff('arg3'); + object.doStuff('arg1'); + object.doStuff('arg2'); + object.doStuff('arg3'); - assert.equal(runCount, 0, 'should not have run'); + assert.strictEqual(runCount, 0, 'should not have run'); await delay(10); - assert.equal(runCount, 1, 'should have run only once'); + assert.strictEqual(runCount, 1, 'should have run only once'); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - assert.equal(runArg!, 'arg3', 'should run the task with the last arg'); + assert.strictEqual( + runArgument!, + 'arg3', + 'should run the task with the last arg' + ); }); // test('debounceTask can be canceled', function(assert) { diff --git a/tests/unit/disposable-test.ts b/tests/unit/disposable-test.ts index 0bf5be9..3961d72 100644 --- a/tests/unit/disposable-test.ts +++ b/tests/unit/disposable-test.ts @@ -1,12 +1,15 @@ -import EmberObject from '@ember/object'; import { module, test } from 'qunit'; + +import EmberObject from '@ember/object'; + import { disposable } from 'ember-lifeline-decorators'; + import inRunLoop, { next } from 'dummy/tests/helpers/in-run-loop'; -module('@disposable', function(hooks) { +module('@disposable', function (hooks) { inRunLoop(hooks); - test('can decorate methods', async function(assert) { + test('can decorate methods', async function (assert) { assert.expect(3); let runCount = 0; @@ -16,18 +19,18 @@ module('@disposable', function(hooks) { doStuff() { runCount++; // eslint-disable-next-line @typescript-eslint/no-use-before-define - assert.equal(this, obj, 'context is correct'); + assert.strictEqual(this, object, 'context is correct'); } } - const obj = TestObject.create(); + const object = TestObject.create(); - assert.equal(runCount, 0, 'should not have run'); + assert.strictEqual(runCount, 0, 'should not have run'); - obj.destroy(); + object.destroy(); next(); - assert.equal(runCount, 1, 'should have run'); + assert.strictEqual(runCount, 1, 'should have run'); }); }); diff --git a/tests/unit/event-listener-test.ts b/tests/unit/event-listener-test.ts index 377a291..1b28176 100644 --- a/tests/unit/event-listener-test.ts +++ b/tests/unit/event-listener-test.ts @@ -1,39 +1,42 @@ -import EmberObject from '@ember/object'; import { module, test } from 'qunit'; + +import EmberObject from '@ember/object'; + import { eventListener } from 'ember-lifeline-decorators'; + import inRunLoop, { next } from 'dummy/tests/helpers/in-run-loop'; -module('@eventListener', function(hooks) { +module('@eventListener', function (hooks) { inRunLoop(hooks); - test('can decorate methods', async function(assert) { + test('can decorate methods', async function (assert) { assert.expect(4); let runCount = 0; - let runArg: MouseEvent; + let runArgument: MouseEvent; class TestObject extends EmberObject { @eventListener(window, 'click', { once: true }) - doStuff(arg: MouseEvent) { + doStuff(argument: MouseEvent) { runCount++; // eslint-disable-next-line @typescript-eslint/no-use-before-define - assert.equal(this, obj, 'context is correct'); - runArg = arg; + assert.strictEqual(this, object, 'context is correct'); + runArgument = argument; } } - const obj = TestObject.create(); + const object = TestObject.create(); - assert.equal(runCount, 0, 'should not have run'); + assert.strictEqual(runCount, 0, 'should not have run'); document.body.click(); next(); - assert.equal(runCount, 1, 'should have run'); + assert.strictEqual(runCount, 1, 'should have run'); assert.ok( // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - runArg! instanceof MouseEvent, + runArgument! instanceof MouseEvent, 'should pass the event to the hook' ); }); diff --git a/tests/unit/later-test.ts b/tests/unit/later-test.ts index ff66195..bf5d8a1 100644 --- a/tests/unit/later-test.ts +++ b/tests/unit/later-test.ts @@ -1,39 +1,48 @@ -import EmberObject from '@ember/object'; +/* eslint-disable qunit/no-commented-tests */ import { module, test } from 'qunit'; + +import EmberObject from '@ember/object'; + import { later } from 'ember-lifeline-decorators'; + import delay from 'delay'; + import inRunLoop from 'dummy/tests/helpers/in-run-loop'; -module('@later', function(hooks) { +module('@later', function (hooks) { inRunLoop(hooks); - test('can decorate methods', async function(assert) { + test('can decorate methods', async function (assert) { assert.expect(4); let runCount = 0; - let runArg: string; + let runArgument: string; class TestObject extends EmberObject { @later(5) - doStuff(arg: string) { + doStuff(argument: string) { runCount++; // eslint-disable-next-line @typescript-eslint/no-use-before-define - assert.equal(this, obj, 'context is correct'); - runArg = arg; + assert.strictEqual(this, object, 'context is correct'); + runArgument = argument; } } - const obj = TestObject.create(); + const object = TestObject.create(); - obj.doStuff('arg1'); + object.doStuff('arg1'); - assert.equal(runCount, 0, 'should not have run'); + assert.strictEqual(runCount, 0, 'should not have run'); await delay(10); - assert.equal(runCount, 1, 'should have run'); + assert.strictEqual(runCount, 1, 'should have run'); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - assert.equal(runArg!, 'arg1', 'should run the task with the arg'); + assert.strictEqual( + runArgument!, + 'arg1', + 'should run the task with the arg' + ); }); // test('debounceTask can be canceled', function(assert) { diff --git a/tests/unit/schedule-test.ts b/tests/unit/schedule-test.ts index 0156a07..ad5c881 100644 --- a/tests/unit/schedule-test.ts +++ b/tests/unit/schedule-test.ts @@ -1,38 +1,46 @@ -import EmberObject from '@ember/object'; +/* eslint-disable qunit/no-commented-tests */ import { module, test } from 'qunit'; + +import EmberObject from '@ember/object'; + import { schedule } from 'ember-lifeline-decorators'; + import inRunLoop, { next } from 'dummy/tests/helpers/in-run-loop'; -module('@schedule', function(hooks) { +module('@schedule', function (hooks) { inRunLoop(hooks); - test('can decorate methods', async function(assert) { + test('can decorate methods', async function (assert) { assert.expect(4); let runCount = 0; - let runArg: string; + let runArgument: string; class TestObject extends EmberObject { @schedule('actions') - doStuff(arg: string) { + doStuff(argument: string) { runCount++; // eslint-disable-next-line @typescript-eslint/no-use-before-define - assert.equal(this, obj, 'context is correct'); - runArg = arg; + assert.strictEqual(this, object, 'context is correct'); + runArgument = argument; } } - const obj = TestObject.create(); + const object = TestObject.create(); - obj.doStuff('arg1'); + object.doStuff('arg1'); - assert.equal(runCount, 0, 'should not have run'); + assert.strictEqual(runCount, 0, 'should not have run'); next(); - assert.equal(runCount, 1, 'should have run'); + assert.strictEqual(runCount, 1, 'should have run'); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - assert.equal(runArg!, 'arg1', 'should run the task with the arg'); + assert.strictEqual( + runArgument!, + 'arg1', + 'should run the task with the arg' + ); }); // test('debounceTask can be canceled', function(assert) { diff --git a/tests/unit/throttle-test.ts b/tests/unit/throttle-test.ts index 025d1b0..6a208b9 100644 --- a/tests/unit/throttle-test.ts +++ b/tests/unit/throttle-test.ts @@ -1,41 +1,50 @@ -import EmberObject from '@ember/object'; +/* eslint-disable qunit/no-commented-tests */ import { module, test } from 'qunit'; + +import EmberObject from '@ember/object'; + import { throttle } from 'ember-lifeline-decorators'; + import delay from 'delay'; + import inRunLoop from 'dummy/tests/helpers/in-run-loop'; -module('@throttle', function(hooks) { +module('@throttle', function (hooks) { inRunLoop(hooks); - test('can decorate methods', async function(assert) { + test('can decorate methods', async function (assert) { assert.expect(4); let runCount = 0; - let runArg: string; + let runArgument: string; class TestObject extends EmberObject { @throttle(5) - doStuff(arg: string) { + doStuff(argument: string) { runCount++; // eslint-disable-next-line @typescript-eslint/no-use-before-define - assert.equal(this, obj, 'context is correct'); - runArg = arg; + assert.strictEqual(this, object, 'context is correct'); + runArgument = argument; } } - const obj = TestObject.create(); + const object = TestObject.create(); - obj.doStuff('arg1'); - obj.doStuff('arg2'); - obj.doStuff('arg3'); + object.doStuff('arg1'); + object.doStuff('arg2'); + object.doStuff('arg3'); - assert.equal(runCount, 1, 'should have run once'); + assert.strictEqual(runCount, 1, 'should have run once'); await delay(10); - assert.equal(runCount, 1, 'should have run only once'); + assert.strictEqual(runCount, 1, 'should have run only once'); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - assert.equal(runArg!, 'arg1', 'should run the task with the first arg'); + assert.strictEqual( + runArgument!, + 'arg1', + 'should run the task with the first arg' + ); }); // test('debounceTask can be canceled', function(assert) { diff --git a/types/@ember-decorators/utils/decorator.d.ts b/types/@ember-decorators/utils/decorator.d.ts index 445353e..b6f926e 100644 --- a/types/@ember-decorators/utils/decorator.d.ts +++ b/types/@ember-decorators/utils/decorator.d.ts @@ -17,6 +17,7 @@ */ export function decoratorWithParams< Params extends any[], + // eslint-disable-next-line @typescript-eslint/ban-types Target extends object >( fn: ( @@ -47,6 +48,7 @@ export function decoratorWithParams< */ export function decoratorWithRequiredParams< Params extends any[], + // eslint-disable-next-line @typescript-eslint/ban-types Target extends object >( fn: (