Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Place your settings in this file to overwrite default and user settings.
{
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"tslint.configFile": "tslint.test.json"
}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

### v0.1.1

- Enforce TSLint rules (see #54).

- Use `rimraf` instead of `rm -rf` (see #46).

- Update Prettier rules (see #45).
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@
"test": "nyc mocha",
"karma": "karma start --single-run",
"autoformat": "prettier --config .prettierrc --write {src,test}/**/*.ts",
"tslint-check": "tslint-config-prettier-check ./tslint.json",
"tslint-check:src": "tslint-config-prettier-check ./tslint.json",
"tslint-check:test": "tslint-config-prettier-check ./tslint.test.json",
"tslint:src": "tslint --project tsconfig.json",
"tslint:test": "tslint --config tslint.test.json --project tsconfig.test.json",
"tslint": "npm run tslint-check:src && npm run tslint-check:test && npm run tslint:src && npm run tslint:test",
"clean-up": "rimraf .nyc_output && rimraf coverage && rimraf lib",
"compile": "tsc -d",
"dev": "webpack",
"build": "webpack --env.production",
"prepare": "npm run clean-up && npm run compile",
"prepublishOnly": "publish-please guard",
"publish-please": "npm run autoformat && npm run clean-up && npm run test && publish-please"
"publish-please": "npm run tslint && npm run autoformat && npm run clean-up && npm run test && publish-please"
},
"nyc": {
"include": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
IClass,
IInjector,
IContext,
ILogger,
ICommandTrigger,
ICommandMapper,
ICommandUnmapper,
Expand All @@ -38,8 +37,6 @@ export class SignalCommandMap implements ISignalCommandMap {

private _triggerMap: CommandTriggerMap;

private _logger: ILogger;

/*============================================================================*/
/* Constructor */
/*============================================================================*/
Expand All @@ -49,7 +46,6 @@ export class SignalCommandMap implements ISignalCommandMap {
*/
constructor(@inject(IContext) context: IContext) {
this._injector = context.injector;
this._logger = context.getLogger(this);
this._triggerMap = new CommandTriggerMap(this.getKey, this.createTrigger.bind(this));
}

Expand Down
8 changes: 5 additions & 3 deletions test/entry.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/// <reference types="mocha" />

import "reflect-metadata";
import "bluebird/js/browser/bluebird";
import "es6-symbol/implement";
import "es6-map/implement";
import "bluebird";
import "es6-symbol";
import "es6-map";
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@

import "../../../../../entry.ts";

import sinon = require("sinon");

import { assert } from "chai";

import { ISignal, MonoSignal, OnceSignal, Signal, DeluxeSignal, PrioritySignal } from "@robotlegsjs/signals";
import { ISignal, Signal } from "@robotlegsjs/signals";

import { injectable, IContext, IInjector, ICommandMapper, ICommandUnmapper, Context, CommandMapper } from "@robotlegsjs/core";
import { IContext, ICommandMapper, Context, CommandMapper } from "@robotlegsjs/core";

import { SignalCommandMap } from "../../../../../../src/robotlegs/bender/extensions/signalCommandMap/impl/SignalCommandMap";

Expand All @@ -22,13 +20,11 @@ import { NullCommand } from "../support/NullCommand";
describe("SignalCommandMap", () => {
let signal: ISignal;
let context: IContext;
let injector: IInjector;
let subject: SignalCommandMap;

beforeEach(() => {
signal = new Signal();
context = new Context();
injector = context.injector;
subject = new SignalCommandMap(context);
});

Expand All @@ -39,7 +35,6 @@ describe("SignalCommandMap", () => {
}
signal = null;
context = null;
injector = null;
subject = null;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@

import "../../../../../entry.ts";

import sinon = require("sinon");

import { assert } from "chai";

import { ISignal, MonoSignal, OnceSignal, Signal, DeluxeSignal, PrioritySignal } from "@robotlegsjs/signals";

import { injectable, IContext, IInjector, ICommandMapper, ICommandUnmapper, Context, CommandMapper } from "@robotlegsjs/core";
import { IContext, IInjector, Context } from "@robotlegsjs/core";

import { ISignalCommandMap } from "../../../../../../src/robotlegs/bender/extensions/signalCommandMap/api/ISignalCommandMap";
import { SignalCommandMap } from "../../../../../../src/robotlegs/bender/extensions/signalCommandMap/impl/SignalCommandMap";
Expand Down Expand Up @@ -47,7 +43,7 @@ describe("SignalCommandMap", () => {
reportedExecutions.push(itemClass);
}

function commandExecutionCount(totalEvents: number = 1, oneshot: boolean = false, ...valueObjects): number {
function commandExecutionCount(totalEvents: number = 1, oneshot: boolean = false, ...valueObjects: any[]): number {
let executeCount: number = 0;

injector
Expand Down Expand Up @@ -75,7 +71,7 @@ describe("SignalCommandMap", () => {
return commandExecutionCount(totalEvents, true);
}

function hookCallCount(...hooks): number {
function hookCallCount(...hooks: any[]): number {
let callCount: number = 0;

injector
Expand All @@ -101,7 +97,7 @@ describe("SignalCommandMap", () => {
return callCount;
}

function commandExecutionCountWithGuards(...guards): number {
function commandExecutionCountWithGuards(...guards: any[]): number {
let executionCount: number = 0;

injector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import sinon = require("sinon");

import { assert } from "chai";

import { ISignal, MonoSignal, OnceSignal, Signal, DeluxeSignal, PrioritySignal } from "@robotlegsjs/signals";
import { ISignal, Signal } from "@robotlegsjs/signals";

import { injectable, IInjector, RobotlegsInjector, CommandMapper } from "@robotlegsjs/core";
import { IInjector, RobotlegsInjector, CommandMapper } from "@robotlegsjs/core";

import { SignalCommandTrigger } from "../../../../../../src/robotlegs/bender/extensions/signalCommandMap/impl/SignalCommandTrigger";

Expand Down Expand Up @@ -150,7 +150,7 @@ describe("SignalCommandTrigger", () => {
injector.bind(Signal).toConstantValue(signal);
mapper = subject.createMapper();
mapper.toCommand(CallbackParametersCommand);
signal.dispatch.apply(signal, expected);
signal.dispatch.apply(signal, parameters);

assert.deepEqual(actual, expected);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// in accordance with the terms of the license agreement accompanying it.
// ------------------------------------------------------------------------------

import { injectable, inject, named } from "inversify";
import { injectable } from "inversify";

import { ICommand } from "@robotlegsjs/core";

Expand Down
7 changes: 3 additions & 4 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-debugger": true,
"no-duplicate-variable": true,
"no-empty": true,
"no-empty": false,
"no-empty-interface": false,
"no-eval": true,
"no-inferrable-types": false,
"no-shadowed-variable": true,
Expand All @@ -49,10 +49,9 @@
"no-this-assignment": false,
"no-unused-expression": true,
"no-unused-variable": true,
"no-unreachable": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"object-literal-sort-keys": true,
"object-literal-sort-keys": false,
"ordered-imports": false,
"only-arrow-functions": [ false ],
"prefer-const": false,
Expand Down
8 changes: 8 additions & 0 deletions tslint.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": [
"./tslint.json"
],
"rules": {
"no-implicit-dependencies": false
}
}