@arabasta/eslint-plugin-tsoa
Version:
ESLint plugin for tsoa rules
76 lines (57 loc) • 5.74 kB
Markdown
# `/eslint-plugin-tsoa`
[](https://www.npmjs.com/package/@arabasta/eslint-plugin-tsoa)
[](https://github.com/CloudNStoyan/arabasta/blob/main/eslint-plugin-tsoa/LICENSE)
ESLint plugin for tsoa rules.
## Installation
Assuming you already have ESLint installed, run:
```sh
# npm
npm install --save-dev /eslint-plugin-tsoa
# yarn
yarn add --dev /eslint-plugin-tsoa
# pnpm
pnpm add --save-dev /eslint-plugin-tsoa
```
## Usage
[Flat config](https://eslint.org/docs/latest/use/configure/configuration-files)
(**eslint.config.js**)
```js
// ...
import arabastaTsoa from '/eslint-plugin-tsoa';
export default [
// ...
arabastaTsoa.configs.recommended,
];
```
[Legacy config](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated)
(**.eslintrc**)
```json
{
"extends": [
// ...
"plugin:@arabasta/tsoa/recommended-legacy"
]
}
```
## Rules
<!-- begin auto-generated rules list -->
💼 Configurations enabled in.\
✅ Set in the `recommended` configuration.\
🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\
💭 Requires [type information](https://typescript-eslint.io/linting/typed-linting).
| Name | Description | 💼 | 🔧 | 💭 |
| :--------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------- | :-- | :-- | :-- |
| [no-jsdoc-example-for-complex-property-type](docs/rules/no-jsdoc-example-for-complex-property-type.md) | ban complex interface property types from having JSDoc's `` declaration | ✅ | | 💭 |
| [require-example-decorator](docs/rules/require-example-decorator.md) | require the `` decorator on methods that return an array | ✅ | | |
| [require-jsdoc-example-for-enum-property-type](docs/rules/require-jsdoc-example-for-enum-property-type.md) | require JSDoc's `` declaration for enum properties | ✅ | | 💭 |
| [require-jsdoc-returns](docs/rules/require-jsdoc-returns.md) | require return statements to be documented | ✅ | | 💭 |
| [require-property-example-decorator](docs/rules/require-property-example-decorator.md) | require the `` decorator on class properties | ✅ | | |
| [require-security-metadata](docs/rules/require-security-metadata.md) | require all security definitions used by the `` decorator to be present in the `TSOA` config | ✅ | | |
| [require-tags-decorator](docs/rules/require-tags-decorator.md) | require `` decorator on controllers | ✅ | | |
| [require-tags-metadata](docs/rules/require-tags-metadata.md) | require tags used by the `` decorator to be present in the `TSOA` config | ✅ | | |
| [valid-alternative-response](docs/rules/valid-alternative-response.md) | require correct response decorators when using alternative responses | ✅ | 🔧 | |
| [valid-alternative-response-type](docs/rules/valid-alternative-response-type.md) | require alternative response's first type argument to be the same as its method's return type | ✅ | 🔧 | 💭 |
| [valid-example-decorator-type](docs/rules/valid-example-decorator-type.md) | require `` decorator's first type argument to be the same as its method's return type or its property type | ✅ | | 💭 |
| [valid-response-decorator-type](docs/rules/valid-response-decorator-type.md) | require `` decorator's first type argument to exists if the status code begins with `4` or `5` and optionally to be one of the allowed types | ✅ | | 💭 |
| [valid-security-decorator](docs/rules/valid-security-decorator.md) | require `` decorator with a specific status code on methods or classes that are affected by the `` decorator | ✅ | | |
<!-- end auto-generated rules list -->