useSymbolDescription
Summary
Section titled Summary- Diagnostic Category:
lint/nursery/useSymbolDescription
- This rule doesn’t have a fix.
- The default severity of this rule is information.
- Sources:
- Same as
symbol-description
- Same as
Description
Section titled DescriptionRequire a description parameter for the Symbol()
.
Symbol
can have an optional description parameter which can be useful for
debugging and making the purpose of the symbol clearer.
Examples
Section titled ExamplesInvalid
Section titled InvalidSymbol();
code-block.js:1:7 lint/nursery/useSymbolDescription ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Symbol() is missing a description parameter.
> 1 │ Symbol();
│ ^^
2 │
ℹ Add explicit description which can be useful in debugging and making the purpose of the symbol clearer.
Symbol('');
code-block.js:1:7 lint/nursery/useSymbolDescription ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Symbol() is missing a description parameter.
> 1 │ Symbol(”);
│ ^^^^
2 │
ℹ Add explicit description which can be useful in debugging and making the purpose of the symbol clearer.
Symbol(``);
code-block.js:1:8 lint/nursery/useSymbolDescription ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Symbol() is missing a description parameter.
> 1 │ Symbol(“);
│ ^^^^
2 │
ℹ Add explicit description which can be useful in debugging and making the purpose of the symbol clearer.
Valid
Section titled ValidSymbol('description');
How to configure
Section titled How to configure{ "linter": { "rules": { "nursery": { "useSymbolDescription": "error" } } }}