Update .bashrc
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / eslint / lib / shared / config-validator.js
index aca6e1fb274fdb66ad423b2968e075183435a69b..03b32f1c9183ed495a1e5428106a990f9e951b58 100644 (file)
@@ -1,3 +1,15 @@
+/*
+ * STOP!!! DO NOT MODIFY.
+ *
+ * This file is part of the ongoing work to move the eslintrc-style config
+ * system into the @eslint/eslintrc package. This file needs to remain
+ * unchanged in order for this work to proceed.
+ *
+ * If you think you need to change this file, please contact @nzakas first.
+ *
+ * Thanks in advance for your cooperation.
+ */
+
 /**
  * @fileoverview Validates configs.
  * @author Brandon Mills
 //------------------------------------------------------------------------------
 
 const
-    path = require("path"),
     util = require("util"),
-    lodash = require("lodash"),
     configSchema = require("../../conf/config-schema"),
-    BuiltInEnvironments = require("../../conf/environments"),
+    BuiltInEnvironments = require("@eslint/eslintrc/conf/environments"),
     BuiltInRules = require("../rules"),
-    ConfigOps = require("./config-ops");
+    ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"),
+    { emitDeprecationWarning } = require("./deprecation-warnings");
 
 const ajv = require("./ajv")();
 const ruleValidators = new WeakMap();
@@ -26,11 +37,6 @@ const noop = Function.prototype;
 // Private
 //------------------------------------------------------------------------------
 let validateSchema;
-
-// Defitions for deprecation warnings.
-const deprecationWarningMessages = {
-    ESLINT_LEGACY_ECMAFEATURES: "The 'ecmaFeatures' config file property is deprecated, and has no effect."
-};
 const severityMap = {
     error: 2,
     warn: 1,
@@ -196,7 +202,7 @@ function validateRules(
 
 /**
  * Validates a `globals` section of a config file
- * @param {Object} globalsConfig The `glboals` section
+ * @param {Object} globalsConfig The `globals` section
  * @param {string|null} source The name of the configuration source to report in the event of an error.
  * @returns {void}
  */
@@ -254,25 +260,6 @@ function formatErrors(errors) {
     }).map(message => `\t- ${message}.\n`).join("");
 }
 
-/**
- * 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.
- * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active.
- * @param {string} source The name of the configuration source to report the warning for.
- * @param {string} errorCode The warning message to show.
- * @returns {void}
- */
-const emitDeprecationWarning = lodash.memoize((source, errorCode) => {
-    const rel = path.relative(process.cwd(), source);
-    const message = deprecationWarningMessages[errorCode];
-
-    process.emitWarning(
-        `${message} (found in "${rel}")`,
-        "DeprecationWarning",
-        errorCode
-    );
-});
-
 /**
  * Validates the top level properties of the config object.
  * @param {Object} config The config object to validate.