Skip to content

Conversion of TSLint semicolon rule seems incorrect? #1207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rich-newman opened this issue Aug 31, 2021 · 2 comments · Fixed by #1468
Closed

Conversion of TSLint semicolon rule seems incorrect? #1207

rich-newman opened this issue Aug 31, 2021 · 2 comments · Fixed by #1468
Labels
area: incorrect converter Rule converter with incomplete, incorrect, or invalid rule names and/or arguments status: accepting prs Please, send in a PR to resolve this! ✨ type: bug Something isn't working

Comments

@rich-newman
Copy link

🐛 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"
    }
};
@JoshuaKGoldberg
Copy link
Member

Hmm, very weird! In the semicolon converter it specifically sets semi to ruleSeverity: "off":

Something is spooky and should be fixed. Thanks for filing @rich-newman!

@JoshuaKGoldberg JoshuaKGoldberg added area: incorrect converter Rule converter with incomplete, incorrect, or invalid rule names and/or arguments status: accepting prs Please, send in a PR to resolve this! ✨ type: bug Something isn't working labels Aug 31, 2021
@JamesHenry
Copy link
Member

I'm afraid this isn't fixed! I will open a new issue with a minimal reproduction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: incorrect converter Rule converter with incomplete, incorrect, or invalid rule names and/or arguments status: accepting prs Please, send in a PR to resolve this! ✨ type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants