<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - JavaScript imports not grouped unless out of order"
   href="https://bugs.llvm.org/show_bug.cgi?id=39872">39872</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>JavaScript imports not grouped unless out of order
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Formatter
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>nathanlehrer@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>djasper@google.com, klimek@google.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When JS imports are out of order and have no grouping, they are put in the
correct order and empty lines are added in between external, different folder,
and same folder groups. However, when they are in the right order but have no
empty lines for grouping, no empty lines are added.

For example:

import {c} from './c';
import {a} from 'a';
import {b} from '../b';

becomes

import {a} from 'a';

import {b} from '../b';

import {c} from './c';

but

import {a} from 'a';
import {b} from '../b';
import {c} from './c';

doesn't change.

It seems like clang-format should format imports the same way regardless of how
the programmer decided to do it. This also is causing problems for certain
people using clang-format in combination with TypeScript's Organize Imports.

I wonder if this line
(<a href="https://github.com/llvm-mirror/clang/blob/f3b7928366f63b51ffc97e74f8afcff497c57e8d/lib/Format/SortJavaScriptImports.cpp#L169">https://github.com/llvm-mirror/clang/blob/f3b7928366f63b51ffc97e74f8afcff497c57e8d/lib/Format/SortJavaScriptImports.cpp#L169</a>)
could just be removed.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>