Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function checkSourceValue(source) {
const shouldCheckCase = !_resolve.CASE_SENSITIVE_FS && (!context.options[0] || context.options[0].caseSensitive !== false);
const resolvedPath = (0, _resolve2.default)(source.value, context);
if (resolvedPath === undefined) {
context.report(source, `Unable to resolve path to module '${source.value}'.`);
} else if (shouldCheckCase) {
const cacheSettings = _ModuleCache2.default.getSettings(context.settings);
if (!(0, _resolve.fileExistsWithCaseSync)(resolvedPath, cacheSettings)) {
context.report(source, `Casing of ${source.value} does not match the underlying filesystem.`);
}
}
}
function checkSourceValue(source) {
const shouldCheckCase = !_resolve.CASE_SENSITIVE_FS && (!context.options[0] || context.options[0].caseSensitive !== false);
const resolvedPath = (0, _resolve2.default)(source.value, context);
if (resolvedPath === undefined) {
context.report(source, `Unable to resolve path to module '${source.value}'.`);
} else if (shouldCheckCase) {
const cacheSettings = _ModuleCache2.default.getSettings(context.settings);
if (!(0, _resolve.fileExistsWithCaseSync)(resolvedPath, cacheSettings)) {
context.report(source, `Casing of ${source.value} does not match the underlying filesystem.`);
}
}
}
function checkSourceValue(source) {
const shouldCheckCase = !_resolve.CASE_SENSITIVE_FS && (!context.options[0] || context.options[0].caseSensitive !== false);
const resolvedPath = (0, _resolve2.default)(source.value, context);
if (resolvedPath === undefined) {
context.report(source, `Unable to resolve path to module '${source.value}'.`);
} else if (shouldCheckCase) {
const cacheSettings = _ModuleCache2.default.getSettings(context.settings);
if (!(0, _resolve.fileExistsWithCaseSync)(resolvedPath, cacheSettings)) {
context.report(source, `Casing of ${source.value} does not match the underlying filesystem.`);
}
}
}