1 # require symbol description (symbol-description)
3 The `Symbol` function may have an optional description:
6 var foo = Symbol("some description");
8 var someString = "some description";
9 var bar = Symbol(someString);
12 Using `description` promotes easier debugging: when a symbol is logged the description is used:
15 var foo = Symbol("some description");
18 // Symbol(some description)
21 It may facilitate identifying symbols when one is observed during debugging.
25 This rules requires a description when creating symbols.
29 Examples of **incorrect** code for this rule:
32 /*eslint symbol-description: "error"*/
38 Examples of **correct** code for this rule:
41 /*eslint symbol-description: "error"*/
44 var foo = Symbol("some description");
46 var someString = "some description";
47 var bar = Symbol(someString);
52 This rule should not be used in ES3/5 environments.
53 In addition, this rule can be safely turned off if you don't want to enforce presence of `description` when creating Symbols.
57 * [Symbol Objects specification: Symbol description](https://www.ecma-international.org/ecma-262/6.0/#sec-symbol-description)