Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elitewise/eslint-plugin-comments-analyser
ESLint Plugin that ensures each function or file is accompanied by a code comment
https://github.com/elitewise/eslint-plugin-comments-analyser
eslint-plugin eslint-rules
Last synced: about 1 month ago
JSON representation
ESLint Plugin that ensures each function or file is accompanied by a code comment
- Host: GitHub
- URL: https://github.com/elitewise/eslint-plugin-comments-analyser
- Owner: EliteWise
- Created: 2024-02-10T15:39:45.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-02-18T18:43:12.000Z (10 months ago)
- Last Synced: 2024-11-14T00:41:13.637Z (about 1 month ago)
- Topics: eslint-plugin, eslint-rules
- Language: TypeScript
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# eslint-plugin-comments-analyser
This ESLint plugin provides two rules: `function`, to ensure that each function is preceded by a comment explaining its purpose, and `file`, to verify that each script file contains at least one comment.
## Installation
You will need [Node.js](https://nodejs.org/) and [npm](https://npmjs.com/) installed to use this plugin. You can then install the ESLint plugin and ESLint using npm:
```bash
npm install eslint eslint-plugin-comments-analyser --save-dev
npm install typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin --save-dev
```## Configuration
After installation, add `eslint-plugin-comments-analyser` to the plugins section of your `.eslintrc` configuration file.
Then activate the rule by adding a rule to the rules section.```json
{
"plugins": [
"eslint-plugin-comments-analyser"
],
"rules": {
"comments-analyser/function": "warn",
"comments-analyser/file": "warn"
}
}
```You can adjust the level of the rule to suit your needs, using `off`, `warn` or `error`.
## Rules
- `function`: This rule checks that all functions are preceded by a comment.
- `file`: This rule ensure each file (.ts / .tsx / .js) contains at least one comment.