We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Would it be possible to expand the module to use it to enforce rest naming conventions for endpoints?
https://restfulapi.net/resource-naming/
Essentially to check the Controller, Get, Post, Put, Delete.. decorators if a proper naming was used for the endpoint:
Controller
Get
Post
Put
Delete
This PASSES
@Controller('tests') class TestClass { @Get() public getAll() { } }
This FAILS, because the resource is not plural
@Controller('test') class TestClass { @Get() public getAll() { } }
@Controller('tests') class TestClass { @Get('some-param/:someParam') public getByParam(@Param('someParam') param) { } }
This FAILS, because camel case was used to name the resource
@Controller('tests') class TestClass { @Get('getByParam/:someParam') public getByParam(@Param('someParam') param) { } }
The text was updated successfully, but these errors were encountered:
it should be configurable to use camelCase or dash or underscore
Sorry, something went wrong.
This is a fairly complex rule that I wouldn't really enforce in my projects. Unlikely to implement this myself.
Happy to accept PR for it though.
Can you give us a hint what the necessary steps would be to implement this?
There is a naming convention rule in the main eslint ruleset you could use for inspiration.
There are a couple of examples in this project of how to detect a nestjs controller and the nestjs api method decorators.
you would have to combine these in some way
No branches or pull requests
Would it be possible to expand the module to use it to enforce rest naming conventions for endpoints?
https://restfulapi.net/resource-naming/
Essentially to check the
Controller
,Get
,Post
,Put
,Delete
.. decorators if a proper naming was used for the endpoint:This PASSES
This FAILS, because the resource is not plural
This PASSES
This FAILS, because camel case was used to name the resource
The text was updated successfully, but these errors were encountered: