Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
// In case the user uses the --watch flag when running hint
if (options && options.watch && userConfig.connector && userConfig.connector.options) {
userConfig.connector.options.watch = options.watch;
}
updateConfigWithOptionsValues(userConfig, options);
if (userConfig.formatters && !Array.isArray(userConfig.formatters)) {
userConfig.formatters = [userConfig.formatters];
}
const browsers = browserslist(config.browserslist);
const ignoredUrls = loadIgnoredUrls(userConfig);
const hints = Configuration.cleanHints(normalizeHints(userConfig.hints!)); // `userConfig.hints` should not be `null` due to `validateConfig` check above
return new Configuration(userConfig, browsers, ignoredUrls, hints);
}
const getHintsForTelemetry = (hints?: HintsConfigObject | (string | any)[]) => {
if (!hints) {
return null;
}
const normalizedHints = normalizeHints(hints);
const result = {} as HintsConfigObject;
for (const [hintId, severity] of Object.entries(normalizedHints)) {
result[hintId] = typeof severity === 'string' ? severity : (severity as [HintSeverity, any])[0];
}
return result;
};
const configurations = userConfig.extends.map((config) => {
const loadedConfiguration = resourceLoader.loadConfiguration(config, [parentConfig]);
if (!validateConfig(loadedConfiguration)) {
throw new Error(`Configuration package "${config}" is not valid`);
}
loadedConfiguration.hints = normalizeHints(loadedConfiguration.hints);
return composeConfig(loadedConfiguration, config);
});