
rules.tslint.no-unused-variable.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: no-unused-variable
Disallows unused imports, variables, functions and private class members.
Config
Three optional arguments may be optionally provided:
"check-parameters"
disallows unused function and constructor parameters.
- NOTE: this option is experimental and does not work with classes
that use abstract method declarations, among other things.
"react"
relaxes the rule for a namespace import named React
(from either the module "react"
or "react/addons"
).
Any JSX expression in the file will be treated as a usage of React
(because it expands to React.createElement
).
{"ignore-pattern": "pattern"}
where pattern is a case-sensitive regexp.
Variable names that match the pattern will be ignored.
Examples
"no-unused-variable": [true, "react"]
"no-unused-variable": [true, {"ignore-pattern": "^_"}]
Schema
{
"type": "array",
"arrayMembers": [
{
"type": "list",
"listType": {
"type": "enum",
"enumValues": [
"check-parameters",
"react"
]
}
},
{
"type": "object",
"properties": {
"ignore-pattern": {
"type": "string"
}
}
}
]
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy