symbol-description
eslint
No autofix
eslint.config.js
export default [
{
rules: {
"symbol-description": "error",
},
},
];const foo = Symbol();const foo = Symbol("some description");
const someString = "some description";
const bar = Symbol(someString);Examples from the ESLint documentation.
symbol-description
eslint
export default [
{
rules: {
"symbol-description": "error",
},
},
];symbol-description
eslint plugin · pedantic
{
"rules": {
"symbol-description": "error"
}
}style/useSymbolDescription
style · since 2.0.0
{
"linter": {
"rules": {
"style": {
"useSymbolDescription": "error"
}
}
}
}Require using Error objects as Promise rejection reasons
Disallow loops with a body that allows only one iteration
Disallow redundant return statements
Require or disallow method and property shorthand syntax for object literals
Disallow specified global variables