This plugin intends to let you use semantic variable names when naming variables.
❌ const show = true;
👌 const isShow = true;
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install eslint-plugin-wittgenstein
:
npm install eslint-plugin-wittgenstein --save-dev
On your .eslintrc
file extend the plugin's recommended configuration:
{
"extends": ["plugin:wittgenstein/recommended"]
}
If you want to use your own configuration, you can do so by adding the plugin to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": ["wittgenstein"]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"wittgenstein/variable-name-boolean": "warn"
}
}
💡 Manually fixable by editor suggestions.
Name | Description | 💡 |
---|---|---|
variable-name-array | Make sure your array type variable name ends with List or s . |
💡 |
variable-name-boolean | Make sure your boolean type variable name start with is . |
💡 |
variable-name-getter | Make sure your getter function name start with get . |
💡 |
variable-name-regex | Make sure your regex type variable name ends with Regex . |
💡 |
Contribution is welcome! There are many ways you could help:
- Triaging Issues
- Writing Code
- Improving Doc
If you encounter any issues or have suggestions for improvements, please open an issue on the GitHub repository. Pull requests are also appreciated.