-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
JSON6 #4
Comments
Thank you for this issue! I didn't know JSON6 so I read the documentation. e.g. {`a`:123} If JSON6 has a syntax that is unrelated to ES syntax, I think it difficult to support JSON6 with this plugin. |
Right, it is a superset, but it could still be useful to lint against the ES-safe subset of that superset. (I've asked at d3x0r/JSON6#44 (comment) whether the ES-safe subset could be enforced at the level of the parser, but even if not, I'd think a caveat that the plugin only supports the safe subset might be enough.) |
Perhaps supporting some JSON6 syntax can be a useful case even for users who don't use JSON6. Currently, the parser provided by this plugin treats AST that cannot be parsed by JSON5 as a parsing error. For example, autofix I probably need to make the following changes:
I will work on these when I have time. However, the following JSON6 syntax still cannot be parsed:
(I'm not familiar with it, so there may be others.) |
Re: underscores separating digits, just as an FYI, it looks like there is https://babeljs.io/docs/en/babel-plugin-syntax-numeric-separator for the syntax alone, and https://babeljs.io/docs/en/babel-plugin-proposal-numeric-separator if transforming it, so if users applied the plugin with babel-eslint, I'd think they could get that feature. I imagine it should come to espree eventually, however. |
I know that If I have the time to learn a lot of syntax it might support it, but maybe it's faster to change the Numeric Separators to Stage 4 😅 |
FWIW, I've filed d3x0r/JSON6#46 which also indicates a few other features where JSON6 diverges from ES. |
I changed the parser to allow some syntax, added rules to report the syntax allowed by the parser, and released it. However, I do not yet provide a ruleset for JSON6. I'm learning the syntax of JSON6 while also referring to the issue you posted in JSON6 repo. |
Excellent, thanks! If you find any, I'd be most grateful if you could mention on the issue any areas where JSON6 differs from ES (besides those I've mentioned). |
Looks like a great tool...
Might you add tests and docs indicating support for JSON6 if it may work? https://github.com/d3x0r/JSON6
The text was updated successfully, but these errors were encountered: