()
| 181 | } |
| 182 | |
| 183 | export async function getOutputStyleConfig(): Promise<OutputStyleConfig | null> { |
| 184 | const allStyles = await getAllOutputStyles(getCwd()) |
| 185 | |
| 186 | // Check for forced plugin output styles |
| 187 | const forcedStyles = Object.values(allStyles).filter( |
| 188 | (style): style is OutputStyleConfig => |
| 189 | style !== null && |
| 190 | style.source === 'plugin' && |
| 191 | style.forceForPlugin === true, |
| 192 | ) |
| 193 | |
| 194 | const firstForcedStyle = forcedStyles[0] |
| 195 | if (firstForcedStyle) { |
| 196 | if (forcedStyles.length > 1) { |
| 197 | logForDebugging( |
| 198 | `Multiple plugins have forced output styles: ${forcedStyles.map(s => s.name).join(', ')}. Using: ${firstForcedStyle.name}`, |
| 199 | { level: 'warn' }, |
| 200 | ) |
| 201 | } |
| 202 | logForDebugging( |
| 203 | `Using forced plugin output style: ${firstForcedStyle.name}`, |
| 204 | ) |
| 205 | return firstForcedStyle |
| 206 | } |
| 207 | |
| 208 | const settings = getSettings_DEPRECATED() |
| 209 | const outputStyle = (settings?.outputStyle || |
| 210 | DEFAULT_OUTPUT_STYLE_NAME) as string |
| 211 | |
| 212 | return allStyles[outputStyle] ?? null |
| 213 | } |
| 214 | |
| 215 | export function hasCustomOutputStyle(): boolean { |
| 216 | const style = getSettings_DEPRECATED()?.outputStyle |
no test coverage detected