IntelliJ IDEA: json file syntax

gefei

I am using IntelliJ IDEA 14 for a web project, where I want to keep a file a.js containing a JSON object. The content of the a.js is

{
    "ac" : "abc",
    "d" : 4,
    "_constants": {}
}

While editing this file, IntelliJ keeps reminding me that this file has syntactic errors. It makes a hints after "ac", "d" and "_constants", before the semicolon, saying "Expecting newline or semicolon".

Does not IntelliJ IDEA accept a file containing a JSON object as a legitimate javascript file?

yole

IntelliJ has a separate file type for JSON files. It will be applied if you rename your file from a.js to a.json.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Adding JSON syntax highlighting to IntelliJ IDEA for .liquid files

Intellij IDEA and SBT syntax error

Intellij IDEA syntax warnings, cannot resolve symbols

Kafka producer on Intellij Idea giving syntax errors

Importing jar file into IntelliJ Idea?

Mustache as an unknown file (IntelliJ Idea)

Scratch file not running on IntelliJ IDEA

Importing JSON library into IntelliJ IDEA

spring-configuration-metadata.json file is not generated in IntelliJ Idea for Kotlin @ConfigurationProperties class

Jenkinsfile syntax highlighting in Java project using Intellij Idea

Intellij IDEA. Check syntax for files without extension

IntelliJ IDEA - Syntax Highlighting of SQL Inside Java Code

Intellij IDEA Contract false-positive syntax error

Navigate to the changed line of code in a file in Intellij Idea

Intellij idea hotkey to open context menu of a file

IntelliJ IDEA run/debug just one file

Configure Intellij IDEA to run batch file

Is there a keyboard shortcut to create a new file in IntelliJ IDEA?

Execute command on saving a file in Intellij IDEA

Intellij IDEA converts text to tags in a html file

How to run Java scratch file in IntelliJ IDEA

Why is .mxml the default file filter in IntelliJ Idea?

Intellij IDEA changes file permissions on save

intellij IDEA: unknown function in SASS file

Adding class/jar file to IntelliJ IDEA

How to create the jspf file in intelliJ IDEA

Intellij IDEA cannot format file type ftl

Get object as JSON in IntelliJ Idea from debugger

How to copy a path in a JSON in IntelliJ IDEA?