feature: compatibility with various IDEs

This commit is contained in:
Kamil Myśliwiec 2018-12-07 12:51:42 +01:00
parent 1bbfc970c8
commit 1b81bde89e
No known key found for this signature in database
GPG Key ID: 75F02E89A1A1092B
8 changed files with 30 additions and 64 deletions

View File

@ -4,7 +4,7 @@
"description": "Nest TypeScript starter repository",
"license": "MIT",
"scripts": {
"build": "tsc",
"build": "tsc -p tsconfig.build.json",
"format": "prettier --write \"src/**/*.ts\"",
"start": "ts-node -r tsconfig-paths/register src/main.ts",
"start:dev": "nodemon",
@ -23,7 +23,6 @@
"@nestjs/microservices": "^5.4.0",
"@nestjs/testing": "^5.4.0",
"@nestjs/websockets": "^5.4.0",
"@types/node": "^10.7.1",
"reflect-metadata": "^0.1.12",
"rimraf": "^2.6.2",
"rxjs": "^6.2.2"
@ -31,6 +30,7 @@
"devDependencies": {
"@types/express": "^4.16.0",
"@types/jest": "^23.3.1",
"@types/node": "^10.7.1",
"@types/supertest": "^2.0.5",
"jest": "^23.5.0",
"nodemon": "^1.18.3",

View File

@ -1,5 +1,4 @@
import { Test, TestingModule } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
@ -13,10 +12,10 @@ describe('AppController', () => {
}).compile();
});
describe('root', () => {
describe('getHello', () => {
it('should return "Hello World!"', () => {
const appController = app.get<AppController>(AppController);
expect(appController.root()).toBe('Hello World!');
expect(appController.getHello()).toBe('Hello World!');
});
});
});

View File

@ -6,7 +6,7 @@ export class AppController {
constructor(private readonly appService: AppService) {}
@Get()
root(): string {
return this.appService.root();
getHello(): string {
return this.appService.getHello();
}
}

View File

@ -2,7 +2,7 @@ import { Injectable } from '@nestjs/common';
@Injectable()
export class AppService {
root(): string {
getHello(): string {
return 'Hello World!';
}
}

5
tsconfig.build.json Normal file
View File

@ -0,0 +1,5 @@
{
"extends": "./tsconfig.json",
"include": ["src/**/*"],
"exclude": ["node_modules", "**/*.spec.ts"]
}

View File

@ -13,6 +13,5 @@
"outDir": "./dist",
"baseUrl": "./"
},
"include": ["src/**/*"],
"exclude": ["node_modules", "**/*.spec.ts"]
"exclude": ["node_modules"]
}

View File

@ -1,5 +1,5 @@
{
"extends": "tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"types": ["jest", "node"]
},

View File

@ -1,55 +1,18 @@
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {
"no-unused-expression": true
},
"rules": {
"eofline": false,
"quotemark": [
true,
"single"
],
"indent": false,
"member-access": [
false
],
"ordered-imports": [
false
],
"max-line-length": [
true,
150
],
"member-ordering": [
false
],
"curly": false,
"interface-name": [
false
],
"array-type": [
false
],
"no-empty-interface": false,
"no-empty": false,
"arrow-parens": false,
"object-literal-sort-keys": false,
"no-unused-expression": false,
"max-classes-per-file": [
false
],
"variable-name": [
false
],
"one-line": [
false
],
"one-variable-per-declaration": [
false
]
},
"rulesDirectory": []
"defaultSeverity": "error",
"extends": ["tslint:recommended"],
"jsRules": {
"no-unused-expression": true
},
"rules": {
"quotemark": [true, "single"],
"member-access": [false],
"ordered-imports": [false],
"max-line-length": [true, 150],
"member-ordering": [false],
"interface-name": [false],
"arrow-parens": false,
"object-literal-sort-keys": false
},
"rulesDirectory": []
}