12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- "use strict";
- const path = require("path");
- const deprecationWarningMessages = {
- ESLINT_LEGACY_ECMAFEATURES:
- "The 'ecmaFeatures' config file property is deprecated and has no effect."
- };
- const sourceFileErrorCache = new Set();
- 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];
- process.emitWarning(
- `${message} (found in "${rel}")`,
- "DeprecationWarning",
- errorCode
- );
- }
- module.exports = {
- emitDeprecationWarning
- };
|