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

Chore: use meta.messages in some rules (1/4) #10764

Merged
merged 14 commits into from Aug 18, 2018
Merged

Conversation

aladdin-add
Copy link
Member

@aladdin-add aladdin-add commented Aug 15, 2018

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[x] Other, please explain:

What changes did you make? (Give an overview)

  • add a interal rule: consistent-meta-messages
  • use messages in some rules

Is there anything you'd like reviewers to focus on?

Not all the rules have to be changed in just one PR, I plan to separate it to 3~4 PR. temporally disabled the rule, and will enable it when all the changes finished.

@aladdin-add aladdin-add added rule Relates to ESLint's core rules evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion chore This change is not user-facing labels Aug 15, 2018
Copy link
Member

@mysticatea mysticatea left a comment

Choose a reason for hiding this comment

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

Thank you for advancing this!
I found a matter to address i18n better.

const messageId = spaceRequired ? "missing" : "unexpected";

// const message = "{{type}} space {{side}} *.";
const data = { side };
Copy link
Member

Choose a reason for hiding this comment

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

I'd like to separate message IDs for before / after because languages other than English can't use the word as is.

@aladdin-add aladdin-add changed the title wip: Chore: use meta.messages in some rules Chore: use meta.messages in some rules Aug 16, 2018
Copy link
Member

@platinumazure platinumazure 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!

Left small nitpicks on the consistent-meta-messages rule.

},
schema: [],
messages: {
expectedMessages: "expected `meta.messages` property"
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Could the first word be capitalized (Expected instead of expected)?


create(context) {
return {
AssignmentExpression(node) {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: This could be simplified using selectors: "AssignmentExpression[left.object.name='module'][left.property.name='exports']"(node) {

@aladdin-add aladdin-add changed the title Chore: use meta.messages in some rules Chore: use meta.messages in some rules (1/4) Aug 18, 2018
@aladdin-add aladdin-add merged commit cb946af into master Aug 18, 2018
@aladdin-add aladdin-add deleted the chore/messageId branch August 18, 2018 15:57
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 15, 2019
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion chore This change is not user-facing evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants