https://github.com/authing/eslint-plugin-authing-nestjs
ESLint rules for nestjs framework
https://github.com/authing/eslint-plugin-authing-nestjs
eslint-plugin eslint-plugin-nestjs
Last synced: 10 months ago
JSON representation
ESLint rules for nestjs framework
- Host: GitHub
- URL: https://github.com/authing/eslint-plugin-authing-nestjs
- Owner: Authing
- License: mit
- Created: 2022-01-29T11:43:28.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-06-18T13:49:00.000Z (over 3 years ago)
- Last Synced: 2024-05-03T17:34:30.899Z (almost 2 years ago)
- Topics: eslint-plugin, eslint-plugin-nestjs
- Language: TypeScript
- Homepage:
- Size: 240 KB
- Stars: 0
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eslint-plugin-authing-nestjs
## Install
```shell
npm install --save-dev eslint-plugin-authing-nestjs
```
or
```shell
yarn add eslint-plugin-authing-nestjs -D
```
## Usage
Configure it in your [configuration file](https://eslint.org/docs/user-guide/configuring/):
- Add to `plugins` section:
- Add to `extends` or `rules` section:
``` javascript
module.exports = {
plugins: ['authing-nestjs'],
extends: [
'plugin:authing-nestjs/recommended'
],
// *** Usage: refer to unit test documents for specific rules ***
rules: {
// It is forbidden to use parameters in the @Body, eg: @Body("name")
'authing-nestjs/forbid_body_parameters': 'warn', // default 'error'
// It is forbidden to read body from Req, eg: req.body
'authing-nestjs/forbid_read_body_from_req': 'warn',
// The @Body type annotation in the function must be a class, eg: @Body() dto: ClassDto
'authing-nestjs/use_class_as_type_in_method_of_controller': 'warn',
// Each DTO field must have a class validator
// There must be at least 2 class validators for a DTO with IsOptional
// For nested DTO,Type and ValidateNested must appear at the same time
'authing-nestjs/use_class_validator_to_dto': 'warn',
// ... more
}
}
```
- [Configure rules](https://eslint.org/docs/user-guide/configuring/#configuring-rules)
## Changelog
Detailed changes for each release are documented in the [release notes](https://github.com/Authing/eslint-plugin-authing-nestjs/releases).
## Contribution
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push -u origin my-new-feature)
- Create new Pull Request
## Help
Join us on forum: [#authing-chat](https://forum.authing.cn/)
## License
[MIT](https://opensource.org/licenses/MIT)
Copyright (c) 2022 Authing
## Links
- [AuthingMove](https://github.com/Authing/AuthingMove)
- [authingmove-template](https://github.com/Authing/authingmove-template)