src/database/transaction.decorator.ts

Summary

Maintainability
A
0 mins
Test Coverage

non-arrow functions are forbidden
Open

        descriptor.value = function(...args: any[]) {

Rule: only-arrow-functions

Disallows traditional (non-arrow) function expressions.

Note that non-arrow functions are allowed if 'this' appears somewhere in its body (as such functions cannot be converted to arrow functions).

Rationale

Traditional functions don't bind lexical scope, which can lead to unexpected behavior when accessing 'this'.

Config

Two arguments may be optionally provided:

  • "allow-declarations" allows standalone function declarations.
  • "allow-named-functions" allows the expression function foo() {} but not function() {}.
Examples
"only-arrow-functions": true
"only-arrow-functions": true,allow-declarations,allow-named-functions
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "allow-declarations",
      "allow-named-functions"
    ]
  },
  "minLength": 0,
  "maxLength": 1
}

For more information see this page.

non-arrow functions are forbidden
Open

    return function(target: Instance, property: string | symbol, descriptor: PropertyDescriptor) {

Rule: only-arrow-functions

Disallows traditional (non-arrow) function expressions.

Note that non-arrow functions are allowed if 'this' appears somewhere in its body (as such functions cannot be converted to arrow functions).

Rationale

Traditional functions don't bind lexical scope, which can lead to unexpected behavior when accessing 'this'.

Config

Two arguments may be optionally provided:

  • "allow-declarations" allows standalone function declarations.
  • "allow-named-functions" allows the expression function foo() {} but not function() {}.
Examples
"only-arrow-functions": true
"only-arrow-functions": true,allow-declarations,allow-named-functions
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "allow-declarations",
      "allow-named-functions"
    ]
  },
  "minLength": 0,
  "maxLength": 1
}

For more information see this page.

There are no issues that match your filters.

Category
Status