Are you an LLM? You can read better optimized documentation at /docs/guide/usage/linter/rules/eslint/no-inline-comments.md for this page in Markdown format
Comments placed at the end of a line of code can make code harder to read. They can easily be missed when scanning vertically, and they make lines longer. Moving comments to their own lines makes them more prominent and reduces line length.
eslint/no-inline-comments Pedantic
What it does
Disallows comments on the same line as code.
Why is this bad?
Comments placed at the end of a line of code can make code harder to read. They can easily be missed when scanning vertically, and they make lines longer. Moving comments to their own lines makes them more prominent and reduces line length.
Examples
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Configuration
This rule accepts a configuration object with the following properties:
ignorePattern
type:
string | nullA regex pattern to ignore certain inline comments.
Comments matching this pattern will not be reported.
Example configuration:
How to use
To enable this rule using the config file or in the CLI, you can use:
References