Skip to content

Releases: profico/eslint-plugin-profico

v2.0.1-0

v2.0.1-0 Pre-release
Pre-release

Choose a tag to compare

@carloProfico carloProfico released this 11 Aug 10:47

Full Changelog: v2.0.0...v2.0.1-0

Release v2.0.0

Choose a tag to compare

@fpolic-profico fpolic-profico released this 17 Feb 11:28

What's Changed

Full Changelog: v1.3.0...v2.0.0

Release v1.3.0

Choose a tag to compare

@fpolic-profico fpolic-profico released this 25 Apr 09:45
24320d0

What's Changed

  • Ignore no-undef rule in typescript files by @rudovc in #10

Full Changelog: v.1.2.2...v1.3.0

Controller parameters ordering

Choose a tag to compare

@rcupic rcupic released this 10 Apr 12:55
573f9c8

Only NestJS controller files are linted.
Only controller function parameters are linted.
Parameters are linted only if all parameters have decorator.
Custom parameters are last and ordered by name ascending.

// Bad
public findAll(
  @Req() req: ProficoRequest,
  @Query() queryParams: QueryParams,
  @Custom2() customParam2: CustomParam,
  @Custom1() customParam1: CustomParam,
) {
  return this.service.find();
}

// Good
public findAll(
  @Query() queryParams: QueryParams,
  @Req() req: ProficoRequest,
  @Custom1() customParam1: CustomParam,
  @Custom2() customParam2: CustomParam,
) {
  return this.service.find();
}

DTO decorator ordering fix for controllers

Choose a tag to compare

@rcupic rcupic released this 26 Oct 06:57
55598b8

Controller files were throwing an error because of properties without decorators.
The plugin now has better DTO detection.

Add rules for decorator ordering in DTO and param classes

Choose a tag to compare

@fpolic-profico fpolic-profico released this 17 Oct 07:37
db721fe

For describing and validating requests and responses in the NestJs, we use classes and libraries.

Version v1.2.0 supports decorators from the following libraries:

  • @nestjs/swagger
  • class-validator
  • class-transformer

All other decorators are considered custom. These decorators are used on properties inside DTO, query params and path params classes.

Order enforced by the rule:

  1. @nestjs/swagger
  2. class-transformer
  3. class-validator
  4. IsOptional (class-validator)
  5. custom decorators

If there are more class-validator or custom decorators, they are ordered alphabetically.

v1.1.7

Choose a tag to compare

@fpolic-profico fpolic-profico released this 13 Feb 11:26

Full Changelog: v1.1.6...v1.1.7

v1.1.6

Choose a tag to compare

@fpolic-profico fpolic-profico released this 09 Feb 15:08

Full Changelog: v1.1.5...v1.1.6

v1.1.5

Choose a tag to compare

@fpolic-profico fpolic-profico released this 08 Feb 15:36

Full Changelog: v1.1.4...v1.1.5

v1.1.4

Choose a tag to compare

@fpolic-profico fpolic-profico released this 07 Feb 11:35

Full Changelog: v1.1.2...v1.1.4