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

Convert remaining JS files to TS #150

Merged
merged 15 commits into from Apr 3, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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;
}
}
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 */