This commit is contained in:
19
.eslintrc.js
Normal file
19
.eslintrc.js
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
/* eslint-env node */
|
||||||
|
module.exports = {
|
||||||
|
extends: [
|
||||||
|
'eslint:recommended',
|
||||||
|
'plugin:@typescript-eslint/recommended',
|
||||||
|
'plugin:import/errors',
|
||||||
|
'plugin:prettier/recommended',
|
||||||
|
'prettier',
|
||||||
|
],
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
plugins: ['@typescript-eslint'],
|
||||||
|
settings: {
|
||||||
|
'import/parsers': {
|
||||||
|
'@typescript-eslint/parser': ['.ts', '.tsx'],
|
||||||
|
},
|
||||||
|
'import/resolver': 'typescript',
|
||||||
|
},
|
||||||
|
root: true,
|
||||||
|
};
|
||||||
11
.npmignore
11
.npmignore
@@ -1,8 +1,9 @@
|
|||||||
|
.build.yarnrc.yml
|
||||||
|
.drone.yml
|
||||||
|
.prettierrc
|
||||||
|
.yarnrc.yml
|
||||||
|
babel.config.*
|
||||||
|
jest.config.*
|
||||||
src
|
src
|
||||||
tsconfig.json
|
tsconfig.json
|
||||||
tslint.json
|
tslint.json
|
||||||
.prettierrc
|
|
||||||
.yarnrc.yml
|
|
||||||
.drone.yml
|
|
||||||
babel.config.*
|
|
||||||
jest.config.*
|
|
||||||
7
.prettierrc.js
Normal file
7
.prettierrc.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
module.exports = {
|
||||||
|
parser: 'typescript',
|
||||||
|
printWidth: 120,
|
||||||
|
trailingComma: 'all',
|
||||||
|
tabWidth: 4,
|
||||||
|
singleQuote: true,
|
||||||
|
};
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import { Payload } from "../../types/Payload";
|
import { Payload } from '../../types/Payload';
|
||||||
import { ServiceError } from "./ServiceError";
|
import { ServiceError } from './ServiceError';
|
||||||
|
|
||||||
export class ApiError extends ServiceError {
|
export class ApiError extends ServiceError {
|
||||||
constructor(message: string, debug?: Payload) {
|
constructor(message: string, debug?: Payload) {
|
||||||
super(message, debug);
|
super(message, debug);
|
||||||
this.name = "ApiError";
|
this.name = 'ApiError';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { Payload } from "../../types/Payload";
|
import { Payload } from '../../types/Payload';
|
||||||
import { ServiceError } from "./ServiceError";
|
import { ServiceError } from './ServiceError';
|
||||||
|
|
||||||
export class DatabaseError extends ServiceError {
|
export class DatabaseError extends ServiceError {
|
||||||
constructor(message: string, debug?: Payload) {
|
constructor(message: string, debug?: Payload) {
|
||||||
super(message, debug);
|
super(message, debug);
|
||||||
this.name = "DatabaseError";
|
this.name = 'DatabaseError';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Payload } from "../../types/Payload";
|
import { Payload } from '../../types/Payload';
|
||||||
|
|
||||||
export class ServiceError extends Error {
|
export class ServiceError extends Error {
|
||||||
public env = process.env;
|
public env = process.env;
|
||||||
@@ -6,7 +6,7 @@ export class ServiceError extends Error {
|
|||||||
|
|
||||||
constructor(message: string, debug?: Payload) {
|
constructor(message: string, debug?: Payload) {
|
||||||
super(message);
|
super(message);
|
||||||
this.name = "ServiceError";
|
this.name = 'ServiceError';
|
||||||
this.debug = debug;
|
this.debug = debug;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Payload } from "./Payload";
|
import { Payload } from './Payload';
|
||||||
|
|
||||||
export interface ApiResponse<T = Payload> {
|
export interface ApiResponse<T = Payload> {
|
||||||
data?: T;
|
data?: T;
|
||||||
|
|||||||
Reference in New Issue
Block a user