Variable names that consist of a single character may be uppercase. In general, even single-character variable names should be lowercase. However, in some situations, mathematical notation uses uppercase letters. In such situations, uppercase variable names may be used.
Except for variables, all instance, class, and class constants are in mixed case with a lowercase first letter. Internal words start with capital letters. Variable names should not start with underscore _ or dollar sign $ characters, even though both are allowed. Variable names should be short yet meaningful.
A valid variable name starts with a letter, followed by letters, digits, or underscores. MATLAB® is case sensitive, so A and a are not the same variable. The maximum length of a variable name is the value that the namelengthmax command returns.
PHP recommendations are contained in PSR-1 (PHP Standard Recommendation 1) and PSR-12. According to PSR-1, class names should be in PascalCase, class constants should be in MACRO_CASE, and function and method names should be in camelCase.
You can solve the problem by editing your tslint.json
and adding "allow-leading-underscore"
to the "variable-name"
array of your "rules"
.
// tslint.json contents
{
// ...
"rules": {
// ...
"variable-name": [
true,
// ...
"allow-leading-underscore"
]
},
// ...
}
I have updated tslint.json
, configured the file and added optional arguments to the array of variable-name.
"allow-leading-underscore"
allows underscores at the beginning (only has an effect if “check-format” specified)
"allow-pascal-case"
allows PascalCase in addition to lowerCamelCase.
"allow-snake-case"
allows snake_case in addition to lowerCamelCase.
"allow-trailing-underscore"
allows underscores at the end. (only has an effect if “check-format” specified)
{
// ...
"rules": {
"variable-name": [
true,
"allow-leading-underscore"
],
},
// ...
}
You can configure tslint.json
according to your requirements.
This link might be helpful. https://palantir.github.io/tslint/rules/variable-name/
You can solve the problem by editing your tslint.json and adding all this properties to the "variable-name" :
"variable-name": {
"options": [
"ban-keywords",
"check-format",
"allow-pascal-case",
"allow-leading-underscore",
"allow-snake-case",
"allow-trailing-underscore",
"require-const-for-all-caps"
]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With