Repository: prettier/prettier-eslint
Pull request #76 (2017-04-28 09:27:07)

Interpret eslint quote backtick as singleQuote false

codecov-io: # [Codecov](https://codecov.io/gh/prettier/prettier-eslint/pull/76?src=pr&el=h1) Report
> Merging [#76](https://codecov.io/gh/prettier/prettier-eslint/pull/76?src=pr&el=desc) into [master](https://codecov.io/gh/prettier/prettier-eslint/commit/143e9cc002095bd3d1f27b624b898139b55dcadc?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/prettier/prettier-eslint/pull/76/graphs/tree.svg?width=650&height=150&src=pr&token=SKAX5tKPfD)](https://codecov.io/gh/prettier/prettier-eslint/pull/76?src=pr&el=tree)

```diff
@@          Coverage Diff          @@
##           master    #76   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           2      2           
  Lines         177    178    +1     
=====================================
+ Hits          177    178    +1
```


| [Impacted Files](https://codecov.io/gh/prettier/prettier-eslint/pull/76?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/utils.js](https://codecov.io/gh/prettier/prettier-eslint/pull/76?src=pr&el=tree#diff-c3JjL3V0aWxzLmpz) | `100% <100%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/prettier/prettier-eslint/pull/76?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/prettier/prettier-eslint/pull/76?src=pr&el=footer). Last update [143e9cc...3b5087c](https://codecov.io/gh/prettier/prettier-eslint/pull/76?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/README.md b/README.md
index 4aa25a2..06a40ff 100644
--- a/README.md
+++ b/README.md
@@ -182,6 +182,8 @@ fall back to the `prettier` defaults:
 
 There is a lot of logging available with `prettier-eslint`. When debugging, you can use one of the [`logLevel`](#loglevel-enum-trace-debug-info-warn-error-silent)s to get a better idea of what's going on. If you're using `prettier-eslint-cli` then you can use the `--log-level trace`, if you're using [the Atom plugin][atom-plugin], then you can [open the developer tools][atom-dev-tools] and enter: `process.env.LOG_LEVEL = 'trace'` in the console, then run the format. You'll see a bunch of logs that should help you determine whether the problem is `prettier`, `eslint --fix`, how `prettier-eslint` infers your `prettier` options, or any number of other things. You will be asked to do this before filing issues, so please do :smile:
 
+> NOTE: When you're doing this, it's recommended that you only run this on a single file because there are a LOT of logs :)
+
 ### eslint-disable-line
 
 While using `// eslint-disable-line`, sometimes you may get linting errors after the code has been processed by this module. That is because `prettier` changes this:
diff --git a/src/utils.js b/src/utils.js
index 83f563a..c42ae22 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -189,6 +189,8 @@ function getSingleQuote(eslintValue, fallbacks) {
     prettierValue = true
   } else if (eslintValue === 'double') {
     prettierValue = false
+  } else if (eslintValue === 'backtick') {
+    prettierValue = false
   } else {
     prettierValue = eslintValue
   }


Test patch:
diff --git a/src/utils.test.js b/src/utils.test.js
index 1ac66ac..e473743 100644
--- a/src/utils.test.js
+++ b/src/utils.test.js
@@ -168,6 +168,7 @@ const getPrettierOptionsFromESLintRulesTests = [
   },
   {rules: {'max-len': ['error', {code: 120}]}, options: {printWidth: 120}},
   {rules: {quotes: [2, 'double']}, options: {singleQuote: false}},
+  {rules: {quotes: [2, 'backtick']}, options: {singleQuote: false}},
   {
     rules: {
       'comma-dangle': [