
rules.tslint.typedef-whitespace.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonar-web-frontend-typescript Show documentation
Show all versions of sonar-web-frontend-typescript Show documentation
Consume reports generated by tslint for code quality. Also consume reports for code duplication (either simian or cpd). Consumes the unit/integration tests reports (generated by Jasmin) coverage report (lcov generated by Istanbul). The information generated by reports are added in Sonar
The newest version!
Details
Rule: typedef-whitespace
Requires or disallows whitespace for type definitions.
Determines if a space is required or not before the colon in a type specifier.
Config
Two arguments which are both objects.
The first argument specifies how much space should be to the left of a typedef colon.
The second argument specifies how much space should be to the right of a typedef colon.
Each key should have a value of "space"
or "nospace"
.
Possible keys are:
"call-signature"
checks return type of functions.
"index-signature"
checks index type specifier of indexers.
"parameter"
checks function parameters.
"property-declaration"
checks object property declarations.
"variable-declaration"
checks variable declaration.
Examples
"typedef-whitespace":
[
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
},
{
"call-signature": "onespace",
"index-signature": "onespace",
"parameter": "onespace",
"property-declaration": "onespace",
"variable-declaration": "onespace"
}
]
Schema
{
"type": "array",
"arrayMembers": [
{
"type": "object",
"properties": {
"call-signature": {
"type": "enum",
"enumValues": [
"nospace",
"onespace",
"space"
]
},
"index-signature": {
"type": "enum",
"enumValues": [
"nospace",
"onespace",
"space"
]
},
"parameter": {
"type": "enum",
"enumValues": [
"nospace",
"onespace",
"space"
]
},
"property-declaration": {
"type": "enum",
"enumValues": [
"nospace",
"onespace",
"space"
]
},
"variable-declaration": {
"type": "enum",
"enumValues": [
"nospace",
"onespace",
"space"
]
}
}
},
{
"type": "object",
"properties": {
"call-signature": {
"type": "enum",
"enumValues": [
"nospace",
"onespace",
"space"
]
},
"index-signature": {
"type": "enum",
"enumValues": [
"nospace",
"onespace",
"space"
]
},
"parameter": {
"type": "enum",
"enumValues": [
"nospace",
"onespace",
"space"
]
},
"property-declaration": {
"type": "enum",
"enumValues": [
"nospace",
"onespace",
"space"
]
},
"variable-declaration": {
"type": "enum",
"enumValues": [
"nospace",
"onespace",
"space"
]
}
}
}
]
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy