]>
git.proxmox.com Git - pve-eslint.git/blob - eslint/lib/rules/symbol-description.js
9f5d9358f00253a40fe2db201ef093b61f700637
2 * @fileoverview Rule to enforce description with the `Symbol` object
8 //------------------------------------------------------------------------------
10 //------------------------------------------------------------------------------
12 const astUtils
= require("./utils/ast-utils");
14 //------------------------------------------------------------------------------
16 //------------------------------------------------------------------------------
24 description
: "require symbol descriptions",
26 url
: "https://eslint.org/docs/rules/symbol-description"
31 expected
: "Expected Symbol to have a description."
38 * Reports if node does not conform the rule in case rule is set to
39 * report missing description
40 * @param {ASTNode} node A CallExpression node to check.
43 function checkArgument(node
) {
44 if (node
.arguments
.length
=== 0) {
54 const scope
= context
.getScope();
55 const variable
= astUtils
.getVariableByName(scope
, "Symbol");
57 if (variable
&& variable
.defs
.length
=== 0) {
58 variable
.references
.forEach(reference
=> {
59 const node
= reference
.identifier
;
61 if (astUtils
.isCallee(node
)) {
62 checkArgument(node
.parent
);