# jsonc/quote-props

require quotes around object literal property names

  • ⚙️ This rule is included in "plugin:jsonc/recommended-with-json" and "plugin:jsonc/recommended-with-jsonc".
  • 🔧 The --fix option on the command line (opens new window) can automatically fix some of the problems reported by this rule.

# 📖 Rule Details

This rule requires quotes around object literal property names.

Now loading...

# 🔧 Options

{
    "jsonc/quote-props": ["error",
        "always",
        {}
    ]
}

Same as quote-props (opens new window) rule option. See here (opens new window) for details.

This rule has two options, a string option and an object option.

String option:

  • "always" (default) ... requires quotes around all object literal property names
  • "as-needed" ... disallows quotes around object literal property names that are not strictly required
  • "consistent" ... enforces a consistent quote style; in a given object, either all of the properties should be quoted, or none of the properties should be quoted
  • "consistent-as-needed" ... requires quotes around all object literal property names if any name strictly requires quotes, otherwise disallows quotes around object property names

Object option:

See here (opens new window) for details.

# 🚀 Version

This rule was introduced in eslint-plugin-jsonc v0.1.0

# 🔍 Implementation

Taken with ❤️ from ESLint core (opens new window)

Last Updated: 10/28/2022, 6:54:42 PM