Ömer Yalhı Mini Bloglogo

Prettier single quote conflict with TSLint setting

if prettier setting has single quote set to true, make sure to set the corresponding linter setting correctly. TSLint would want to persist on the single quote and escape the apostrophe. Prettier on the other hand avoids escape character by default. Adding avoid-escape would resolve this conflict.


.prettierrc

{
  ...
  "singleQuote": true
  ...
}

tslint.json before:

{
  ...
  "quotemark": [
    true,
    "single",
    "jsx-double",
  ],
  ...
}

tslint.json after:

{
  ...
  "quotemark": [
    true,
    "single",
    "jsx-double",
    "avoid-escape",
  ],
  ...
}

Read more at: TSLint Rule Quotemark



That's it, and have fun!