Skip to content

"quoteStyle": "preferSingle" should also affect completely cosmetic template literals #371

@joscha

Description

@joscha

Obviously template literals have advantages in terms of interpolation, escaping and newline handling, however we want to encourage use of template literals only for strings that are making use of these features, not for ones that are just plain old strings.
E.g.:

describe(':tada:', () => {
  it(`this string should be in single quotes`, () => {
      // some test here
  });
});

should actually be:

describe(':tada:', () => {
  it('this string should be in single quotes', () => {
      // some test here
  });
});

with "quoteStyle": "preferSingle"

Exceptions:

const x = `not this one ${nono}`;
const y = `neither
    this
    one`;
const z = `and not "this" 'one'`; // for both " and ' in the string

references #345

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