Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule: require suggestions have different messageId than their parent report #368

Open
JoshuaKGoldberg opened this issue Aug 6, 2023 · 1 comment

Comments

@JoshuaKGoldberg
Copy link
Contributor

Code like this happens once in a while from contributors unfamiliar with ESLint rule suggestions:

context.report({
  node,
  messageId: "someMessage",
  suggest: [
    {
      messageId: "someMessage",
      // ...
    },
  ],
});

At least in typescript-eslint we try to use different messages for suggestions. Suggestion messages are typically action-oriented, whereas parent report messages are statements of fact.

What do you think about a lint rule helping devs know to use a different message between the two?

@bmish
Copy link
Member

bmish commented Aug 8, 2023

Sounds like a good idea. Perhaps a name like no-matching-violation-suggest-message-ids.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants