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

Improve violation reporting location in no-missing-placeholders #280

Merged

Conversation

bmish
Copy link
Member

@bmish bmish commented Aug 4, 2022

Fixes #276 (half of it).

Previously, the violation might not even be reported inside the specific context.report() call that it was for.

Now, we report on the data object when it exists.

module.exports = {
  meta: {
    messages: {
      foo: 'hello world', // violation should not be reported here
    }
  },
  create(context) {
    context.report({
      node,
      messageId: 'foo', 
      data: { // violation should be reported here
        bar: 'abc' 
      }
    });
  },
};

@bmish bmish added the bug label Aug 4, 2022
@bmish bmish force-pushed the no-missing-placeholders-loc-fix branch from 2baa352 to 01003fa Compare August 4, 2022 03:19
@bmish bmish changed the title Improve violation reporting location in no-missing-message-ids Improve violation reporting location in no-missing-placeholders Aug 4, 2022
@bmish bmish force-pushed the no-missing-placeholders-loc-fix branch from 01003fa to 066e677 Compare August 4, 2022 03:25
* main:
  fix: clarify report messages for no-missing-placeholders and no-unused-placeholders (eslint-community#278)
  fix: allow additional schema types in require-meta-schema (eslint-community#277)
@aladdin-add aladdin-add merged commit 31ff45c into eslint-community:main Aug 4, 2022
bmish added a commit to bmish/eslint-plugin-eslint-plugin that referenced this pull request Aug 4, 2022
* main:
  fix: reporting location in no-missing-placeholders (eslint-community#280)
  fix: clarify report messages for no-missing-placeholders and no-unused-placeholders (eslint-community#278)
  fix: allow additional schema types in require-meta-schema (eslint-community#277)
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.

Incorrect reporting location for no-missing-placeholders, no-unused-placeholders
2 participants