Skip to content

Support option to normalize string quotes #3

Open
@richkadel

Description

@richkadel

Simple quoted strings with inconsistent quotes might look like:

   [
      'string1',
      "string2",
   ]

The current version (0.1.0) does not change the quote style from the original input, in case the selected quote style was intentional. For example:

   {
      nickname: 'Tracy "The OG" Morgan',
      agent: "Doug O'Dell",
      personal_trainer: "Stupid Judy of EPCOT",
   }

A possible setting would specify the desired quote style. If, for the first example, double-quote is preferred, the result would be:

   [
      "string1",
      "string2",
   ]

Perhaps the desired quote should only apply if the string has no embedded quotes of the same style as the selected quote style. Otherwise, just use the original quote style for that given value. For the second example, preferring double-quotes would result in the same mixed quote style as the original input, but preferring single-quotes would change only the last property:

   {
      nickname: 'Tracy "The OG" Morgan',
      agent: "Doug O'Dell",
      personal_trainer: 'Stupid Judy of EPCOT',
   }

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions