Skip to content

useSymbolDescription

Require 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.

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: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.

Symbol('description');
biome.json
{
"linter": {
"rules": {
"nursery": {
"useSymbolDescription": "error"
}
}
}
}