Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support option to normalize string quotes #3

Open
richkadel opened this issue Apr 23, 2020 · 0 comments
Open

Support option to normalize string quotes #3

richkadel opened this issue Apr 23, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@richkadel
Copy link
Collaborator

richkadel commented Apr 23, 2020

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',
   }
@richkadel richkadel added the enhancement New feature or request label Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant