An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# eslint-plugin-authing-nestjs


authing



npm version


github ci


testing


download


welcome pr


license


forum


nodejs





eslint-plugin-authing-nestjs is an MIT-licensed open source project for
nestjs
framework


## 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)