Skip to content

useSymbolDescription (JavaScript)

Language JavaScript (and super languages)
biome.json
{
"linter": {
"rules": {
"style": {
"useSymbolDescription": "error"
}
}
}
}

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/style/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/style/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/style/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');