TSLint rules to prevent usage of the word "data" in variables and function names
Install:
npm install --save-dev no-data
In your tslint.json:
{
"rulesDirectory": [
"node_modules/no-data/dist"
],
"rules": {
"no-data-in-variable": true,
"no-data-in-class": true
}
}The word data is not allowed when declaring variable via const let or var
The word data is not allowed in class names and class properties.
allow-class-name: allow the word data in class names.allow-class-properties: allow the word data in class properties.
- This will show warning when
dataappear in class name or property name.
{
"rules": {
"no-data-in-class": true
}
}- This will show warning when
dataappear in property name only.
{
"rules": {
"no-data-in-class": [true, "allow-class-name"]
}
}- Disallow in function arguments.