summaryrefslogtreecommitdiff
path: root/tools/node_modules/eslint/lib/rules/no-with.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/node_modules/eslint/lib/rules/no-with.js')
-rw-r--r--tools/node_modules/eslint/lib/rules/no-with.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/node_modules/eslint/lib/rules/no-with.js b/tools/node_modules/eslint/lib/rules/no-with.js
new file mode 100644
index 0000000000..be9e346360
--- /dev/null
+++ b/tools/node_modules/eslint/lib/rules/no-with.js
@@ -0,0 +1,32 @@
+/**
+ * @fileoverview Rule to flag use of with statement
+ * @author Nicholas C. Zakas
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = {
+ meta: {
+ docs: {
+ description: "disallow `with` statements",
+ category: "Best Practices",
+ recommended: false
+ },
+
+ schema: []
+ },
+
+ create(context) {
+
+ return {
+ WithStatement(node) {
+ context.report({ node, message: "Unexpected use of 'with' statement." });
+ }
+ };
+
+ }
+};