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