Create package common

This commit is contained in:
Jerko Steiner 2019-01-18 20:24:19 +01:00
parent 2bf2557b13
commit de174b8894
4 changed files with 83 additions and 0 deletions

View File

@ -0,0 +1,21 @@
export type IMethod = 'get'
| 'post'
| 'put'
| 'delete'
| 'patch'
| 'head'
| 'options'
export interface IRoutes {
// has to be any because otherwise TypeScript will start
// throwing error and interfaces without an index signature
// would not be usable
[route: string]: any
}
export interface IRoute {
params: any
query: any
body: any
response: any
}

View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"lib": ["es2015", "dom"],
"target": "es3",
"moduleResolution": "node",
"jsx": "react",
"noImplicitAny": true,
"strict": true,
"skipLibCheck": true,
"noUnusedLocals": true,
"esModuleInterop": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"plugins": [{
"name": "typescript-tslint-plugin",
"suppressWhileTypeErrorsPresent": true
}]
}
}

View File

@ -0,0 +1,43 @@
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {
"quotemark": [true, "single", "jsx-single"],
"member-access": false,
"no-bitwise": false,
"semicolon": [true, "never"],
"object-literal-sort-keys": false,
"ordered-imports": false,
"max-line-length": [true, 80],
"arrow-parens": false,
"variable-name": [
true,
"ban-keywords",
"check-format",
"allow-leading-underscore",
"allow-pascal-case"
],
"member-ordering": false,
"max-classes-per-file": false,
"no-empty-interface": false,
"trailing-comma": [true, {
"multiline": {
"objects": "always",
"arrays": "always",
"functions": "always",
"typeLiterals": "ignore"
},
"singleline": "never",
"esSpecCompliant": true
}]
},
"linterOptions": {
"exclude": [
"src/server/migrations/*.ts"
]
},
"rulesDirectory": []
}