目录

@typescript-eslint/comma-spacing

Enforce consistent spacing before and after commas (,).

Rule Configuration

// code-linter.json5
{
  "rules": {
    "@typescript-eslint/comma-spacing": "error"
  }
}

Options

For details, see @typescript-eslint/comma-spacing.

Example of Correct Code

// By default, a space is required after a comma and not before it.
export const arr1 = ['1', '2'];
export const arr2 = ['1',, '3'];

function qur(a: string, b: string) {
  return `${a}${b}`;
}
qur('1', '2');

Example of Incorrect Code

// By default, a space is required after a comma and not before it.
export const arr = ['1' , '2'];

function qur(a: string ,b: string) {
  return `${a}${b}`;
}
qur('1' ,'2');

Rule Set

plugin:@typescript-eslint/all

For details about how to configure Code Linter check rules, see Code Linter.