1.1.1 • Published 11 months ago
@arabasta/eslint-plugin-tsoa v1.1.1
@arabasta/eslint-plugin-tsoa
ESLint plugin for tsoa rules.
Installation
Assuming you already have ESLint installed, run:
# npm
npm install --save-dev @arabasta/eslint-plugin-tsoa
# yarn
yarn add --dev @arabasta/eslint-plugin-tsoa
# pnpm
pnpm add --save-dev @arabasta/eslint-plugin-tsoa
Usage
Flat config (eslint.config.js)
// ...
import arabastaTsoa from '@arabasta/eslint-plugin-tsoa';
export default [
// ...
arabastaTsoa.configs.recommended,
];
Legacy config (.eslintrc)
{
"extends": [
// ...
"plugin:@arabasta/tsoa/recommended-legacy"
]
}
Rules
💼 Configurations enabled in.\
✅ Set in the recommended
configuration.\
🔧 Automatically fixable by the --fix
CLI option.\
💭 Requires type information.
Name | Description | 💼 | 🔧 | 💭 |
---|---|---|---|---|
no-jsdoc-example-for-complex-property-type | ban complex interface property types from having JSDoc's @example declaration | ✅ | 💭 | |
require-example-decorator | require the @Example decorator on methods that return an array | ✅ | ||
require-jsdoc-example-for-enum-property-type | require JSDoc's @example declaration for enum properties | ✅ | 💭 | |
require-jsdoc-returns | require return statements to be documented | ✅ | 💭 | |
require-property-example-decorator | require the @Example decorator on class properties | ✅ | ||
require-security-metadata | require all security definitions used by the @Security decorator to be present in the TSOA config | ✅ | ||
require-tags-decorator | require @Tags decorator on controllers | ✅ | ||
require-tags-metadata | require tags used by the @Tags decorator to be present in the TSOA config | ✅ | ||
valid-alternative-response | require correct response decorators when using alternative responses | ✅ | 🔧 | |
valid-alternative-response-type | require alternative response's first type argument to be the same as its method's return type | ✅ | 🔧 | 💭 |
valid-example-decorator-type | require @Example decorator's first type argument to be the same as its method's return type or its property type | ✅ | 💭 | |
valid-response-decorator-type | require @Response 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 | require @Response decorator with a specific status code on methods or classes that are affected by the @Security decorator | ✅ |