Skip to content

Bug: [comma-spacing] conflicts with array-bracket-spacing #6874

Closed
@alecrobertson1

Description

@alecrobertson1

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Playground Link

https://typescript-eslint.io/play/#ts=5.0.2&sourceType=module&code=NocgbghgNgrgpiANAAnNeAmJyC6Q&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQIbWlwE8BaAI0IGMBrRAFxOQAddKBLAOwHN0pECA9tEgAacNkgABOkSYpK0NkwYp4nOgHpKAgLY7cjFu269I-aEMjiAviGtA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA

Repro Code

['value', 'value2',]

ESLint Config

module.exports = {
  parser: "@typescript-eslint/parser",
  rules: {
    "array-bracket-spacing": "error",
    "@typescript-eslint/comma-spacing": "error"
  }
};

tsconfig

No response

Expected Result

[comma-spacing] should not throw an error, as there should not be a space between a trailing comma in an array and the closing "]" bracket.

Actual Result

[comma-spacing] throws an error, "A space is required after ','".

Additional Info

This issue was fixed in ESLint's [comma-spacing] rule here: eslint/eslint#16113.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingformattingRelated to whitespace/bracket formatting. We strongly recommend you use a formatter instead.package: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions