From 0bc801850e4c26679064204fac6ccae92cfbb994 Mon Sep 17 00:00:00 2001 From: James Ferguson Date: Sat, 10 Nov 2018 00:22:10 +1100 Subject: [PATCH] chore: set typescript to strict mode --- package.json | 4 +-- src/builder.ts | 6 ++-- src/clause-collection.ts | 2 +- src/clauses/node-pattern.ts | 2 +- src/clauses/pattern.ts | 4 +-- src/clauses/relation-pattern.ts | 2 +- src/clauses/return.ts | 5 ++-- src/clauses/set.ts | 18 ++++++------ src/clauses/skip.ts | 3 +- src/clauses/term-list-clause.ts | 27 ++++++++++-------- src/clauses/where-comparators.spec.ts | 9 ++++-- src/clauses/where-operators.ts | 9 +++--- src/clauses/with.ts | 5 ++-- src/connection.ts | 40 ++++++++++++++------------- src/parameter-bag.spec.ts | 2 +- src/parameter-container.ts | 2 +- src/query.spec.ts | 16 ++++++----- src/query.ts | 4 +-- src/utils.ts | 28 +++++++++++-------- tests/connection.mock.ts | 2 +- tests/connection.test.ts | 2 +- tests/scenarios.test.ts | 8 +++--- tests/utils.ts | 9 +++--- tsconfig.declaration.json | 10 +++++++ tsconfig.json | 27 +++++++----------- tsconfig.lint.json | 11 -------- typings/node-cleanup.d.ts | 4 +++ 27 files changed, 139 insertions(+), 122 deletions(-) create mode 100644 tsconfig.declaration.json delete mode 100644 tsconfig.lint.json create mode 100644 typings/node-cleanup.d.ts diff --git a/package.json b/package.json index faf97dc3..5e5ab306 100644 --- a/package.json +++ b/package.json @@ -24,9 +24,9 @@ "scripts": { "commit": "git-cz", "build": "yarn build:declaration && yarn build:rollup", - "build:declaration": "tsc --project tsconfig.json --outDir dist/typings --declaration --emitDeclarationOnly", + "build:declaration": "tsc --project tsconfig.declaration.json --outDir dist/typings --declaration --emitDeclarationOnly", "build:rollup": "rollup -c", - "lint": "tslint --project ./tsconfig.lint.json", + "lint": "tslint --project ./tsconfig.json", "test": "docker-compose -f docker/docker-compose.test.yml -p cypher-query-builder up --exit-code-from tests", "test:unit": "nyc --reporter=html --reporter=text-summary mocha src/*.spec.ts src/**/*.spec.ts", "validate": "yarn --silent lint && yarn --silent build && yarn --silent test", diff --git a/src/builder.ts b/src/builder.ts index 081a0845..91935d8d 100644 --- a/src/builder.ts +++ b/src/builder.ts @@ -18,7 +18,7 @@ import { RemoveProperties } from './clauses/remove'; * @internal */ export interface WrapperClause { - new (clause: Clause): Clause; + new (clause: Set): Clause; } /** @@ -155,7 +155,7 @@ export class SetBlock { return this.chain(this.wrap(new Set({ variables }, { override }))); } - private wrap(clause: Clause): Clause { + private wrap(clause: Set): Clause { return this.wrapper ? new this.wrapper(clause) : clause; } } @@ -253,7 +253,7 @@ export abstract class Builder extends SetBlock { * @returns {Q} */ createNode( - name?: Many | Dictionary, + name: Many | Dictionary, labels?: Many | Dictionary, conditions?: Dictionary, ) { diff --git a/src/clause-collection.ts b/src/clause-collection.ts index c5b4184c..69eda6e4 100644 --- a/src/clause-collection.ts +++ b/src/clause-collection.ts @@ -16,7 +16,7 @@ export class ClauseCollection extends Clause { * Adds a clause to the child list. * @param {Clause} clause */ - addClause(clause) { + addClause(clause: Clause) { clause.useParameterBag(this.parameterBag); this.clauses.push(clause); } diff --git a/src/clauses/node-pattern.ts b/src/clauses/node-pattern.ts index a03b48f3..3561fd61 100644 --- a/src/clauses/node-pattern.ts +++ b/src/clauses/node-pattern.ts @@ -3,7 +3,7 @@ import { Pattern } from './pattern'; export class NodePattern extends Pattern { constructor( - name: Many | Dictionary, + name?: Many | Dictionary, labels?: Many | Dictionary, conditions?: Dictionary, ) { diff --git a/src/clauses/pattern.ts b/src/clauses/pattern.ts index d2883dea..47c0202b 100644 --- a/src/clauses/pattern.ts +++ b/src/clauses/pattern.ts @@ -7,8 +7,8 @@ import { Parameter } from '../parameter-bag'; import { stringifyLabels } from '../utils'; export abstract class Pattern extends Clause { - protected useExpandedConditions: boolean; - protected conditionParams = {}; + protected useExpandedConditions: boolean | undefined; + protected conditionParams: Dictionary | Parameter = {}; protected name: string; protected labels: string[]; protected conditions: Dictionary; diff --git a/src/clauses/relation-pattern.ts b/src/clauses/relation-pattern.ts index f193759f..c28ce165 100644 --- a/src/clauses/relation-pattern.ts +++ b/src/clauses/relation-pattern.ts @@ -2,7 +2,7 @@ import { Dictionary, trim, Many, isNil, isNumber, isArray, every } from 'lodash' import { Pattern } from './pattern'; import { PathLength, stringifyPathLength } from '../utils'; -const isPathLengthArray = value => ( +const isPathLengthArray = (value: any) => ( isArray(value) && every(value, item => isNumber(item) || isNil(item)) && value.length > 0 ); const isPathLength = (value: any): value is PathLength => ( diff --git a/src/clauses/return.ts b/src/clauses/return.ts index ab4deb93..1cd05f3e 100644 --- a/src/clauses/return.ts +++ b/src/clauses/return.ts @@ -1,11 +1,12 @@ -import { TermListClause } from './term-list-clause'; +import { Many } from 'lodash'; +import { Term, TermListClause } from './term-list-clause'; export class Return extends TermListClause { /** * Creates a return clause * @param {string|object|array|} terms [description] */ - constructor(terms) { + constructor(terms: Many) { super(terms); } diff --git a/src/clauses/set.ts b/src/clauses/set.ts index 87858919..b5d3e7d6 100644 --- a/src/clauses/set.ts +++ b/src/clauses/set.ts @@ -1,6 +1,6 @@ import { concat, map, mapValues, castArray, Dictionary, - Many, isObject, + Many, isObject, isString, } from 'lodash'; import { Clause } from '../clause'; import { stringifyLabels } from '../utils'; @@ -13,7 +13,7 @@ export type SetProperties = { }; export interface SetOptions { - override: boolean; + override?: boolean; } export class Set extends Clause { @@ -34,11 +34,11 @@ export class Set extends Clause { protected makeVariableStatement = (value: string | Dictionary, key: string): string => { const op = this.override ? ' = ' : ' += '; - if (isObject(value)) { - const operationStrings = map(value, (value, prop) => `${key}.${prop}${op}${value}`); - return operationStrings.join(', '); + if (isString(value)) { + return key + op + value; } - return key + op + value; + const operationStrings = map(value, (value, prop) => `${key}.${prop}${op}${value}`); + return operationStrings.join(', '); } constructor( @@ -48,7 +48,7 @@ export class Set extends Clause { super(); let options: SetOptions | undefined = inOptions; - if (inOptions === undefined) { + if (options === undefined) { // tslint:disable-next-line:max-line-length console.warn('Warning: In the future, override will default to false in a Set clause when no options are provided. To retain the old behaviour, pass { override: false } as options to the Set constructor.'); options = { override: true }; @@ -58,8 +58,8 @@ export class Set extends Clause { this.values = mapValues(values, (value, name) => { return this.parameterBag.addParam(value, name); }); - this.variables = variables; - this.override = options.override; + this.variables = variables || {}; + this.override = options.override === undefined ? false : options.override; } build() { diff --git a/src/clauses/skip.ts b/src/clauses/skip.ts index 94532483..d94c53a1 100644 --- a/src/clauses/skip.ts +++ b/src/clauses/skip.ts @@ -1,7 +1,8 @@ import { Clause } from '../clause'; +import { Parameter } from '../parameter-bag'; export class Skip extends Clause { - protected amountParam; + protected amountParam: Parameter; constructor(public amount: number | string) { super(); diff --git a/src/clauses/term-list-clause.ts b/src/clauses/term-list-clause.ts index 888c3032..4d4f3b5b 100644 --- a/src/clauses/term-list-clause.ts +++ b/src/clauses/term-list-clause.ts @@ -53,6 +53,8 @@ export class TermListClause extends Clause { if (isPlainObject(term)) { return this.stringifyDictionary(term); } + + return ''; } private stringifyProperty(prop: string, alias?: string, node?: string): string { @@ -78,17 +80,20 @@ export class TermListClause extends Clause { } private stringifyDictionary(node: Dictionary): string[] { - const convertToString = (list, prop, key) => { - if (isString(prop)) { - // Alias - list.push(this.stringifyProperty(prop, key)); - } else { - // Node with properties - list.push(...this.stringifyProperties(prop, null, key)); - } - return list; - }; - return reduce(node, convertToString, []); + return reduce( + node, + (list, prop, key) => { + if (isString(prop)) { + // Alias + list.push(this.stringifyProperty(prop, key)); + } else { + // Node with properties + list.push(...this.stringifyProperties(prop, undefined, key)); + } + return list; + }, + [] as string[], + ); } build() { diff --git a/src/clauses/where-comparators.spec.ts b/src/clauses/where-comparators.spec.ts index b3872bae..9183310d 100644 --- a/src/clauses/where-comparators.spec.ts +++ b/src/clauses/where-comparators.spec.ts @@ -1,6 +1,7 @@ +import { Dictionary } from 'lodash'; import { expect } from 'chai'; import { - between, + between, Comparator, contains, endsWith, equals, exists, greaterEqualTo, greaterThan, hasLabel, inArray, isNull, lessEqualTo, lessThan, regexp, startsWith, @@ -9,11 +10,12 @@ import { ParameterBag } from '../parameter-bag'; describe('Where Comparators', () => { let bag: ParameterBag; + beforeEach(() => { bag = new ParameterBag(); }); - const simpleOperators = { + const simpleOperators: Dictionary<(value: any, variable?: boolean) => Comparator> = { equals, greaterThan, greaterEqualTo, @@ -24,7 +26,8 @@ describe('Where Comparators', () => { contains, inArray, }; - const opSymbols = { + + const opSymbols: Dictionary = { equals: '=', greaterThan: '>', greaterEqualTo: '>=', diff --git a/src/clauses/where-operators.ts b/src/clauses/where-operators.ts index 637bf3fb..8e5df44f 100644 --- a/src/clauses/where-operators.ts +++ b/src/clauses/where-operators.ts @@ -9,6 +9,7 @@ import { Precedence, WhereOp, } from './where-utils'; +import { ParameterBag } from '../parameter-bag'; export const operators = { and, or, xor, not }; @@ -38,7 +39,7 @@ export class WhereAnd extends WhereOp { super(); } - evaluate(params, precedence = Precedence.None, name = '') { + evaluate(params: ParameterBag, precedence = Precedence.None, name = '') { return combineAnd(params, this.conditions, precedence, name); } } @@ -69,7 +70,7 @@ export class WhereOr extends WhereOp { super(); } - evaluate(params, precedence = Precedence.None, name = '') { + evaluate(params: ParameterBag, precedence = Precedence.None, name = '') { return combineOr(params, this.conditions, precedence, name); } } @@ -98,7 +99,7 @@ export class WhereXor extends WhereOp { super(); } - evaluate(params, precedence = Precedence.None, name = '') { + evaluate(params: ParameterBag, precedence = Precedence.None, name = '') { return combineXor(params, this.conditions, precedence, name); } } @@ -127,7 +128,7 @@ export class WhereNot extends WhereOp { super(); } - evaluate(params, precedence = Precedence.None, name = '') { + evaluate(params: ParameterBag, precedence = Precedence.None, name = '') { return combineNot(params, this.conditions, precedence, name); } } diff --git a/src/clauses/with.ts b/src/clauses/with.ts index f06a2ca4..e6dcfe2a 100644 --- a/src/clauses/with.ts +++ b/src/clauses/with.ts @@ -1,11 +1,12 @@ -import { TermListClause } from './term-list-clause'; +import { Many } from 'lodash'; +import { Term, TermListClause } from './term-list-clause'; export class With extends TermListClause { /** * Creates a with clause * @param {string|object|array} terms */ - constructor(terms) { + constructor(terms: Many) { super(terms); } diff --git a/src/connection.ts b/src/connection.ts index 5d5c86d9..635c2491 100644 --- a/src/connection.ts +++ b/src/connection.ts @@ -42,6 +42,10 @@ function isCredentials(credentials: any): credentials is Credentials { return 'username' in credentials && 'password' in credentials; } +// We have to correct the type of lodash's isFunction method because it doesn't correctly narrow +// union types such as the options parameter passed to the connection constructor. +const isTrueFunction: (value: any) => value is Function = isFunction; + /** * A connection lets you access the Neo4j server and run queries against it. * @@ -108,15 +112,13 @@ export class Connection extends Builder { ? neo4j.auth.basic(auth.username, auth.password) : auth; - this.options = { - driverConstructor: isFunction(options) ? options - : options.driverConstructor ? options.driverConstructor : neo4j.driver, - driverConfig: isFunction(options) || !options.driverConfig ? {} : options.driverConfig, - }; - - this.driver = this.options.driverConstructor(this.url, this.auth, this.options.driverConfig); + const driverConstructor = isTrueFunction(options) ? options + : options.driverConstructor ? options.driverConstructor : neo4j.driver; + const driverConfig = isTrueFunction(options) || !options.driverConfig + ? {} : options.driverConfig; + this.options = { driverConstructor, driverConfig }; + this.driver = driverConstructor(this.url, this.auth, this.options.driverConfig); this.open = true; - connections.push(this); } @@ -207,19 +209,20 @@ export class Connection extends Builder { * @returns {Promise[]>} */ run(query: Query): Promise[]> { - if (!this.open) { - throw Error('Cannot run query; connection is not open.'); - } - if (query.getClauses().length === 0) { throw Error('Cannot run query: no clauses attached to the query.'); } - const queryObj = query.buildQueryObject(); const session = this.session(); + if (!session) { + throw Error('Cannot run query: connection is not open.'); + } + + const queryObj = query.buildQueryObject(); + const result = session.run(queryObj.query, queryObj.params); // Need to wrap promise in an any-promise - return AnyPromise.resolve(session.run(queryObj.query, queryObj.params)) + return AnyPromise.resolve(result) .then((result) => { session.close(); return this.transformer.transformRecords(result.records); @@ -298,18 +301,17 @@ export class Connection extends Builder { * In practice this should never happen unless you're doing some strange things. */ stream(query: Query): RxObservable> { - if (!this.open) { - throw Error('Cannot run query; connection is not open.'); - } - if (query.getClauses().length === 0) { throw Error('Cannot run query: no clauses attached to the query.'); } - const queryObj = query.buildQueryObject(); const session = this.session(); + if (!session) { + throw Error('Cannot run query: connection is not open.'); + } // Run the query + const queryObj = query.buildQueryObject(); const result = session.run(queryObj.query, queryObj.params); // Subscribe to the result and clean up the session diff --git a/src/parameter-bag.spec.ts b/src/parameter-bag.spec.ts index 8eeb0b43..a4faeac1 100644 --- a/src/parameter-bag.spec.ts +++ b/src/parameter-bag.spec.ts @@ -3,7 +3,7 @@ import { ParameterBag } from './parameter-bag'; import { expect } from '../test-setup'; describe('ParameterBag', () => { - let parameterBag; + let parameterBag: ParameterBag; beforeEach(() => { parameterBag = new ParameterBag(); diff --git a/src/parameter-container.ts b/src/parameter-container.ts index e98eb602..a1549941 100644 --- a/src/parameter-container.ts +++ b/src/parameter-container.ts @@ -4,7 +4,7 @@ import { Dictionary } from 'lodash'; export class ParameterContainer { protected parameterBag = new ParameterBag(); - useParameterBag(newBag) { + useParameterBag(newBag: ParameterBag) { newBag.importParams(this.parameterBag); this.parameterBag = newBag; } diff --git a/src/query.spec.ts b/src/query.spec.ts index 41a12ba1..fbaccca8 100644 --- a/src/query.spec.ts +++ b/src/query.spec.ts @@ -66,11 +66,13 @@ describe('Query', () => { 'getClauses', ]; - each(methods, (method) => { - const methodSpy = spy(query.getClauseCollection(), method); - query[method](); - expect(methodSpy.calledOnce).to.be.true; - methodSpy.restore(); + methods.forEach((method) => { + it(`should proxy the ${method} method to the clause collection`, () => { + const methodSpy = spy(query.getClauseCollection(), method); + (query as any)[method](); + expect(methodSpy.calledOnce).to.be.true; + methodSpy.restore(); + }); }); }); @@ -119,7 +121,7 @@ describe('Query', () => { runStub.returns(Promise.resolve([firstRecord, { number: 2 }, { number: 3 }])); const query = (new Query(connection)).raw('Query'); - return expect(query.first()).to.be.fulfilled.then((result) => { + return expect(query.first()).to.be.fulfilled.then((result: any) => { expect(runStub.calledOnce); expect(result).to.equal(firstRecord); }); @@ -131,7 +133,7 @@ describe('Query', () => { runStub.returns(Promise.resolve([])); const query = (new Query(connection)).raw('Query'); - return expect(query.first()).to.be.fulfilled.then((result) => { + return expect(query.first()).to.be.fulfilled.then((result: any) => { expect(runStub.calledOnce); expect(result).to.equal(undefined); }); diff --git a/src/query.ts b/src/query.ts index 4bad073c..cf86a142 100644 --- a/src/query.ts +++ b/src/query.ts @@ -15,7 +15,7 @@ export class Query extends Builder { * * @param {Connection} connection */ - constructor(protected connection: Connection = null) { + constructor(protected connection: Connection | null = null) { super(); } @@ -156,7 +156,7 @@ export class Query extends Builder { * the return value which is `Dictionary`. Note that this function returns * `undefined` if the result set was empty. */ - first(): Promise> { + first(): Promise | undefined> { return this.run().then(results => results && results.length > 0 ? results[0] : undefined); } diff --git a/src/utils.ts b/src/utils.ts index 93c1d2f5..95c922c3 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -9,6 +9,7 @@ import { isString, map, reduce, + Many, } from 'lodash'; /** @@ -18,7 +19,7 @@ import { * @param {Array} existing * @return {string} */ -export function uniqueString(str, existing: string[]) { +export function uniqueString(str: string, existing: string[]) { let camelString = camelCase(str); // Check if the string already has a number extension @@ -31,14 +32,18 @@ export function uniqueString(str, existing: string[]) { // Compute all taken suffixes that are similar to the given string const regex = new RegExp(`^${camelString}([0-9]*)$`); - const collectSuffixes = (suffixes, existingString) => { - const matches = existingString.match(regex); - if (matches) { - return [...suffixes, matches[1] ? +matches[1] : 1]; - } - return suffixes; - }; - const takenSuffixes = reduce(existing, collectSuffixes, []); + const takenSuffixes = reduce( + existing, + (suffixes, existingString) => { + const matches = existingString.match(regex); + if (matches) { + const [, suffix] = matches; + suffixes.push(suffix ? +suffix : 1); + } + return suffixes; + }, + [] as number[], + ); // If there was no suffix on the given string or it was already taken, // compute the new suffix. @@ -55,7 +60,7 @@ export function uniqueString(str, existing: string[]) { * @param {object|Array|string|boolean|number} value * @return {string} */ -export function stringifyValue(value) { +export function stringifyValue(value: any): string { if (isNumber(value) || isBoolean(value)) { return `${value}`; } @@ -81,11 +86,10 @@ export function stringifyValue(value) { * @param relation When true, joins labels by a | instead of : * @return {string} */ -export function stringifyLabels(labels, relation = false) { +export function stringifyLabels(labels: Many, relation = false) { if (labels.length === 0) { return ''; } - return `:${castArray(labels).join(relation ? '|' : ':')}`; } diff --git a/tests/connection.mock.ts b/tests/connection.mock.ts index 3860a51c..11ef723c 100644 --- a/tests/connection.mock.ts +++ b/tests/connection.mock.ts @@ -1,4 +1,4 @@ -import { stub, spy } from 'sinon'; +import { stub, spy, SinonSpy, SinonStub } from 'sinon'; import { Connection } from '../src'; export const defaultUrl = 'bolt://localhost'; diff --git a/tests/connection.test.ts b/tests/connection.test.ts index 34dfdec2..5e0bb220 100644 --- a/tests/connection.test.ts +++ b/tests/connection.test.ts @@ -114,7 +114,7 @@ describe('Connection', () => { it('should throw if the connection has been closed', () => { connection.close(); - const run = () => connection.run(connection.query()); + const run = () => connection.run(connection.query().matchNode('node')); expect(run).to.throw(Error, 'connection is not open'); }); diff --git a/tests/scenarios.test.ts b/tests/scenarios.test.ts index 47a6e2bb..d3d87220 100644 --- a/tests/scenarios.test.ts +++ b/tests/scenarios.test.ts @@ -5,7 +5,7 @@ import { Dictionary, isNil } from 'lodash'; import { node, relation } from '../src/clauses'; function expectResults( - results: any, + results: any[], length?: number | null, properties?: string[] | null, cb?: null | ((row: any) => any), @@ -37,7 +37,7 @@ function expectNode(record: any, labels?: string[], properties?: Dictionary .and.to.match(/[0-9]+/); expect(record.labels).to.be.an.instanceOf(Array); - record.labels.forEach(label => expect(label).to.be.a('string')); + record.labels.forEach((label: string) => expect(label).to.be.a('string')); if (labels) { expect(record.labels).to.have.members(labels); } @@ -166,14 +166,14 @@ describe('scenarios', () => { expectResults(results, 1, ['rels', 'nodes'], (row) => { expect(row.rels).to.be.an.instanceOf(Array) .and.to.have.a.lengthOf(3); - row.rels.forEach((rel) => { + row.rels.forEach((rel: any) => { expectRelation(rel, 'Road'); expect(rel.properties).to.have.own.keys(['length']); }); expect(row.nodes).to.be.an.instanceOf(Array) .and.to.have.a.lengthOf(4); - row.nodes.forEach((node) => { + row.nodes.forEach((node: any) => { expectNode(node, ['City']); expect(node.properties).to.have.own.keys(['name']); }); diff --git a/tests/utils.ts b/tests/utils.ts index 30939265..ab95397f 100644 --- a/tests/utils.ts +++ b/tests/utils.ts @@ -1,12 +1,13 @@ import { Connection, Credentials } from '../src'; +import IHookCallbackContext = Mocha.IHookCallbackContext; -export const neo4jUrl: string = process.env.NEO4J_URL; +export const neo4jUrl: string = process.env.NEO4J_URL as string; export const neo4jCredentials: Credentials = { - username: process.env.NEO4J_USER, - password: process.env.NEO4J_PASS, + username: process.env.NEO4J_USER as string, + password: process.env.NEO4J_PASS as string, }; -export async function waitForNeo() { +export async function waitForNeo(this: IHookCallbackContext) { if (this && 'timeout' in this) { this.timeout(40000); } diff --git a/tsconfig.declaration.json b/tsconfig.declaration.json new file mode 100644 index 00000000..a6e36040 --- /dev/null +++ b/tsconfig.declaration.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "include": [ + "src/**/*", + "typings/**/*" + ], + "exclude": [ + "**/*.spec.ts" + ] +} diff --git a/tsconfig.json b/tsconfig.json index d6f671b4..95856d2d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,28 +2,21 @@ "compileOnSave": false, "compilerOptions": { "allowJs": false, - "sourceMap": true, - "moduleResolution": "node", - "outDir": "dist", - "target": "es5", - "module": "commonjs", - "esModuleInterop": true, "allowSyntheticDefaultImports": true, - "alwaysStrict": true, - "noImplicitAny": false, - "noImplicitThis": false, - "strictNullChecks": false, - "suppressImplicitAnyIndexErrors": true, + "esModuleInterop": true, "lib": [ "es2016", "dom" - ] + ], + "module": "commonjs", + "moduleResolution": "node", + "outDir": "dist", + "sourceMap": true, + "strict": true, + "target": "es5" }, - "include": [ - "src/**/*.ts" - ], "exclude": [ - "**/*.test.ts", - "**/*.spec.ts" + "node_modules", + "dist" ] } diff --git a/tsconfig.lint.json b/tsconfig.lint.json deleted file mode 100644 index e83b40c5..00000000 --- a/tsconfig.lint.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "./tsconfig.json", - "include": [ - "src/**/*.ts", - "src/**/*.test.ts", - "src/**/*.spec.ts", - "tests/**/*.ts", - "*.ts" - ], - "exclude": [] -} diff --git a/typings/node-cleanup.d.ts b/typings/node-cleanup.d.ts new file mode 100644 index 00000000..41e3efac --- /dev/null +++ b/typings/node-cleanup.d.ts @@ -0,0 +1,4 @@ +declare module 'node-cleanup' { + function cleanup(callback: () => void): void; + export = cleanup; +}