//------------------------------------------------------------------------------
const path = require("path");
-const lodash = require("lodash");
//------------------------------------------------------------------------------
// Private
"projects in order to avoid loading '~/.eslintrc.*' accidentally."
};
+const sourceFileErrorCache = new Set();
+
/**
* Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted
* for each unique file path, but repeated invocations with the same file path have no effect.
* @param {string} errorCode The warning message to show.
* @returns {void}
*/
-const emitDeprecationWarning = lodash.memoize((source, errorCode) => {
+function emitDeprecationWarning(source, errorCode) {
+ const cacheKey = JSON.stringify({ source, errorCode });
+
+ if (sourceFileErrorCache.has(cacheKey)) {
+ return;
+ }
+
+ sourceFileErrorCache.add(cacheKey);
+
const rel = path.relative(process.cwd(), source);
const message = deprecationWarningMessages[errorCode];
"DeprecationWarning",
errorCode
);
-}, (...args) => JSON.stringify(args));
+}
//------------------------------------------------------------------------------
// Public Interface