-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(eslint): override controller files for eslint rules (#34)
- Loading branch information
1 parent
0c4a070
commit b4de0e0
Showing
12 changed files
with
6,692 additions
and
6,580 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const { OFF } = require("../../constants"); | ||
|
||
const controllerFilesOverride = Object.freeze({ | ||
files: ["*.controller.ts"], | ||
rules: { | ||
"class-methods-use-this": OFF, | ||
"@typescript-eslint/no-empty-function": OFF, | ||
}, | ||
}); | ||
|
||
module.exports = { controllerFilesOverride }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { Controller, Get, HttpStatus } from "@nestjs/common"; | ||
import { ApiResponse, ApiTags } from "@nestjs/swagger"; | ||
import { API_RESOURCES } from "../../shared/api/enums/api.enum"; | ||
import { roles } from "./constants/role.constant"; | ||
import { Role } from "./role.entity"; | ||
import { RoleService } from "./role.service"; | ||
|
||
@ApiTags("🃏 Roles") | ||
@Controller("roles") | ||
@Controller(API_RESOURCES.ROLES) | ||
export class RoleController { | ||
public constructor(private readonly roleService: RoleService) {} | ||
@Get() | ||
@ApiResponse({ status: HttpStatus.OK, type: Role, isArray: true }) | ||
public getRoles(): readonly Role[] { | ||
return this.roleService.getRoles(); | ||
return roles; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
import { Module } from "@nestjs/common"; | ||
import { RoleController } from "./role.controller"; | ||
import { RoleService } from "./role.service"; | ||
|
||
@Module({ | ||
controllers: [RoleController], | ||
providers: [RoleService], | ||
}) | ||
@Module({ controllers: [RoleController] }) | ||
export class RoleModule {} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
enum API_RESOURCES { | ||
GAMES = "games", | ||
ROLES = "roles", | ||
HEALTH = "health", | ||
} | ||
|
||
export { API_RESOURCES }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters