no-unused-expressions
Disallows unused expressions.
Attributes
- Included in configs
- ✅ Recommended
- 🔒 Strict
- Fixable
- 🔧 Automated Fixer
- 🛠 Suggestion Fixer
- 💭 Requires type information
Rule Details
This rule extends the base eslint/no-unused-expressions
rule.
It adds support for optional call expressions x?.()
, and directive in module declarations.
How to Use
{
// note you must disable the base rule as it can report incorrect errors
"no-unused-expressions": "off",
"@typescript-eslint/no-unused-expressions": ["error"]
}
Options
See eslint/no-unused-expressions
options.
Taken with ❤️ from ESLint core