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);
13 Using `description` promotes easier debugging: when a symbol is logged the description is used:
16 var foo = Symbol("some description");
19 // Symbol(some description)
22 It may facilitate identifying symbols when one is observed during debugging.
27 This rules requires a description when creating symbols.
32 Examples of **incorrect** code for this rule:
35 /*eslint symbol-description: "error"*/
41 Examples of **correct** code for this rule:
44 /*eslint symbol-description: "error"*/
47 var foo = Symbol("some description");
49 var someString = "some description";
50 var bar = Symbol(someString);
56 This rule should not be used in ES3/5 environments.
57 In addition, this rule can be safely turned off if you don't want to enforce presence of `description` when creating Symbols.
61 * [Symbol Objects specification: Symbol description](https://www.ecma-international.org/ecma-262/6.0/#sec-symbol-description)