Open the JSON file in VS Code, click the language-mode indicator on the right side of the Status Bar, and choose JSON rather than JSON with Comments. That changes the editor’s syntax diagnostics for the current file. To make the choice persistent, add a narrowly targeted files.associations entry in User or Workspace Settings. If you also need checks for required properties or allowed values, configure json.schemas separately; a schema does not determine whether comments and trailing commas are accepted.
JSON and JSONC are different language modes
VS Code has two related modes. The default JSON mode follows the JSON specification. JSON with Comments, identified internally as jsonc, is intended for files that use JavaScript-style comments and trailing commas. The active mode is visible in the Status Bar, so the filename alone does not tell you which rules the editor is applying.
As an Amazon Associate I earn from qualifying purchases.
| Editor mode | Comments | Trailing commas | Best fit |
|---|---|---|---|
| JSON | Not part of strict JSON syntax; diagnostics should flag them. | Not part of strict JSON syntax; diagnostics should flag them. | Data files that another JSON parser must consume exactly. |
JSON with Comments (jsonc) |
Line comments beginning with // and block comments between /* and */ are supported. |
Permitted by the editor, with a warning. | Human-maintained configuration files that intentionally contain comments or relaxed punctuation. |
The distinction is about editing and diagnostics inside VS Code. It does not rewrite the file, remove comments, add or remove commas, or change the parser used by the application that eventually reads the file.
Free tools Windows power users keep installed
One-click scans. No signup required.
“In addition to the default JSON mode following the JSON specification, VS Code also has a JSON with Comments (jsonc) mode.” — Visual Studio Code documentation
#1 Best Overall
SaleTOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones
- [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
- [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
- [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
- [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
- [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
Switch the open file to strict JSON
This is the fastest fix when only one file needs strict checking.
- Open the target file in VS Code.
- Look at the right side of the Status Bar. The language indicator normally reads JSON or JSON with Comments.
- Select that indicator to open the language-mode picker.
- Choose JSON.
The indicator should now read JSON. If it still says JSON with Comments, the file remains in JSONC mode and the editor is still using the relaxed rules. Click the indicator again and select the exact JSON entry, not a similarly named configuration mode.
Check that the change is doing what you expect
For a quick editor-side check, temporarily insert a comment or a trailing comma into a small test object. In strict JSON mode, VS Code should report that syntax as invalid. Remove the test characters afterward if the file is meant to remain valid. This verifies the selected language mode; it is not a test of the parser in your production application.
What strict mode changes—and what it does not
Strict JSON mode changes the syntax grammar VS Code applies while you edit. A // note line, a /* note */ block, and a comma immediately before a closing brace or bracket are all outside strict JSON. In JSON mode, those constructs should receive editor diagnostics. JSONC is deliberately more permissive: comments are accepted and trailing commas are allowed with a warning.
This setting does not automatically clean up a file. Selecting JSON will not delete comments, move their text into a property, or remove a final comma. It also does not export a different file or convert JSONC into JSON. Treat the diagnostics as a guide, edit the document yourself, and save the corrected content.
Most importantly, the language mode belongs to VS Code. It does not change the parser in a service, build script, deployment tool, command-line validator, or other application that later consumes the file. If that external tool has stricter rules, run its documented validation as well; if it permits extensions, VS Code’s mode still does not make those extensions part of the JSON specification.
Persist strict mode for matching files
The Status Bar choice can be made a default for a filename or pattern with files.associations. Decide first whether the rule should follow you everywhere or only apply to one project.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →User Settings: a personal default
User Settings apply across your VS Code installations and workspaces. Use them when a file type should normally be treated as strict JSON in your personal workflow. Open Settings, search for files associations, or open the JSON view of User Settings and add a focused mapping such as:
Rank #2
- 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
- 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
- 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
- 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
- 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
{
"files.associations": {
"*.strict.json": "json",
"service-config.json": "json"
}
}
The left side is the filename or pattern to match; the value json selects strict JSON mode. Replace the examples with the actual names used by your project. A specific filename is safer than changing every file ending in .json.
A user rule is convenient for a personal convention, but it follows you into unrelated workspaces. Before adding a pattern, consider whether another project uses the same suffix for JSONC configuration. If so, a workspace rule or a more distinctive filename is less disruptive.
Workspace Settings: a project rule
Workspace Settings are stored with the project under its .vscode configuration directory and can be shared with collaborators. Use this scope when the repository has a documented file convention that everyone should see. Add the same association in the workspace settings JSON rather than your personal User Settings.
Workspace rules are also useful when two projects use the same extension but need different treatment. A strict association in one workspace does not have to change how unrelated projects open their files. Review the workspace file as part of the project’s editor configuration so contributors understand why a pattern is present.
Do not use an unnecessarily broad pattern
An association such as *.json can affect files that VS Code intentionally treats as JSONC. Before using a catch-all pattern, identify which files genuinely must be strict and list those names or a narrow pattern instead. Broad rules can make comments in editor configuration files appear to be errors.
When a pattern seems not to work, compare it with the exact filename. A rule for *.strict.json matches prod.strict.json, not config.json. Check both the spelling and the settings scope, then close and reopen the file and read the Status Bar label. The label is the useful confirmation of the effective language mode.
Protect VS Code’s own JSONC configuration files
Several VS Code configuration files are designed to use JSON with Comments. Common examples include settings.json, tasks.json, and launch.json. They may contain comments that explain settings or commands. A workspace association that forces every .json file into strict mode can therefore remove the editing experience those files expect.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11- Associate only the application data files that must conform to strict JSON.
- Leave VS Code’s own configuration filenames on their intended mode unless you have a deliberate reason to remove comments.
- After changing an association, open each important configuration file and inspect the Status Bar label.
If a project needs both kinds of files, use separate patterns. For example, map a distinctive suffix such as *.strict.json to json while leaving the standard VS Code configuration filenames unchanged. This makes the intent visible and avoids turning unrelated editor metadata into invalid-looking documents.
Rank #3
- [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
- [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
- [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
- [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
- [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
Strict syntax and schema validation solve different problems
Choosing JSON controls which syntax the editor accepts and diagnoses. It does not tell VS Code what keys are required, what type a value should have, or which values are allowed. Those structural and value checks come from a JSON schema.
| Question | Use | Typical result |
|---|---|---|
| Are comments or trailing commas legal here? | Language mode: JSON or JSON with Comments. | Syntax diagnostics in the editor. |
Must port be a number? |
json.schemas or an accepted $schema declaration. |
Type, property, and value diagnostics. |
| Does the consuming application reject comments? | The application’s own parser and validation rules. | Runtime or command-line behavior outside VS Code. |
A file can be syntactically valid strict JSON and still fail its schema. Conversely, a file with an invalid comment or trailing comma must first pass syntax parsing before schema checks can provide useful feedback. Switching modes therefore does not replace schema validation, and adding a schema does not turn JSONC into strict JSON.
Associate a schema when you need shape and value checks
Use json.schemas in User or Workspace Settings to associate a schema with selected files. A schema can be a workspace file, a schema URL, or an inline schema in settings. The exact mapping should be as narrow as the files it describes.
Map a filename to a workspace schema
An illustrative Workspace Settings entry looks like this:
{
"json.schemas": [
{
"fileMatch": [
"service-config.json"
],
"url": "./schemas/service.schema.json"
}
]
}
Change both the fileMatch pattern and the schema path to match your repository. You can map a pattern to a schema URL instead when the schema is maintained elsewhere. Keep this mapping separate from files.associations: one selects syntax mode, while the other selects structural rules.
An inline schema is useful for a small, self-contained contract, while a workspace file is easier to review and update with the rest of the project. A URL can centralize a schema maintained outside the repository. Whichever form you use, ensure the fileMatch value actually reaches the files you intend; a schema that never matches cannot produce the expected diagnostics.
Use a $schema property only when the consumer permits it
Some tools discover a schema from a $schema property inside the JSON document. This can be convenient, but it changes the document itself. If the consuming application rejects unknown properties, treats the file as a fixed data contract, or must remain byte-for-byte compatible with another format, a settings-based json.schemas mapping is safer.
Recommended Free Tools
Decide whether the schema declaration belongs in the data contract before adding it. The property is not a comment and is not ignored automatically by every consumer. Keeping the association in settings avoids modifying files that are exchanged with another system.
Rank #4
- Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
- Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
- All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
- Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
- Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
Check schema-draft compatibility
VS Code documentation describes support for JSON Schema drafts 4 through 7 and limited support for drafts 2019-09 and 2020-12. If a schema uses features from a newer draft, verify that the keyword you rely on is supported rather than assuming every validator feature will behave identically in the editor. A syntax-mode change cannot compensate for a schema keyword the editor does not fully implement.
Choose the right settings scope
| Need | Recommended scope | Why | Watch for |
|---|---|---|---|
| One open file needs a correction now. | Status Bar language picker. | Immediate and reversible. | The choice may not become a default for other files. |
| Your own files of a distinctive name or pattern should always be strict. | User Settings with files.associations. |
Applies across your workspaces. | It can affect unrelated projects that match the same pattern. |
| Everyone working on one repository should get the same behavior. | Workspace Settings. | The project rule can be reviewed and shared. | Keep the pattern narrow so VS Code’s JSONC files are not caught. |
| Files need required keys, types, or enumerated values. | json.schemas in the appropriate scope. |
Adds structural and value diagnostics. | Schema checks do not replace strict syntax mode. |
Worked example: convert a relaxed file to strict JSON
Suppose a configuration file currently contains a comment and a trailing comma:
{
"environment": "production", // deployment target
"retries": 3,
}
After selecting JSON, VS Code should diagnose both non-standard constructs. To make the document strict JSON, remove the comment and the final comma:
{
"environment": "production",
"retries": 3
}
Changing the language mode does not perform this conversion automatically. It only makes the editor show you where the file violates strict syntax. If comments contain important explanations, move that documentation into a README or another supported field rather than leaving comments in data consumed by a strict parser.
The same principle applies to nested objects and arrays: inspect every closing brace and bracket for a preceding comma, not just the final line of the file. Remove both line and block comments wherever they occur. Then save and, if the file is consumed elsewhere, run that consumer’s own validator.
Troubleshoot when the file still behaves like JSONC
The Status Bar still says JSON with Comments
The per-file language mode has not changed, or another association is winning. Reopen the language picker, choose JSON, and confirm the label after the picker closes. If a persistent association exists, inspect the effective User and Workspace Settings for a matching pattern whose value is jsonc.
Your association does not apply
Check the exact filename, extension, and pattern. A rule for *.strict.json will not match config.json. Also check the scope: a User Settings rule affects your account, while a Workspace Settings rule affects only the project where it is stored. Close and reopen the file after editing settings, then inspect the Status Bar rather than relying on the filename.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsA broad rule causes errors in VS Code configuration
Review whether the pattern includes settings.json, tasks.json, or launch.json. Narrow the association to the application files that require strict syntax, or add explicit handling for the project’s intended JSONC files. Do not solve one file’s problem by changing every JSON document in the workspace.
Best Value
The syntax is accepted but the data is still wrong
That is a schema or application-validation issue, not a language-mode issue. Confirm that the intended schema is actually mapped to the file, inspect the schema’s supported draft and keywords, and then run the consuming application’s own validation. Strict mode cannot detect a misspelled property when the syntax remains valid.
The editor looks correct but the application rejects the file
VS Code’s diagnostics are not a substitute for the parser used by your application, build step, or deployment tool. A language-mode change does not alter that external parser, and a file that looks valid in the editor can still be interpreted differently if the application has additional rules. Validate with the application’s documented command or pipeline as a separate step.
Common decisions before you change the setting
- Only one file is problematic: use the Status Bar picker first; there is no need to create a project-wide rule for a one-off correction.
- A whole repository follows one convention: use Workspace Settings so the association travels with the project and can be reviewed by collaborators.
- Your personal naming convention is stable: use User Settings, but choose a distinctive pattern that is unlikely to match another project.
- The file needs contract validation: keep strict syntax selection and schema mapping as two explicit configuration decisions.
- VS Code configuration files contain intentional comments: exclude their names from any broad strict association.
Writing down the intended file pattern is worthwhile before editing settings. It helps distinguish a syntax-policy decision from a project-specific exception and makes troubleshooting easier when a new file opens in the unexpected mode.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →A practical verification checklist
- The open file’s Status Bar indicator reads JSON.
- A deliberate test comment and trailing comma are diagnosed, then removed.
- The persistent rule, if any, is in the intended User or Workspace Settings scope.
- The
files.associationspattern matches only files that must be strict. - VS Code’s own configuration files retain JSONC behavior when their comments are intentional.
- A
json.schemasmapping is present only when structural or value validation is needed. - The schema mapping points to the correct workspace file or URL and uses a compatible schema draft.
- The consuming application has been checked independently, because editor mode does not change its parser.
For a single file, the Status Bar selection is enough. For repeatable behavior, pair a narrow files.associations rule with a separate schema mapping when the project needs both strict syntax and contract-level validation.
Frequently Asked Questions
How do I make VS Code use strict JSON for just one file?
Open the file, select the language indicator in the Status Bar, and choose JSON. This changes diagnostics for that open file without creating a persistent association.
Why does VS Code still accept comments after I selected JSON?
Check the Status Bar label. If it still reads JSON with Comments, select the indicator again and choose the exact JSON mode. Also inspect User and Workspace Settings for a matching files.associations entry whose value is jsonc.
How can I apply strict mode to a recurring filename?
Add a focused files.associations mapping with the filename or pattern on the left and json as the value. Put it in User Settings for a personal default or Workspace Settings for a project-wide rule.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Will strict JSON mode change how my application parses the file?
No. It changes VS Code’s editing diagnostics only. The parser used by your application, build process, or deployment tool must be checked independently.
Does a JSON schema make comments and trailing commas invalid?
No. A schema checks properties, types, required keys, and allowed values. Choose the JSON language mode separately when the editor must diagnose comments and trailing commas.
Should I add a $schema property to the document?
Only when the consuming tool permits that extra property. A settings-based json.schemas mapping avoids modifying a fixed data document or one whose consumer rejects unknown keys.
The Bottom Line
Select JSON in the Status Bar for immediate strict-syntax diagnostics. Use a narrow files.associations rule to make that choice persistent, keep VS Code’s JSONC configuration files out of broad patterns, and configure json.schemas separately for structural and value validation. Always verify the consuming application’s parser independently.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




