eslint / generator-eslint

A Yeoman generator to help with ESLint development
Other
227 stars 51 forks source link

feat: add messages to rule template #182

Closed MikeMcC399 closed 3 months ago

MikeMcC399 commented 3 months ago

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 commented 3 months ago

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

bmish commented 3 months ago

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

MikeMcC399 commented 3 months ago

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. 🙂