1.1.1 • Published 11 months ago

@arabasta/eslint-plugin-tsoa v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@arabasta/eslint-plugin-tsoa

NPM Version NPM License

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-typeban complex interface property types from having JSDoc's @example declaration💭
require-example-decoratorrequire the @Example decorator on methods that return an array
require-jsdoc-example-for-enum-property-typerequire JSDoc's @example declaration for enum properties💭
require-jsdoc-returnsrequire return statements to be documented💭
require-property-example-decoratorrequire the @Example decorator on class properties
require-security-metadatarequire all security definitions used by the @Security decorator to be present in the TSOA config
require-tags-decoratorrequire @Tags decorator on controllers
require-tags-metadatarequire tags used by the @Tags decorator to be present in the TSOA config
valid-alternative-responserequire correct response decorators when using alternative responses🔧
valid-alternative-response-typerequire alternative response's first type argument to be the same as its method's return type🔧💭
valid-example-decorator-typerequire @Example decorator's first type argument to be the same as its method's return type or its property type💭
valid-response-decorator-typerequire @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-decoratorrequire @Response decorator with a specific status code on methods or classes that are affected by the @Security decorator