Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Open the file, select the language-mode indicator on the right side of the VS Code Status Bar, and choose JSON—not JSON with Comments. JSON mode follows the JSON specification, while JSONC permits // and /* ... */ comments and accepts trailing commas with a warning. To make that choice automatic, add a narrowly scoped files.associations entry. Use json.schemas separately when you also need checks for required properties, data types, or allowed values.

What “strict JSON” means in VS Code

VS Code has two related but different language modes. The default JSON mode follows the JSON specification. JSON with Comments, whose language identifier is jsonc, is designed for configuration files and accepts JavaScript-style comments. It also permits trailing commas, although VS Code displays a warning for them.

The Visual Studio Code documentation describes the distinction this way: “In addition to the default JSON mode following the JSON specification, VS Code also has a JSON with Comments (jsonc) mode.” The active mode is visible in the Status Bar, so you can confirm the editor’s behavior without inspecting a settings file.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Editor mode Language identifier Comments Trailing comma Best use
JSON json Rejected as invalid syntax Rejected as invalid syntax Data exchanged with APIs, tools, and parsers that require standard JSON
JSON with Comments jsonc // and /* ... */ accepted Accepted with a warning VS Code configuration and other deliberately commentable files

Changing the mode changes VS Code’s editing diagnostics. It does not change the parser used by an application that later reads the file. A consumer can still reject a file, or accept extensions of JSON, according to its own implementation.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.

Change one file to strict JSON mode

This is the safest fix when only one document needs strict validation.

  1. Open the target file in VS Code.
  2. Look at the language indicator on the right side of the Status Bar. It may say JSON with Comments or JSON.
  3. Select the indicator to open the language-mode picker.
  4. Choose JSON.
  5. Look at the Status Bar again and confirm that it now says JSON, not JSON with Comments.

Once JSON mode is active, test the diagnostic behavior with a temporary edit. For example, this comment should be underlined as an error:

{
  "name": "demo",
  // This comment is not valid JSON
  "enabled": true
}

A trailing comma should likewise be reported as invalid in JSON mode:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
{
  "name": "demo",
  "enabled": true,
}

Remove the test characters after confirming the behavior. A valid strict-JSON document contains quoted property names, JSON values, and no comments or trailing commas:

{
  "name": "demo",
  "enabled": true
}

This temporary test is useful because a file can look correct while still being assigned to JSONC. The label and the diagnostic response together show which language mode is actually active.

Make strict mode persistent with files.associations

A one-file language choice is easy to lose when a file is reopened or another file is created. Use files.associations to map a filename or pattern to the json language. VS Code supports these associations in both User Settings and Workspace Settings.

User settings: a personal default

User settings apply across projects on your machine. Add an association through the Settings editor by searching for files associations, or open the JSON form of settings and add a property such as:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
{
  "files.associations": {
    "data.json": "json",
    "*.config.json": "json"
  }
}

The first pattern targets one filename. The second targets files whose names end in .config.json. Prefer a specific pattern that describes the files you actually want to validate. A broad rule for every JSON-looking file can unintentionally change the mode of files that depend on JSONC.

User scope is appropriate when the preference is yours rather than the repository’s. For example, you might always want your personal data exports treated as strict JSON, while another project legitimately uses commentable configuration. Because the setting follows your account, it can also affect projects where that assumption is not shared. Review the matching pattern before using a user-wide rule.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

Workspace settings: a project rule

Workspace settings are stored with the project under .vscode and can be shared with teammates through version control. Open the project in VS Code, choose File > Preferences > Settings on Windows or Linux (or Code > Settings > Settings on macOS), switch the Settings scope to Workspace, and edit files.associations. The resulting .vscode/settings.json can contain:

{
  "files.associations": {
    "schemas/*.json": "json",
    "fixtures/**/*.json": "json"
  }
}

Use a workspace rule when the requirement belongs to a repository—for example, when all fixture files must remain interoperable with a strict parser. Use User Settings when the preference is personal and should follow you between projects.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A workspace association also documents the project’s intent for people who open it later. Keep the rule limited to the directories or suffixes that represent strict data. If the same repository contains JSONC configuration, give those files a separate path or filename pattern rather than forcing one mode on every document.

Check the effective association

If the file still opens as JSONC, inspect the exact filename and every applicable settings scope:

  • Confirm that the pattern actually matches the file, including its directory and extension.
  • Check whether a workspace association, User Setting, or language-mode choice is overriding the rule you edited.
  • Reopen the file or select JSON manually, then verify the Status Bar label.
  • Look for another association that targets the same filename more specifically.

Do not assume that adding an association succeeded merely because the settings file saved. The Status Bar is the authoritative check for the mode currently applied to the open editor.

When troubleshooting, start with the exact filename rather than a complex glob. Once an exact entry produces the expected JSON label, broaden it to a directory or suffix only if the project needs that behavior. This makes it easier to identify whether the problem is an unmatched path or an overlapping association.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not convert VS Code’s own configuration files accidentally

Several VS Code configuration files intentionally use JSONC so that comments are available. Common examples include settings.json, tasks.json, and launch.json. A catch-all association that maps every *.json file to json can remove the editing behavior those files expect.

Instead of changing every JSON file, target only the data files that must be strict. For example, an association for fixtures/**/*.json leaves the editor’s own configuration files on their intended mode. If a repository mixes strict data and commentable configuration, separate them by directory, filename suffix, or both.

Requirement Recommended scope Association approach
Only the currently open file needs strict diagnostics Language picker Select JSON in the Status Bar
Your personal files of a known pattern should default to strict JSON User Settings Map that filename or pattern to json
A project’s data files must use strict mode for everyone Workspace Settings Commit a targeted .vscode/settings.json association
VS Code configuration files need comments Leave their normal handling intact Avoid a broad *.json override

Add schema validation when syntax is not enough

Strict JSON mode answers a syntax question: are comments, trailing commas, quotes, brackets, and values written according to JSON rules? It does not answer whether the document has the right fields or values for your application.

Rank #3
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

Schema validation is a separate layer. A schema can require a property, constrain a value to a type, define allowed strings, or describe nested objects and arrays. A file can therefore be syntactically valid JSON and still fail its schema. Conversely, an invalid comment or comma must be fixed before schema-level feedback can be useful.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Think of the two checks as independent axes. Language mode determines which textual forms the editor accepts. A schema determines whether the parsed value has the expected shape. Turning on a schema does not make JSONC syntax strict, and choosing JSON mode does not tell VS Code which properties your application requires.

Associate a schema with matching files

Use the json.schemas setting when a filename pattern should be checked against a workspace schema, a schema URL, or an inline schema. This example points matching files at a schema stored in the repository:

{
  "json.schemas": [
    {
      "fileMatch": ["/config/*.json"],
      "url": "./schemas/config.schema.json"
    }
  ]
}

The fileMatch pattern controls which documents receive the schema. Keep that pattern as narrow as the data model requires. A schema association does not switch a file from JSONC to JSON; set files.associations separately if strict syntax is also required.

The schema source can be a URL, a workspace file, or an inline schema in settings. Choose a workspace file when the schema is versioned with the project, a URL when the project intentionally consumes a maintained external definition, and an inline schema when the rule is small and belongs directly in the settings entry. In each case, verify that fileMatch reaches the intended documents.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use $schema only when the consumer permits it

Some tools allow a $schema property inside the JSON document to identify its schema. This makes the file self-describing, but it also adds a property that the consuming application must tolerate. If the consumer rejects unknown properties or expects an exact shape, a settings-based json.schemas mapping is safer because it leaves the document unchanged.

VS Code’s JSON documentation describes support for schema drafts 4 through 7 and notes limited support for drafts 2019-09 and 2020-12. Check the schema dialect used by your project before relying on newer features.

Verify that strict diagnostics are really active

Use a controlled test rather than relying only on the label in a settings file.

  1. Confirm that the Status Bar says JSON.
  2. Insert a // comment inside an object and wait for the red syntax diagnostic.
  3. Replace the comment with a trailing comma and confirm that it is also rejected.
  4. Remove both edits and save a valid JSON document.
  5. If a schema is configured, introduce a schema-only error—such as deleting a required property—and verify that the resulting diagnostic is distinct from the syntax error.

This test separates three conditions that are often confused:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
  • JSON mode: controls whether JSON syntax extensions such as comments and trailing commas are accepted by the editor.
  • Schema validation: checks document structure and values against a declared model.
  • Application parsing: determines what another program accepts when it reads the saved file.

After the test, remove the comment and comma rather than leaving deliberately invalid content in a working file. If the mode changes unexpectedly after reopening, check the association and settings scope again; the saved document itself does not permanently record the Status Bar selection.

Strict JSON checklist for a file handoff

Before giving a file to an API, build tool, or other parser that requires standard JSON, check both the editor and the content:

  • The Status Bar says JSON, not JSON with Comments.
  • Property names are enclosed in double quotes.
  • String values use double quotes rather than single quotes.
  • There are no // or /* ... */ comments.
  • There is no comma after the final property in an object or the final item in an array.
  • Braces and brackets are balanced, and values use JSON forms such as strings, numbers, true, false, or null.
  • Any schema warning is addressed separately from syntax warnings.

This checklist improves editor feedback, but it is not a substitute for testing the consuming application. The application may impose additional requirements that are outside VS Code’s language mode.

Troubleshoot a file that remains in JSONC mode

The Status Bar still says JSON with Comments

Select the indicator and choose JSON again. If it immediately returns to JSONC, inspect files.associations in both User and Workspace scopes. A pattern matching the file may still map it to jsonc. Correct or remove that pattern, then reopen the editor.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The association matches the wrong name

Patterns are matched against filenames and paths. Check for differences such as .jsonc versus .json, an extra suffix such as .config.json, or a directory that is not covered by the glob. Test with a deliberately simple entry for the exact filename, verify the mode, and then generalize the pattern only if necessary.

A schema error appears, but comments are still accepted

A schema association does not imply strict JSON syntax. Keep the schema mapping and add a separate files.associations entry that maps the relevant files to json.

JSON mode reports an error in a file that needs comments

The file may be one of VS Code’s JSONC-based configuration files, or it may be a project format that intentionally allows comments. Remove the broad strict association or add a more precise exception so that only genuine JSON data files use json.

The editor is clean, but another tool rejects the file

VS Code’s mode affects editor diagnostics; it does not rewrite the file or control an external parser. Open the saved file with the consuming application’s documented validator or parser and follow that tool’s requirements. If the application requires standard JSON, comments and trailing commas must be removed from the actual file, regardless of which mode VS Code displays.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose the right configuration strategy

The following decision path avoids both under-configuration and accidental disruption:

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
  1. Need a one-time correction? Pick JSON from the Status Bar.
  2. Need the same behavior for a recurring filename or directory? Add a targeted files.associations rule.
  3. Should teammates receive the rule? Put it in Workspace Settings under .vscode/settings.json rather than only in User Settings.
  4. Do VS Code configuration files rely on comments? Exclude them from the strict association instead of mapping every JSON file.
  5. Do you need required fields or value constraints? Add json.schemas or an accepted $schema property in addition to strict mode.
  6. Does a downstream parser still disagree? Validate the saved file with that parser; editor mode cannot enforce the application’s rules.

Common mistakes to avoid

  • Changing only the schema: A schema can report missing or invalid values while JSONC comments remain accepted. Configure the language mode separately.
  • Using a catch-all association: Mapping every *.json file to json can make settings.json, tasks.json, or launch.json inconvenient to edit.
  • Editing the wrong settings scope: A User Setting affects your projects broadly, while a Workspace Setting belongs to one project. Choose deliberately.
  • Trusting the settings file without checking the editor: A saved pattern may not match the path you intended. Confirm the Status Bar label and test an invalid comment.
  • Assuming editor mode changes the file: Switching to JSON does not remove comments or trailing commas. It only changes diagnostics; clean the content itself before handing it to a strict consumer.
  • Adding $schema automatically: The property changes the document and may be rejected by a consumer. Use a settings mapping when the file must remain unchanged.

Bottom line

Select JSON in the Status Bar for the immediate fix. For a lasting project rule, associate only the intended filenames or paths with json in Workspace Settings, while leaving VS Code’s JSONC configuration files alone. Add a schema separately when you need structural and value validation, and remember that the final authority for a saved file is the application that consumes it.

Frequently Asked Questions

How do I make VS Code use strict JSON mode for just one file?

Open the file, select the language indicator on the right side of the Status Bar, and choose JSON. Confirm that the indicator no longer says JSON with Comments. Insert a temporary comment or trailing comma to verify that JSON mode reports it as invalid, then remove the test edit.

Why does VS Code accept comments in my .json file?

The file is probably assigned to JSON with Comments (jsonc) mode. JSONC accepts // and /* ... */ comments and permits trailing commas with a warning. Select JSON from the language-mode picker, or create a targeted files.associations entry that maps the filename or pattern to json.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How can I make strict JSON the default for matching files?

Add a files.associations entry in User Settings for a personal default or Workspace Settings for a project rule. Map only the relevant filename, suffix, or directory pattern to json. Then reopen the file and confirm the Status Bar mode.

Should I use User Settings or Workspace Settings?

Use User Settings when the preference should follow you across projects. Use Workspace Settings, stored under .vscode, when the repository requires the rule and teammates should receive it. In either scope, keep the association narrow enough that JSONC configuration files are not changed accidentally.

Does json.schemas make JSON syntax strict?

No. json.schemas checks structure and values, such as required properties, data types, and allowed strings. It does not switch a file from JSONC to JSON. Configure files.associations separately when comments and trailing commas must be rejected by the editor.

Can I put $schema in the JSON file?

You can when the consuming tool permits the extra property. The key makes the document self-describing, but a consumer that rejects unknown properties or expects an exact shape may fail. A json.schemas mapping in settings applies validation without changing the document.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why is JSON mode breaking settings.json or launch.json?

Those VS Code configuration files commonly use JSONC so comments are available. A broad association such as *.json may have changed them to strict JSON mode. Replace it with a narrower rule for genuine data files, such as a fixtures directory or a specific suffix.

Why does another application still reject a file that looks valid in VS Code?

The language mode controls VS Code’s diagnostics only; it does not control the parser used by another application or remove extensions from the saved file. Validate the saved document with the consuming application’s own requirements. If it requires standard JSON, remove comments and trailing commas from the content.

Which JSON Schema drafts does VS Code support?

VS Code’s JSON documentation describes support for drafts 4 through 7 and limited support for drafts 2019-09 and 2020-12. Check the dialect used by your project before depending on features from a newer draft.

The Bottom Line

Choose JSON in the Status Bar, persist it with a narrowly scoped files.associations rule, and configure json.schemas separately for structural checks. Keep JSONC configuration files out of broad strict-mode overrides, and validate the saved file with its consuming application.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.