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

Are the human-readable messages constant as part of the public API? #49

Closed
anko opened this issue Jun 7, 2015 · 2 comments
Closed

Are the human-readable messages constant as part of the public API? #49

anko opened this issue Jun 7, 2015 · 2 comments

Comments

@anko
Copy link

anko commented Jun 7, 2015

I'm writing a program that only needs to check for validity of an AST subtree, so I'm using esvalid.errors(partOfAst) and stripping all errors with the message "given AST node should be of type Program". I've pinned esvalid as a specific version, because I'm unsure whether that's part of the public API.

Is it? Might that human-readable message change in the future?

If I've correctly understood, #33 plans to introduce machine-readable identifiers for the specific error types, which might be a better way to solve this.

@michaelficarra
Copy link
Member

You've understood correctly. The messages are strictly for human consumption, and may change arbitrarily in a patch release. If you'd like the functionality that you've described, someone will need to implement #33. Before doing all that work, however, it would be great to update this with ES6 support. There are many more validations we need to make. For instance, the only valid MetaProperty node has a meta of {type: "Identifier", name: "new"} and a property of {type: "Identifier", name: "target"}.

@anko
Copy link
Author

anko commented Feb 1, 2016

Closing in favour of #33.

@anko anko closed this as completed Feb 1, 2016
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

No branches or pull requests

2 participants