Skip to main content

Enforces consistent spacing before and after commas (comma-spacing)

Rule Details

This rule extends the base eslint/comma-spacing rule. It adds support for trailing comma in a types parameters list.

How to Use

// note you must disable the base rule as it can report incorrect errors
"comma-spacing": "off",
"@typescript-eslint/comma-spacing": ["error"]


See eslint/comma-spacing options.

Taken with โค๏ธ from ESLint core


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