Skip to content

Handle tslint-eslint-rules properly #342

New issue

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

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

Already on GitHub? # to your account

Open
MLefebvreICO opened this issue Mar 10, 2020 · 4 comments
Open

Handle tslint-eslint-rules properly #342

MLefebvreICO opened this issue Mar 10, 2020 · 4 comments
Labels
area: missing converter A rule converter should exist but doesn't yet. good first issue Good for newcomers; welcome aboard! status: accepting prs Please, send in a PR to resolve this! ✨

Comments

@MLefebvreICO
Copy link

🚀 Feature Request

Handle tslint-eslint-rules when converting to directly put them in the rules of the config.

Existing Behavior

It puts valid eslint rules into @typescript-eslint/tslint/config

Change Proposal

Handle already valid eslint rules added (base on the rule's name) with tslint-eslint-rules and just transfer them directly into the rules of .eslintrc.js

@JoshuaKGoldberg
Copy link
Member

JoshuaKGoldberg commented Mar 10, 2020

@MLefebvreICO thanks for filing this issue! I'm a little unsure what you mean, but it looks like you're referring to adding converters for rules from tslint-eslint-rules?

If so, excellent, yes! Very happy to take those in.

@JoshuaKGoldberg JoshuaKGoldberg added status: accepting prs Please, send in a PR to resolve this! ✨ area: missing converter A rule converter should exist but doesn't yet. labels Mar 10, 2020
@MLefebvreICO
Copy link
Author

@JoshuaKGoldberg I though they were direct ESLint rules they embeded, but yeah some rules have a different name under that plugin, so yes adding a converter for that could be nice.

Unfortunately, we make the move now to ESLint so I won't be able to enjoy it, but I'm sure it could profit some more people

@JoshuaKGoldberg JoshuaKGoldberg added the good first issue Good for newcomers; welcome aboard! label Apr 27, 2020
@JoshuaKGoldberg
Copy link
Member

Scraping https://github.com/buzinas/tslint-eslint-rules,

tds = [...document.querySelectorAll("td[align=left]")];
trs = tds.filter(td => td.textContent === "✅").map(td => td.parentNode).filter(tr => tr.cells.length === 4)
ruleNames = trs.map(tr => `${tr.cells[2].textContent} -> ${tr.cells[1].textContent}`)

...the list is:

no-control-regex -> no-control-regex
no-duplicate-case -> no-duplicate-case
no-empty-character-class -> no-empty-character-class
no-ex-assign -> no-ex-assign
no-extra-boolean-cast -> no-extra-boolean-cast
no-extra-semi -> no-extra-semi
no-inner-declarations -> no-inner-declarations
no-invalid-regexp -> no-invalid-regexp
ter-no-irregular-whitespace -> no-irregular-whitespace
no-regex-spaces -> no-regex-spaces
ter-no-sparse-arrays -> no-sparse-arrays
no-unexpected-multiline -> no-unexpected-multiline
valid-jsdoc -> valid-jsdoc
valid-typeof -> valid-typeof
no-multi-spaces -> no-multi-spaces
ter-no-proto -> no-proto
ter-no-script-url -> no-script-url
ter-no-self-compare -> no-self-compare
handle-callback-err -> handle-callback-err
array-bracket-spacing -> array-bracket-spacing
block-spacing -> block-spacing
brace-style -> brace-style
ter-computed-property-spacing -> computed-property-spacing
ter-func-call-spacing -> func-call-spacing
ter-indent -> indent
ter-max-len -> max-len
ter-newline-after-var -> newline-after-var
ter-no-mixed-spaces-and-tabs -> no-mixed-spaces-and-tabs
object-curly-spacing -> object-curly-spacing
ter-padded-blocks -> padded-blocks
sort-imports -> sort-imports
space-in-parens -> space-in-parens
ter-no-tabs -> no-tabs
ter-arrow-body-style -> arrow-body-style
ter-arrow-parens -> arrow-parens
ter-arrow-spacing -> arrow-spacing
ter-prefer-arrow-callback -> prefer-arrow-callback

@JoshuaKGoldberg
Copy link
Member

Here are the rules not already implemented in tslint-microsoft-contrib converters:

array-bracket-spacing -> array-bracket-spacing
block-spacing -> block-spacing
brace-style -> brace-style
handle-callback-err -> handle-callback-err
no-duplicate-case -> no-duplicate-case
no-empty-character-class -> no-empty-character-class
no-ex-assign -> no-ex-assign
no-extra-boolean-cast -> no-extra-boolean-cast
no-extra-semi -> no-extra-semi
no-inner-declarations -> no-inner-declarations
no-multi-spaces -> no-multi-spaces
no-unexpected-multiline -> no-unexpected-multiline
object-curly-spacing -> object-curly-spacing
sort-imports -> sort-imports
space-in-parens -> space-in-parens
ter-arrow-body-style -> arrow-body-style
ter-arrow-parens -> arrow-parens
ter-arrow-spacing -> arrow-spacing
ter-computed-property-spacing -> computed-property-spacing
ter-func-call-spacing -> func-call-spacing
ter-indent -> indent
ter-max-len -> max-len
ter-newline-after-var -> newline-after-var
ter-no-irregular-whitespace -> no-irregular-whitespace
ter-no-mixed-spaces-and-tabs -> no-mixed-spaces-and-tabs
ter-no-proto -> no-proto
ter-no-script-url -> no-script-url
ter-no-self-compare -> no-self-compare
ter-no-sparse-arrays -> no-sparse-arrays
ter-no-tabs -> no-tabs
ter-padded-blocks -> padded-blocks
ter-prefer-arrow-callback -> prefer-arrow-callback
valid-jsdoc -> valid-jsdoc
valid-typeof -> valid-typeof

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area: missing converter A rule converter should exist but doesn't yet. good first issue Good for newcomers; welcome aboard! status: accepting prs Please, send in a PR to resolve this! ✨
Projects
None yet
Development

No branches or pull requests

2 participants