Skip to content

Changing notifice behavior for trailing-comma, esSpecCompliant option #329

Closed
@MatthiasKunnen

Description

@MatthiasKunnen

Actual Behavior

When esSpecCompliant is present, the following notice is given

ESLint does not support config property esSpecCompliant

Expected Behavior

There is however a distinction in the handling of trailing commas in regard to rest params by both linters. Trailing commas after a rest param is a syntax error in modern JavaScript/TypeScript.

Both rules were implemented without special treatment to rest params. Then ES2015/ES6 came along and introduced them.

TSLint introduced an option (esSpecCompliant) to change its rule's behavior to stop requiring commas after rest params. Without this option enabled, a comma is still required despite the syntax error it causes. This was done to not break old TypeScript versions. In all their recommended configs this option is enabled by default. There was an issue that sought to default the option to true but it got closed due to the library's deprecation (palantir/tslint#4172).

ESLint introduced a breaking change and no option can be enabled to require a comma after a rest param (See discussion eslint/eslint#7297).

Currently, tslint-to-eslint-config throws notices for having esSpecCompliant: true. I propose to change this because esSpecCompliant: true matches the ESLint rule and is the only valid config for modern JS/TS. I want to change the notice behavior so that only esSpecCompliant: false gives any notices. Alternatively we could also give notices when esSpecCompliant is not specified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: accepting prsPlease, send in a PR to resolve this! ✨type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions