minor adjustment to readme
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / eslint / lib / rules / no-multi-assign.js
1 /**
2  * @fileoverview Rule to check use of chained assignment expressions
3  * @author Stewart Rand
4  */
5
6 "use strict";
7
8
9 //------------------------------------------------------------------------------
10 // Rule Definition
11 //------------------------------------------------------------------------------
12
13 module.exports = {
14     meta: {
15         type: "suggestion",
16
17         docs: {
18             description: "disallow use of chained assignment expressions",
19             category: "Stylistic Issues",
20             recommended: false,
21             url: "https://eslint.org/docs/rules/no-multi-assign"
22         },
23
24         schema: []
25     },
26
27     create(context) {
28
29         //--------------------------------------------------------------------------
30         // Public
31         //--------------------------------------------------------------------------
32
33         return {
34             AssignmentExpression(node) {
35                 if (["AssignmentExpression", "VariableDeclarator"].indexOf(node.parent.type) !== -1) {
36                     context.report({
37                         node,
38                         message: "Unexpected chained assignment."
39                     });
40                 }
41             }
42         };
43
44     }
45 };