UNPKG

eslint-plugin-import-sorting

Version:

ESLint plugin to group and sort imports by module, à la Python isort

13 lines (12 loc) 470 B
"use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function getGroupNumber(groups, node) { for (let max = groups.length, index = 0; index < max; index++) { let currentGroup = groups[index]; if (node.group === currentGroup || Array.isArray(currentGroup) && typeof node.group === "string" && currentGroup.includes(node.group)) { return index; } } return groups.length; } exports.getGroupNumber = getGroupNumber;