stylelint
Version:
A mighty CSS linter that helps you avoid errors and enforce conventions.
29 lines (22 loc) • 706 B
JavaScript
// NOTICE: This file is generated by Rollup. To modify it,
// please instead edit the ESM counterpart and rebuild with Rollup (npm run build).
;
const constants = require('../constants.cjs');
/** @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}
*/
function normalizeFixMode(fix) {
if (fix === true || fix === 'true' || fix === '' || fix === constants.DEFAULT_FIX_MODE) {
return constants.DEFAULT_FIX_MODE;
}
if (fix === 'strict') {
return 'strict';
}
return undefined;
}
module.exports = normalizeFixMode;