UNPKG

eslint-plugin-import-sorting

Version:

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

13 lines (12 loc) 371 B
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; } export { getGroupNumber };