]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/tests/fixtures/testers/rule-tester/no-schema-violation.js
import 8.23.1 source
[pve-eslint.git] / eslint / tests / fixtures / testers / rule-tester / no-schema-violation.js
index 2a9f65e21616a9593d309d3d421f378e40f55d01..7876f25305bf531d02c02479fe91a09f973f7785 100644 (file)
@@ -3,26 +3,27 @@
  * @author Brandon Mills
  */
 
+"use strict";
+
 //------------------------------------------------------------------------------
 // Rule Definition
 //------------------------------------------------------------------------------
 
-module.exports = function(context) {
-    "use strict";
-
-    var config = context.options[0];
-
-    return {
-        "Program": function(node) {
-            if (config && config !== "foo") {
-                context.report(node, "Expected foo.");
+module.exports = {
+    meta: {
+        type: "problem",
+        schema: [{
+            "enum": ["foo"]
+        }]
+    },
+    create(context) {
+        const config = context.options[0];
+        return {
+            "Program": function(node) {
+                if (config && config !== "foo") {
+                    context.report(node, "Expected foo.");
+                }
             }
-        }
-    };
+        };
+    },
 };
-
-module.exports.schema = [
-    {
-        "enum": ["foo"]
-    }
-];