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

feat: add messages to rule template #182

Merged
merged 2 commits into from
May 13, 2024

Conversation

MikeMcC399
Copy link
Contributor

@MikeMcC399 MikeMcC399 commented May 10, 2024

Issue

After creating a plugin with yo eslint:plugin, then a rule with yo eslint:rule, executing linting with npx eslint . produces the following error and there is no related property for this in the skeleton rule which has been created.

error meta.messages must contain at least one violation message eslint-plugin/prefer-message-ids

Change

    messages: {}, // Add messageId and message

is added to rule/templates/_rule.js

References

@MikeMcC399 MikeMcC399 marked this pull request as ready for review May 10, 2024 16:06
@MikeMcC399
Copy link
Contributor Author

I have verified that the change to the template works and can post the details if required.

rule/templates/_rule.js Outdated Show resolved Hide resolved
@bmish
Copy link
Sponsor Member

bmish commented May 10, 2024

As a side note, you added the new key in the correct position based on the ordering in this lint rule: https://github.com/eslint-community/eslint-plugin-eslint-plugin/blob/main/docs/rules/meta-property-ordering.md

Co-authored-by: Bryan Mishkin <698306+bmish@users.noreply.github.com>
@MikeMcC399
Copy link
Contributor Author

As a side note, you added the new key in the correct position based on the ordering in this lint rule: https://github.com/eslint-community/eslint-plugin-eslint-plugin/blob/main/docs/rules/meta-property-ordering.md

More by luck than good judgement I fear. I just added it to the end of the list. 🙂

Copy link
Member

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@aladdin-add aladdin-add merged commit f1c1240 into eslint:main May 13, 2024
10 checks passed
@github-actions github-actions bot mentioned this pull request May 13, 2024
@MikeMcC399 MikeMcC399 deleted the add/messages-to-rule branch May 13, 2024 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing meta.messages property
3 participants