Skip to main content

Disallow unused expressions (no-unused-expressions)

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

Attributes

  • โœ… Recommended
  • ๐Ÿ”ง Fixable
  • ๐Ÿ’ญ Requires type information