"Unexpected token :" for JSON-LD (ld+json).
See original GitHub issueIf I place a JSON-LD script element in an HTML file, ESLint throws an error of “Unexpected token :”.
Google doc: https://developers.google.com/search/docs/guides/intro-structured-data
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"url": "http://www.example.com",
"name": "Unlimited Ball Bearings Corp.",
"contactPoint": {
"@type": "ContactPoint",
"telephone": "+1-401-555-1212",
"contactType": "Customer service"
}
}
</script>
Disabling ESLint in Sublime Text menubar’s “Toggle” command removes the error.
Adding /* eslint-disable unexpected-token */
doesn’t remove the error.
Should this be reported here or at SublimeLinter-eslint?
Can this be prevented, please?
- ESLint 4.17.0
- SublimeLinter 3.10.10
- Sublime Text 3.0
- macOS 10.13.3 High Sierra
Issue Analytics
- State:
- Created 6 years ago
- Comments:19 (9 by maintainers)
Top Results From Across the Web
What Is JSON and How to Handle an “Unexpected Token” Error
In this article you will learn what JSON is and how you can deal with errors occurring when parsing JSON data, such as...
Read more >jquery - Dynamic Script tag causing "unexpected token illegal"
1 Answer 1 · What would be the best way to accomplish generating a dynamic script tag filled with JSON content? – user2916134....
Read more >How to fix Unexpected Token in JSON error (for ... - YouTube
Not a programmer? Read this! ** - If you get this error in an app you didn't make, and/or you're not a web...
Read more >JSON-LD 1.1 Framing - W3C on GitHub
1.5 Syntax Tokens and Keywords. This specification adds a number of keywords ( framing keywords ) to the ones defined in the JSON-LD...
Read more >JSON-LD 1.1 - W3C
A blank node identifier is a string that can be used as an identifier for a blank node within the scope of a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @jaepage, thanks for the issue. It looks like there’s not enough information for us to know how to help you.
If you’re reporting a bug, please be sure to include:
eslint -v
)Requesting a new rule? Please see Proposing a New Rule for instructions.
Requesting a rule change? Please see Proposing a Rule Change for instructions.
If it’s something else, please just provide as much additional information as possible. Thanks!
I think we should close this issue. I’m still not sure what exactly was the problem.