securityos/node_modules/stylelint/lib/resolveCustomFormatter.js

17 lines
343 B
JavaScript
Raw Permalink Normal View History

2024-09-06 15:32:35 +00:00
const fs = require('fs');
const path = require('path');
/**
* @param {string} formatterPath
* @returns {string}
*/
module.exports = function resolveCustomFormatter(formatterPath) {
const resolvedPath = path.resolve(formatterPath);
if (fs.existsSync(resolvedPath)) {
return resolvedPath;
}
return require.resolve(formatterPath);
};