Conversion of TSLint semicolon rule seems incorrect?
rich-newman opened this issue Β· comments
π 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"
}
};
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!
I'm afraid this isn't fixed! I will open a new issue with a minimal reproduction