Enforce the use of $ prefix for variable names representing HTML elements and $$ prefix for HTML element collections in JavaScript code.
You can install this ESLint plugin using npm:
npm install eslint-plugin-dollar-sign-html-el --save-dev
Once installed, add eslint-plugin-dollar-sign-html-el to your ESLint configuration file (e.g., .eslintrc.js):
module.exports = {
plugins: ['dollar-sign-html-el'],
rules: {
'dollar-sign-html-el/html-element-variable-prefix': 'error'
}
};
This will enable the rule to enforce the use of $ prefix for variable names representing HTML elements and $$ prefix for HTML element collections.
This rule enforces the use of $ prefix for variable names representing HTML elements and $$ prefix for HTML element collections.
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on GitHub.
This project is licensed under the MIT License.