Skip to content

@kazupon/prefer-scope-on-tag-comment ​

Enforce adding a scope to tag comments

Rule Details ​

This rule enforces that tag comments (like TODO, FIXME, etc.) include a scope identifier in parentheses. The scope can be an author name, team name, ticket number, module name, or any other identifier that provides context about the comment.

Fail ​

Some examples of incorrect code for this rule:

Pass ​

Some examples of correct code for this rule:

🔧 Options ​

json
{
  "@kazupon/prefer-scope-on-tag-comment": [
    "error",
    {
      "tags": ["TODO", "FIXME", "HACK", "BUG", "NOTE"],
      "directives": [
        "eslint-disable",
        "eslint-disable-next-line",
        "eslint-disable-line",
        "@ts-expect-error",
        "@ts-ignore",
        "@ts-nocheck"
      ]
    }
  ]
}
  • tags (default: ["TODO", "FIXME", "HACK", "BUG", "NOTE"])
    • Tag keywords to check
  • directive (default: ["eslint-disable", "eslint-disable-next-line", "eslint-disable-line", "@ts-expect-error", "@ts-ignore", "@ts-nocheck"])
    • Include tag checks for comment directives

Version ​

This rule was introduced in @kazupon/eslint-plugin v0.4.0

Implementation ​

🔗 See Also ​