Région de recherche :

Date :

https://stackoverflow.com › questions › 63504207

ES-Lint Rule or Plugin to identify the commented code

eslint-plugin-etc Is a great suite of extra ESLint rules (often TS-related) and they offer one for commented out code: https://github.com/cartant/eslint-plugin-etc/blob/main/docs/rules/no-commented-out-code.md. Add it to your ESLint config. rules: { "etc/no-commented-out-code": "error" }

https://eslint.org › docs › latest › rules › no-inline-comments

no-inline-comments - ESLint - Pluggable JavaScript Linter

A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.

https://github.com › cartant › eslint-plugin-etc › blob › main › docs › rules › no-commented-out-code.md

eslint-plugin-etc/docs/rules/no-commented-out-code.md at main - GitHub

The rule uses a relatively simple heuristic and if a comment is mistakenly deemed to be commented out code, using /// ... or /*/ ... */ will function as a workaround. Rule details. Examples of incorrect code for this rule: // const answer = 54; const answer = 42; Examples of correct code for this rule:

https://github.com › eslint › eslint › issues › 604

Rule: No commented code · Issue #604 · eslint/eslint - GitHub

Commenting code out and leaving it in your files can lead to accumulating code for fear of deleting it and loosing some context, when in majority of cases, it's not necessary. Better approach for context is to leave a textual comment explaining edge case.

https://eslint.org › docs › latest › rules › no-warning-comments

no-warning-comments - ESLint - Pluggable JavaScript Linter

Developers often add comments to code which is not complete or needs review. Most likely you want to fix or review the code, and then remove the comment, before you consider the code to be production ready.

https://eslint-community.github.io › eslint-plugin-eslint-comments

Getting Started | eslint-plugin-eslint-comments - GitHub Pages

📖 Usage. Configure your eslint.config.* file. For example: js. import js from "@eslint/js" import comments from "@eslint-community/eslint-plugin-eslint-comments/configs" export default [ js.configs.recommended, comments.recommended, ] If your project's ESLint config runs in CommonJS instead of ESM, use require(): js.

https://welovedevs.com › fr › articles › eslint

ESLint: Comment coder proprement en JavaScript - WeLoveDevs.com

ESLint est un plugin qui permet d’uniformiser la mise en forme du code et d’identifier les bugs à l’écriture. Il n’a pas de rapport avec le code commenté, qui est ignoré par ESLint.

https://archive.eslint.org › docs › 4.0.0 › rules › no-inline-comments

no-inline-comments - Rules - ESLint - Pluggable JavaScript linter

This rule disallows comments on the same line as code. Examples of incorrect code for this rule: /*eslint no-inline-comments: "error"*/ var a = 1; // declaring a to 1 function getRandomNumber { return 4; // chosen by fair dice roll. // guaranteed to be random.} /* A block comment before code */ var b = 2; var c = 3; /* A block comment after code */

https://www.typeerror.org › docs › eslint › rules › no-inline-comments

no-inline-comments - ESLint Documentation - TypeError

Code can become difficult to read if comments immediately follow the code on the same line. On the other hand, it is sometimes faster and more obvious to put comments immediately following code. Rule Details This rule disallows comments on the same line as code. Examples of incorrect code for this rule: /*eslint no-inline-comments: "error ...

https://stackoverflow.com › questions › 54161947

visual studio code - how to support inline comments when using eslint ...

For this answer, I am going to suggest an "extends" configuration that supports inline-comments, and it is also ESLint's go to rule-set. @See the snippet below. works for, which might be a custom style-guide. A good rounded base is the following: ** "extends": ["eslint:recommended"]** The Prettier ESLint Plugin