eslint-plugin-dhwani-gatepass
v1.0.0
Published
Custom ESLint rules for Dhwani Gatepass
Readme
eslint-plugin-dhwani-gatepass
This ESLint plugin contains a set of custom rules specifically designed for enforcing coding standards and practices within Dhwani projects. It helps maintain code quality, consistency, and avoids common coding pitfalls.
Installation
To use eslint-plugin-dhwani-gatepass in your project, you'll need to install ESLint first, if you haven't already:
npm install eslint --save-devNext, install eslint-plugin-dhwani-gatepass:
npm install eslint-plugin-dhwani-gatepass --save-devAdd dhwani-gatepass to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": [
"dhwani-gatepass"
]
}Then configure the rules you want to use under the rules section:
{
"rules": {
"dhwani-gatepass/function-name-specific": "error",
"dhwani-gatepass/method-name-action": "error",
"dhwani-gatepass/url-no-underscores": "error",
// Add additional rules here
}
}Supported Rules
- function-name-specific: Ensure function names are specific and clearly indicate their purpose.
- method-name-action: Enforce method names to be verbs, clearly indicating actions.
- url-no-underscores: Ensure that URLs do not contain underscores to adhere to standard URL practices.
- header-comment-required: Require a header comment for each function explaining its purpose.
- return-values-documented: Ensure that return values for functions are documented.
- unique-names-within-directory: Enforce unique naming within a directory scope.
- reusable-code-comments: Ensure reusable blocks of code have appropriate comments.
- generic-code-no-client-name: Check that generic code does not include client-specific names or descriptions.
- code-comments-version-control: Require version control annotations in code comments.
- console-log-standards: Enforce standards for using console logs for debugging purposes.
- helper-functions-maintained: Ensure helper functions are maintained and used appropriately.
- no-sensitive-info: Prevent hard-coded sensitive information from appearing in the code.
- file-upload-permissible-types: Restrict file uploads to permissible file types.
- file-upload-size-restriction: Ensure file uploads do not exceed specified size limits.
- csv-upload-admin-only: Allow CSV uploads only for admin users. session-timeout-enforced: Enforce session timeout settings.
- logging-for-troubleshooting: Require adequate logging for troubleshooting purposes.
- efficient-algorithms-used: Encourage the use of efficient algorithms. comments-not-missing-outdated: Check for missing or outdated comments.
- clear-dependency-documentation: Require clear documentation for all external dependencies.
- cross-browser-compatibility: Ensure code is compatible across all targeted browsers.
For more details on configuring the rules, please refer to the ESLint documentation.
Contributing
Contributions to improve eslint-plugin-dhwani-gatepass are welcome. Please ensure to run tests and lint your code before submitting a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Notes
- Replace any placeholders like plugin rules or descriptions with actual information specific to what each rule does based on your implementation.
- Ensure the installation instructions are correct based on how you have structured your npm package.
- You may want to include a section on testing if your plugin includes complex logic or if you want to encourage community contributions.
