Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lydell committed Feb 10, 2024
1 parent 6de7a10 commit 2480727
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ function getSpecifierItems(tokens) {
const newlineIndexRaw = after.findIndex((token2) => isNewline(token2));
const newlineIndex = newlineIndexRaw === -1 ? -1 : newlineIndexRaw + 1;

// If there’s a multiline block comment, put everything _befor_ that
// If there’s a multiline block comment, put everything _before_ that
// comment in the specifiers’s `.after`.
const multilineBlockCommentIndex = after.findIndex(
(token2) => isBlockComment(token2) && hasNewline(token2.code)
Expand Down Expand Up @@ -806,7 +806,7 @@ function getSource(node) {
// Make `../` sort after `../../` but before `../a` etc.
// Why a comma? See the next comment.
.replace(/^[./]*\/$/, "$&,")
// Make `.` and `/` sort before any other punctation.
// Make `.` and `/` sort before any other punctuation.
// The default order is: _ - , x x x . x x x / x x x
// We’re changing it to: . / , x x x _ x x x - x x x
.replace(/[./_-]/g, (char) => {
Expand All @@ -831,9 +831,7 @@ function getSource(node) {

function getImportExportKind(node) {
// `type` and `typeof` imports, as well as `type` exports (there are no
// `typeof` exports). In Flow, import specifiers can also have a kind. Default
// to "value" (like TypeScript) to make regular imports/exports come after the
// type imports/exports.
// `typeof` exports).
return node.importKind || node.exportKind || "value";
}

Expand Down

0 comments on commit 2480727

Please sign in to comment.