minor adjustment to readme
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / eslint / lib / rules / no-new.js
1 /**
2  * @fileoverview Rule to flag statements with function invocation preceded by
3  * "new" and not part of assignment
4  * @author Ilya Volodin
5  */
6
7 "use strict";
8
9 //------------------------------------------------------------------------------
10 // Rule Definition
11 //------------------------------------------------------------------------------
12
13 module.exports = {
14     meta: {
15         type: "suggestion",
16
17         docs: {
18             description: "disallow `new` operators outside of assignments or comparisons",
19             category: "Best Practices",
20             recommended: false,
21             url: "https://eslint.org/docs/rules/no-new"
22         },
23
24         schema: []
25     },
26
27     create(context) {
28
29         return {
30             "ExpressionStatement > NewExpression"(node) {
31                 context.report({ node: node.parent, message: "Do not use 'new' for side effects." });
32             }
33         };
34
35     }
36 };