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.
Presets
Section titled “Presets”Flint’s JSON plugin provides the following preset:
| Preset | Recommended | Description |
|---|---|---|
logical | ✅ Always | Common rules for finding bugs and good practices in JSON files. |
Flint recommends using the logical preset:
import { defineConfig, json } from "flint";
export default defineConfig({ use: [ { files: json.files.all, rules: json.presets.logical, }, ],});logical
Section titled “logical”Rules that find bugs and enforce good JSON practices for most-to-all JSON files.
import { defineConfig, json } from "flint";
export default defineConfig({ use: [ { files: json.files.all, rules: json.presets.logical, }, ],});| Flint Rule | Preset |
|---|---|
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 |
Selectors
Section titled “Selectors”Flint’s JSON plugin provides the following files selector:
all:**/*.json
Made with ❤️🔥 in Boston by
Josh Goldberg and contributors.