UNPKG

756 BJavaScriptView Raw
1/**
2 * @fileoverview Rule to flag use of with statement
3 * @author Nicholas C. Zakas
4 */
5
6"use strict";
7
8//------------------------------------------------------------------------------
9// Rule Definition
10//------------------------------------------------------------------------------
11
12module.exports = {
13 meta: {
14 docs: {
15 description: "disallow `with` statements",
16 category: "Best Practices",
17 recommended: false,
18 url: "https://eslint.org/docs/rules/no-with"
19 },
20
21 schema: []
22 },
23
24 create(context) {
25
26 return {
27 WithStatement(node) {
28 context.report({ node, message: "Unexpected use of 'with' statement." });
29 }
30 };
31
32 }
33};