title: VSCode: Prettier does not work with Dart Flutter
body: <p>I am using <code>Dart</code> and <code>Node.js</code>. I tried to auto format <code>Node.js</code> with <code>Prettier</code>. However, VSCode auto formats <code>Dart</code> file but it does not format <code>JavaScript</code> with <code>Prettier</code>.</p>
  <p><a href="https://i.stack.imgur.com/NXnki.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NXnki.png" alt="enter image description here" /></a></p>
  <p>Under the screen, it says Prettier on JavaScript. When I touch the setting and set it to <code>Prettier</code> for auto format, <code>Prettier</code> works and it auto format JS files but <code>Dart</code> auto format does not work.</p>
  <p>How can I set VSCode to auto format Dart and JS files without switching settings everytime?</p>
  <p>VSCode Setup</p>
  <pre><code>{
      &quot;workbench.colorTheme&quot;: &quot;Visual Studio Dark&quot;,
      &quot;[dart]&quot;: {
          &quot;editor.formatOnSave&quot;: true,
          &quot;editor.formatOnType&quot;: true,
          &quot;editor.rulers&quot;: [
              80
          ],
          &quot;editor.selectionHighlight&quot;: false,
          &quot;editor.suggest.snippetsPreventQuickSuggestions&quot;: false,
          &quot;editor.suggestSelection&quot;: &quot;first&quot;,
          &quot;editor.tabCompletion&quot;: &quot;onlySnippets&quot;,
          &quot;editor.wordBasedSuggestions&quot;: false
      },
      &quot;workbench.preferredHighContrastColorTheme&quot;: &quot;Default Dark+&quot;,
      &quot;files.autoSave&quot;: &quot;afterDelay&quot;,
      &quot;editor.minimap.enabled&quot;: false,
      &quot;dart.openDevTools&quot;: &quot;flutter&quot;,
      &quot;explorer.confirmDragAndDrop&quot;: false,
      &quot;[javascript]&quot;: {
          &quot;editor.defaultFormatter&quot;: &quot;esbenp.prettier-vscode&quot;
      }
  }
  </code></pre>
  <p>!!!! Solution</p>
  <pre><code>&quot;editor.defaultFormatter&quot;: &quot;Dart-Code.dart-code&quot;,
  </code></pre>
  <p>You need to add this line to setting.json Dart part. And then set your default formatter to Prettier!</p>