Showing 139 of 139 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
describe(
'(test: (target?: Object, key?: string|symbol, desc?: PropertyDescriptor) => boolean, decorator: MethodDecorator): MethodDecorator',
() => {
it('decorates if test function returns true', () => {
assert(applicationSpy3.callCount === 1);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 452.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
describe('for ordinary method', () => {
it('decorates if test is truthy', () => {
assert(applicationSpy1.callCount === 1);
assert(applicationSpy1.getCall(0).args[0] === TargetClass.prototype);
assert(applicationSpy1.getCall(0).args[1] === 'method1');
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 452.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
describe('(test: boolean, decorator: PropertyDecorator): PropertyDecorator', () => {
it('decorates if test is truthy', () => {
assert(spy1.callCount === 1);
assert(spy1.getCall(0).args[0] === TargetClass1.prototype);
assert(spy1.getCall(0).args[1] === 'name');
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 127.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
describe('(test: (target?: Object, key?: string|symbol) => boolean, decorator: PropertyDecorator): PropertyDecorator', () => {
it('decorates if test function returns true', () => {
assert(spy3.callCount === 1);
assert(spy3.getCall(0).args[0] === TargetClass2.prototype);
assert(spy3.getCall(0).args[1] === 'name');
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 127.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
it('decorates if test is truthy', () => {
assert(spy1.callCount === 1);
assert(spy1.getCall(0).args[0] === TargetClass.prototype);
assert(spy1.getCall(0).args[1] === 'method1');
assert(spy1.getCall(0).args[2] === 0);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 113.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
it('decorates if test function returns true', () => {
assert(spy4.callCount === 1);
assert(spy4.getCall(0).args[0] === TargetClass.prototype);
assert(spy4.getCall(0).args[1] === 'methodOk');
assert(spy4.getCall(0).args[2] === 1);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 113.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
function getDecoratorName(type: DecoratorType): string {
'use strict';
switch (type) {
case DecoratorType.Class:
return 'Class';
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 82.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
function getDecoratorText(type: DecoratorType): string {
'use strict';
switch (type) {
case DecoratorType.Class:
return 'class decorator';
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 82.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function conditional
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function conditional(test: any, decorator: Function): any {
'use strict';
return function (target: Object, key: string|symbol, value: any): any {
if (utils.isClassDecorator(decorator, arguments)) {
let clazz: Function = target as Function;
Similar blocks of code found in 3 locations. Consider refactoring. Open
export function isParameterDecorator(decorator: Function, args: IArguments): decorator is ParameterDecorator {
'use strict';
return getDecoratorTypeFromArguments(args) === DecoratorType.Parameter;
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 55.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
export function isPropertyDecorator(decorator: Function, args: IArguments): decorator is PropertyDecorator {
'use strict';
return getDecoratorTypeFromArguments(args) === DecoratorType.Property;
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 55.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
export function isClassDecorator(decorator: Function, args: IArguments): decorator is ClassDecorator {
'use strict';
return getDecoratorTypeFromArguments(args) === DecoratorType.Class;
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 55.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
it('doesn\'t decorate if test is falsy', () => {
assert(spyWithFalse.callCount === 0);
assert(new ClazzSpiedWithFalse().status === undefined);
});
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 46.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
it('doesn\'t decorate if test function returns false', () => {
assert(spyWithFunctionReturningFalse.callCount === 0);
assert(new ClassSpiedWithFunctionReturningFalse().status === undefined);
});
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 46.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Avoid too many return
statements within this function. Open
return;
The class property 'status' must be marked either 'private', 'public', or 'protected' Open
status: string;
- Read upRead up
- Exclude checks
Rule: member-access
Requires explicit visibility declarations for class members.
Rationale
Explicit visibility declarations can make code more readable and accessible for those new to TS.
Other languages such as C# default to private
, unlike TypeScript's default of public
.
Members lacking a visibility declaration may be an indication of an accidental leak of class internals.
Notes
- TypeScript Only
- Has Fix
Config
These arguments may be optionally provided:
-
"no-public"
forbids public accessibility to be specified, because this is the default. -
"check-accessor"
enforces explicit visibility on get/set accessors -
"check-constructor"
enforces explicit visibility on constructors -
"check-parameter-property"
enforces explicit visibility on parameter properties
Examples
"member-access": true
"member-access": true,no-public
"member-access": true,check-accessor
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"no-public",
"check-accessor",
"check-constructor",
"check-parameter-property"
]
},
"minLength": 0,
"maxLength": 4
}
For more information see this page.
expected variable-declaration: 'instanceMethodSpy1' to have a typedef Open
const instanceMethodSpy1 = sinon.spy();
- Read upRead up
- Exclude checks
Rule: typedef
Requires type definitions to exist.
Notes
- TypeScript Only
Config
Several arguments may be optionally provided:
-
"call-signature"
checks return type of functions. -
"arrow-call-signature"
checks return type of arrow functions. -
"parameter"
checks type specifier of function parameters for non-arrow functions. -
"arrow-parameter"
checks type specifier of function parameters for arrow functions. -
"property-declaration"
checks return types of interface properties. -
"variable-declaration"
checks non-binding variable declarations. -
"variable-declaration-ignore-function"
ignore variable declarations for non-arrow and arrow functions. -
"member-variable-declaration"
checks member variable declarations. -
"object-destructuring"
checks object destructuring declarations. -
"array-destructuring"
checks array destructuring declarations.
Examples
"typedef": true,call-signature,parameter,member-variable-declaration
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"call-signature",
"arrow-call-signature",
"parameter",
"arrow-parameter",
"property-declaration",
"variable-declaration",
"variable-declaration-ignore-function",
"member-variable-declaration",
"object-destructuring",
"array-destructuring"
]
},
"minLength": 0,
"maxLength": 10
}
For more information see this page.
expected variable-declaration: 'invocationSpy4' to have a typedef Open
const invocationSpy4 = sinon.spy();
- Read upRead up
- Exclude checks
Rule: typedef
Requires type definitions to exist.
Notes
- TypeScript Only
Config
Several arguments may be optionally provided:
-
"call-signature"
checks return type of functions. -
"arrow-call-signature"
checks return type of arrow functions. -
"parameter"
checks type specifier of function parameters for non-arrow functions. -
"arrow-parameter"
checks type specifier of function parameters for arrow functions. -
"property-declaration"
checks return types of interface properties. -
"variable-declaration"
checks non-binding variable declarations. -
"variable-declaration-ignore-function"
ignore variable declarations for non-arrow and arrow functions. -
"member-variable-declaration"
checks member variable declarations. -
"object-destructuring"
checks object destructuring declarations. -
"array-destructuring"
checks array destructuring declarations.
Examples
"typedef": true,call-signature,parameter,member-variable-declaration
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"call-signature",
"arrow-call-signature",
"parameter",
"arrow-parameter",
"property-declaration",
"variable-declaration",
"variable-declaration-ignore-function",
"member-variable-declaration",
"object-destructuring",
"array-destructuring"
]
},
"minLength": 0,
"maxLength": 10
}
For more information see this page.
expected variable-declaration: 'decor2' to have a typedef Open
const decor2 = createParameterDecorator(spy2);
- Read upRead up
- Exclude checks
Rule: typedef
Requires type definitions to exist.
Notes
- TypeScript Only
Config
Several arguments may be optionally provided:
-
"call-signature"
checks return type of functions. -
"arrow-call-signature"
checks return type of arrow functions. -
"parameter"
checks type specifier of function parameters for non-arrow functions. -
"arrow-parameter"
checks type specifier of function parameters for arrow functions. -
"property-declaration"
checks return types of interface properties. -
"variable-declaration"
checks non-binding variable declarations. -
"variable-declaration-ignore-function"
ignore variable declarations for non-arrow and arrow functions. -
"member-variable-declaration"
checks member variable declarations. -
"object-destructuring"
checks object destructuring declarations. -
"array-destructuring"
checks array destructuring declarations.
Examples
"typedef": true,call-signature,parameter,member-variable-declaration
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"call-signature",
"arrow-call-signature",
"parameter",
"arrow-parameter",
"property-declaration",
"variable-declaration",
"variable-declaration-ignore-function",
"member-variable-declaration",
"object-destructuring",
"array-destructuring"
]
},
"minLength": 0,
"maxLength": 10
}
For more information see this page.
expected variable-declaration: 'applicationSpy1' to have a typedef Open
const applicationSpy1 = sinon.spy();
- Read upRead up
- Exclude checks
Rule: typedef
Requires type definitions to exist.
Notes
- TypeScript Only
Config
Several arguments may be optionally provided:
-
"call-signature"
checks return type of functions. -
"arrow-call-signature"
checks return type of arrow functions. -
"parameter"
checks type specifier of function parameters for non-arrow functions. -
"arrow-parameter"
checks type specifier of function parameters for arrow functions. -
"property-declaration"
checks return types of interface properties. -
"variable-declaration"
checks non-binding variable declarations. -
"variable-declaration-ignore-function"
ignore variable declarations for non-arrow and arrow functions. -
"member-variable-declaration"
checks member variable declarations. -
"object-destructuring"
checks object destructuring declarations. -
"array-destructuring"
checks array destructuring declarations.
Examples
"typedef": true,call-signature,parameter,member-variable-declaration
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"call-signature",
"arrow-call-signature",
"parameter",
"arrow-parameter",
"property-declaration",
"variable-declaration",
"variable-declaration-ignore-function",
"member-variable-declaration",
"object-destructuring",
"array-destructuring"
]
},
"minLength": 0,
"maxLength": 10
}
For more information see this page.