Skip to content

require-meta-type does not work if create is not a function #83

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

Closed
MrHen opened this issue Jun 11, 2019 · 2 comments · Fixed by #84
Closed

require-meta-type does not work if create is not a function #83

MrHen opened this issue Jun 11, 2019 · 2 comments · Fixed by #84

Comments

@MrHen
Copy link
Contributor

MrHen commented Jun 11, 2019

The following does not fail linting:

/* eslint eslint-plugin/require-meta-type: error */

function create(context) {
	// ...
}

module.exports = {
	meta: {}, // should fail
	create
};

/* eslint eslint-plugin/require-meta-type: error */

const create = (context) => {
	// ...
}

module.exports = {
	meta: {}, // should fail
	create
};

It looks like the utility for checking if a file contains a rule has a hard check for create being a function. Is this check necessary? Can I submit a PR to either:

  • Allow identifiers on the right side of create even if they are not functions?
  • Or follow identifiers on the right side of create if they reference a function in the same file?
@aladdin-add
Copy link
Contributor

  • Allow identifiers on the right side of create even if they are not functions?
  • Or follow identifiers on the right side of create if they reference a function in the same file?

personally I prefer the second, but I'm fine either way. PRs are welcome! 😄

@MrHen
Copy link
Contributor Author

MrHen commented Jul 24, 2019

Awesome, I should have time this week to whip something up.

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