Repository: prettier/prettier-eslint
Pull request #80 (2017-05-10 18:30:21)

Correct Prettier defaults
The defaultValue param's are not matching Prettier's defaults in these lines:
- https://github.com/prettier/prettier-eslint/blob/master/src/utils.js#L198 (should be `false`)
- https://github.com/prettier/prettier-eslint/blob/master/src/utils.js#L215 (should be 'none') 
- https://github.com/prettier/prettier-eslint/blob/master/src/utils.js#L243 (should be `true`)

This PR fixes this.

codecov-io: # [Codecov](https://codecov.io/gh/prettier/prettier-eslint/pull/80?src=pr&el=h1) Report
> Merging [#80](https://codecov.io/gh/prettier/prettier-eslint/pull/80?src=pr&el=desc) into [master](https://codecov.io/gh/prettier/prettier-eslint/commit/34bcf558d046daf9e35d95b18ca5ec30d54f88c4?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/80/graphs/tree.svg?src=pr&token=SKAX5tKPfD&width=650&height=150)](https://codecov.io/gh/prettier/prettier-eslint/pull/80?src=pr&el=tree)

```diff
@@          Coverage Diff          @@
##           master    #80   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           2      2           
  Lines         179    179           
=====================================
  Hits          179    179
```


| [Impacted Files](https://codecov.io/gh/prettier/prettier-eslint/pull/80?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/utils.js](https://codecov.io/gh/prettier/prettier-eslint/pull/80?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/80?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/80?src=pr&el=footer). Last update [34bcf55...e1a81be](https://codecov.io/gh/prettier/prettier-eslint/pull/80?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/src/utils.js b/src/utils.js
index c42ae22..31fc082 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -195,7 +195,7 @@ function getSingleQuote(eslintValue, fallbacks) {
     prettierValue = eslintValue
   }
 
-  return makePrettierOption('singleQuote', prettierValue, fallbacks, true)
+  return makePrettierOption('singleQuote', prettierValue, fallbacks, false)
 }
 
 function getTrailingComma(value, fallbacks, rules) {
@@ -212,7 +212,7 @@ function getTrailingComma(value, fallbacks, rules) {
     prettierValue = RULE_NOT_CONFIGURED
   }
 
-  return makePrettierOption('trailingComma', prettierValue, fallbacks, 'es5')
+  return makePrettierOption('trailingComma', prettierValue, fallbacks, 'none')
 }
 
 function getValFromTrailingCommaConfig(objectConfig) {
@@ -240,7 +240,7 @@ function getBracketSpacing(eslintValue, fallbacks) {
     prettierValue = eslintValue
   }
 
-  return makePrettierOption('bracketSpacing', prettierValue, fallbacks, false)
+  return makePrettierOption('bracketSpacing', prettierValue, fallbacks, true)
 }
 
 function getSemi(eslintValue, fallbacks) {


Test patch:
diff --git a/src/index.test.js b/src/index.test.js
index 17c080b..299df37 100644
--- a/src/index.test.js
+++ b/src/index.test.js
@@ -120,8 +120,10 @@ const tests = [
   // go ahead and add a test case here
   {
     title: 'with code that needs no fixing',
-    input: {text: 'var [foo, {bar}] = window.APP;', eslintConfig: {rules: {}}},
-    output: 'var [foo, {bar}] = window.APP;',
+    input: {
+      text: 'var [foo, { bar }] = window.APP;', eslintConfig: {rules: {}},
+    },
+    output: 'var [foo, { bar }] = window.APP;',
   },
 ]
 
@@ -307,7 +309,7 @@ function noopOutput() {
   return `
     function foo() {
       // stuff
-      console.log('Hello world!', and, stuff);
+      console.log("Hello world!", and, stuff);
     }
   `
 }
diff --git a/src/utils.test.js b/src/utils.test.js
index c1b7317..202d724 100644
--- a/src/utils.test.js
+++ b/src/utils.test.js
@@ -100,6 +100,7 @@ const getPrettierOptionsFromESLintRulesTests = [
           functions: 'always-multiline',
         },
       ],
+      'object-curly-spacing': [2, 'never'],
     },
     options: {
       printWidth: 120,