useSymbolDescription
¥Summary
-
规则生效日期:
v2.0.0¥Rule available since:
v2.0.0 -
诊断类别:
lint/style/useSymbolDescription¥Diagnostic Category:
lint/style/useSymbolDescription -
此规则没有修复方案。
¥This rule doesn’t have a fix.
-
此规则的默认严重级别为 information。
¥The default severity of this rule is information.
-
来源:
¥Sources:
-
与
symbol-description相同¥Same as
symbol-description
-
¥How to configure
{ "linter": { "rules": { "style": { "useSymbolDescription": "error" } } }}¥Description
要求 Symbol() 指令包含描述参数。
¥Require a description parameter for the Symbol().
Symbol 可以有一个可选的描述参数,这有助于调试并更清晰地说明符号的用途。
¥Symbol can have an optional description parameter which can be useful for
debugging and making the purpose of the symbol clearer.
¥Examples
¥Invalid
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.
¥Valid
Symbol('description');¥Related links
Biome v2.1 中文网 - 粤ICP备13048890号