Skip to content

JSON Plugin

Rules for linting .json files containing arbitrary data in the JavaScript Object Notation (JSON) format.
This plugin comes packaged with the flint npm package.

Flint’s JSON plugin provides the following preset:

PresetRecommendedDescription
logical✅ AlwaysCommon rules for finding bugs and good practices in JSON files.

Flint recommends using the logical preset:

flint.config.ts
import { defineConfig, json } from "flint";
export default defineConfig({
use: [
{
files: json.files.all,
rules: json.presets.logical,
},
],
});

Rules that find bugs and enforce good JSON practices for most-to-all JSON files.

flint.config.ts
import { defineConfig, json } from "flint";
export default defineConfig({
use: [
{
files: json.files.all,
rules: json.presets.logical,
},
],
});
Flint RulePreset
keyDuplicatesReports unnecessary duplicate keys that override previous values.logical
keyNormalizationReports object keys that are not normalized using Unicode normalization forms.logical
valueSafetyReports JSON values that are unsafe for data interchange.logical

Flint’s JSON plugin provides the following files selector:

  • all: **/*.json
Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.