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

New: Add vue/name-property-required rule #945

Merged

Conversation

lbennett-stacki
Copy link
Contributor

Require that a name property is set.

Originally wanted to handle name value being an Identifier but I'm not sure its worth the hassle as I've only ever written Literal name values and I can't think of any critical case that would require an Identifier value type. Please let me know if this is a bad assumption.

Also let me know if you'd prefer just to check that the property key exists and not that the value is also a truthy Literal, understandable.

@lbennett-stacki
Copy link
Contributor Author

I'm not sure why the netlify builds failed because there is no error message but non-zero exit code 🤷‍♂️

@lbennett-stacki
Copy link
Contributor Author

mic tap

Copy link
Member

@ota-meshi ota-meshi 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 this PR!

I think it's better to change the name of the lint rule to require-name-property for consistency with other rule names.
What do you think?

Also, could you add documentation like the following file?
https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/require-default-prop.md

lib/rules/name-property-required.js Outdated Show resolved Hide resolved
tests/lib/rules/name-property-required.js Outdated Show resolved Hide resolved
lib/rules/name-property-required.js Outdated Show resolved Hide resolved
Copy link
Member

@ota-meshi ota-meshi 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 changing this PR! LGTM!

@lbennett-stacki
Copy link
Contributor Author

lbennett-stacki commented Sep 17, 2019

Thanks @ota-meshi! Looks like we cant merge because of the broken circleci build. Do we need a hand fixing that or can we force merge and ignore?

@ota-meshi
Copy link
Member

@LukeeeeBennett Hello!
npm install failed because the data cached in circleci is broken. It's not your fault.

@ota-meshi ota-meshi merged commit 06dc4a2 into vuejs:master Dec 26, 2019
@vue-bot
Copy link

vue-bot commented Dec 26, 2019

Hey @LukeeeeBennett, thank you for your time and effort spent on this PR, contributions like yours help make Vue better for everyone. Cheers! 💚

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

Successfully merging this pull request may close these issues.

None yet

3 participants