eslint-plugin-perfectionist
Version:
ESLint plugin for sorting various data such as objects, imports, types, enums, JSX props, etc.
16 lines (15 loc) • 467 B
JavaScript
import { UnreachableCaseError } from '../../utils/unreachable-case-error.js'
function computeExportKindModifier(node) {
let exportKind = 'exportKind' in node ? node.exportKind : void 0
switch (exportKind) {
case void 0:
case 'value':
return 'value'
case 'type':
return 'type'
/* v8 ignore next 2 -- @preserve Exhaustive guard. */
default:
throw new UnreachableCaseError(exportKind)
}
}
export { computeExportKindModifier }