Skip to content

Commit

Permalink
Merge pull request #150 from getlarge/js_to_ts
Browse files Browse the repository at this point in the history
Convert remaining JS files to TS
  • Loading branch information
chriskalmar committed Apr 3, 2020
2 parents b067ee4 + 0226c7e commit 8154600
Show file tree
Hide file tree
Showing 93 changed files with 1,664 additions and 1,042 deletions.
9 changes: 7 additions & 2 deletions package.json
Expand Up @@ -8,8 +8,8 @@
"clean": "rimraf lib",
"test": "jest",
"test-watch": "jest --watch",
"lint": "eslint src/*",
"lint-fix": "eslint src/* --fix",
"lint": "tsc --noEmit && eslint '*/**/*.{js,ts,tsx}'",
"lint-fix": "tsc --noEmit && eslint '*/**/*.{js,ts,tsx}' --quiet --fix",
"lint-staged": "lint-staged",
"coverage": "cross-env NODE_ENV=test jest --coverage",
"coverage-ci": "npm run coverage && cat ./coverage/lcov.info | codecov",
Expand Down Expand Up @@ -53,11 +53,16 @@
],
"author": "Chris Kalmar <christian.kalmar@gmail.com>",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/chriskalmar/shyft"
},
"devDependencies": {
"@babel/core": "7.8.7",
"@babel/preset-env": "7.8.7",
"@types/jest": "25.1.4",
"@types/lodash": "4.14.149",
"@types/node": "^12.12.31",
"@typescript-eslint/eslint-plugin": "2.23.0",
"@typescript-eslint/parser": "2.23.0",
"babel-jest": "25.1.0",
Expand Down
10 changes: 0 additions & 10 deletions src/engine/CustomError.js

This file was deleted.

26 changes: 26 additions & 0 deletions src/engine/CustomError.ts
@@ -0,0 +1,26 @@
/* eslint-disable @typescript-eslint/no-explicit-any */

declare type ErrorInterface = Error;

declare class Error implements ErrorInterface {
name: string;
message: string;
static captureStackTrace(object: any, objectConstructor?: any): any;
}

export class CustomError extends Error {
code: any;
status?: any;
meta?: any;

constructor(message?: string, code?: any, status?: any, meta?: any) {
// super(message);
super();
Error.captureStackTrace(this, this.constructor);
this.message = message;
this.name = this.constructor.name;
this.code = code;
this.status = status;
this.meta = meta;
}
}
File renamed without changes.
208 changes: 0 additions & 208 deletions src/engine/action/Action.js

This file was deleted.

@@ -1,4 +1,5 @@
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/explicit-function-return-type */

import { Action, isAction, ACTION_TYPE_QUERY } from './Action';
import { Permission, isPermission } from '../permission/Permission';
Expand Down Expand Up @@ -611,3 +612,6 @@ describe('Action', () => {
});
});
});

/* eslint-enable @typescript-eslint/no-empty-function */
/* eslint-enable @typescript-eslint/explicit-function-return-type */

0 comments on commit 8154600

Please sign in to comment.