INNER CODE UNIT · TypeScript

createErrorContext

ben-rogerson/twin.macro · src/suggestions/index.ts:94

function createErrorContext(
  color: MakeColor,
  context: ErrorContext
): ClassErrorContext {
  return {
    color,
    candidates: extractClassCandidates(context.tailwindContext),
    variants: extractVariantCandidates(context.tailwindContext),
    suggestionNumber: context.suggestionNumber,
    CustomError: context.CustomError,
    tailwindConfig: context.tailwindConfig,
    tailwindContext: context.tailwindContext,
  }
}

function getSuggestions(classList: string[], options: Options): void {
  const context = { ...OPTION_DEFAULTS, ...options }
  const color = makeColor(context.hasLogColors)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…