Create package common
This commit is contained in:
parent
2bf2557b13
commit
de174b8894
0
packages/server/.gitignore → .gitignore
vendored
0
packages/server/.gitignore → .gitignore
vendored
21
packages/common/src/index.ts
Normal file
21
packages/common/src/index.ts
Normal 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
|
||||||
|
}
|
||||||
19
packages/common/tsconfig.json
Normal file
19
packages/common/tsconfig.json
Normal 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
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
43
packages/common/tslint.json
Normal file
43
packages/common/tslint.json
Normal 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": []
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user