mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-30 01:07:01 +08:00
Add one more deps "@typescript-eslint/utils" to top level to be used in our own custom rules (also needed override if I didn't). Bug: none Change-Id: I130415d1ec5f096ca51200df3eb688dadd963d0f Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6343232 Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Commit-Queue: Nikolay Vitkov <nvitkov@chromium.org>
23 lines
513 B
JavaScript
23 lines
513 B
JavaScript
import { DEFAULT_FIX_MODE } from '../constants.mjs';
|
|
|
|
/** @import { FixMode } from 'stylelint' */
|
|
|
|
/**
|
|
* Normalize the fix mode based on options and configuration.
|
|
* If the input is unknown, this returns `undefined`.
|
|
*
|
|
* @param {unknown} fix
|
|
* @returns {FixMode | undefined}
|
|
*/
|
|
export default function normalizeFixMode(fix) {
|
|
if (fix === true || fix === 'true' || fix === '' || fix === DEFAULT_FIX_MODE) {
|
|
return DEFAULT_FIX_MODE;
|
|
}
|
|
|
|
if (fix === 'strict') {
|
|
return 'strict';
|
|
}
|
|
|
|
return undefined;
|
|
}
|