Skip to content

Conversion of TSLint semicolon rule seems incorrect? #1207

Closed
@rich-newman

Description

@rich-newman

🐛 Bug Report

  • tslint-to-eslint-config version: 2.9.2 (latest)
  • ESLint version: Not installed
  • Node version: 14.17.5

Actual Behavior

Migration of the TSLint semicolon rule enables ESLint's semi rule as well as @typescript-eslint/semi. This seems to be contrary to the docs for @typescript-eslint/semi, and leads to two errors reported for one missing semicolon when we lint with ESLint.

Expected Behavior

ESLint's semi rule should be off? I'm a little unsure if it is being set to error deliberately for some reason?

Reproduction

  • Create tslint.json in a folder as below:
{
  "rules": {
    "semicolon": [ true, "always" ]
  }
}
  • In the folder, install and run the converter: npm i tslint-to-eslint-config, npx tslint-to-eslint-config
  • Resulting .eslintrc.js is below.
module.exports = {
    "env": {
        "browser": true,
        "es6": true,
        "node": true
    },
    "parser": "@typescript-eslint/parser",
    "parserOptions": {
        "project": "tsconfig.json",
        "sourceType": "module"
    },
    "plugins": [
        "@typescript-eslint"
    ],
    "rules": {
        "@typescript-eslint/member-delimiter-style": [
            "error",
            {
                "multiline": {
                    "delimiter": "semi",
                    "requireLast": true
                },
                "singleline": {
                    "delimiter": "semi",
                    "requireLast": false
                }
            }
        ],
        "@typescript-eslint/semi": [
            "error",
            "always"
        ],
        "semi": "error"
    }
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: incorrect converterRule converter with incomplete, incorrect, or invalid rule names and/or argumentsstatus: 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