eslint-plugin-comments-analyser

1.2.4 • Public • Published

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 and npm installed to use this plugin. You can then install the ESLint plugin and ESLint using npm:

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.

{
  "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.

Dependents (0)

Package Sidebar

Install

npm i eslint-plugin-comments-analyser

Weekly Downloads

4

Version

1.2.4

License

ISC

Unpacked Size

17 kB

Total Files

4

Last publish

Collaborators

  • elitewise