jsonc/comma-style
enforce consistent comma style
- 🔧 The
--fix
option on the command line can automatically fix some of the problems reported by this rule.
📖 Rule Details
This rule enforce consistent comma style in array literals and object literals.
/* eslint jsonc/comma-style: 'error' */
{
/* ✓ GOOD */
"GOOD": ["apples",
"oranges"],
"GOOD": {
"a": 1,
"b": 2
},
/* ✗ BAD */
"BAD": ["apples"
, "oranges"]
,"BAD": {
"a": 1
, "b": 2
}
}
🔧 Options
json
{
"jsonc/comma-style": ["error",
"last"
]
}
Same as comma-style rule option. See here for details.
👫 Related rules
🚀 Version
This rule was introduced in eslint-plugin-jsonc v0.1.0
🔍 Implementation
Taken with ❤️ from ESLint core