typescript-eslint / tslint-to-eslint-config

Converts your TSLint configuration to the closest possible ESLint equivalent. 🚀
MIT License
850 stars 100 forks source link

Missing tslint rule: encoding #826

Closed Kydyralin closed 3 years ago

Kydyralin commented 3 years ago

💥 Missing Converter

TSLint Rule Name

encoding

Package Source

TSLint rule: https://palantir.github.io/tslint/rules/encoding/

I've tried to google for some alternative on ESLint but unfortunately didn't find any. Not sure how many people rely on this rule but since there is still no converter issue for this I've decided to create one. Also not sure if this rule is even applicable for ESLint. If so please let me know, I'd really appreciate it.

kbrilla commented 3 years ago

I propose a combination of this tool: eclint with setting UTF-8 in .editorconfig as a notice until a proper rule will appear, or just a notice to use the tool in hook, or lint staged, etc....

JoshuaKGoldberg commented 3 years ago

Thanks for filing @Kydyralin! Indeed, I don't see anything on Google or https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/ROADMAP.md for the old encoding rule. Adding support for a non-ESLint linter is out of scope for tslint-to-eslint-config so I'm afraid this issue is going to have to be a 'wontfix' for now.

FWIW I have never seen a time when the encoding rule actually enforced anything, so it's not surprising to me that no equivalent exists in ESLint :smile:. If the ESLint community does end up creating an equivalent rule that has a nontrivial number of npm downloads, do post here and we can reopen!

kbrilla commented 3 years ago

There actually is a rule that enforces some rules based on .editorconfig: eslint-plugin-editorconfig but there is no rule for charset. Maybe make an issue/PR there @Kydyralin?

kbrilla commented 3 years ago

then again: encodingRule in ts is so simple, maybe I could actually try to write a rule myself as an exercise

Kydyralin commented 3 years ago

There actually is a rule that enforces some rules based on .editorconfig: eslint-plugin-editorconfig but there is no rule for charset. Maybe make an issue/PR there @Kydyralin?

Thanks for the notice. I've looked into the plugin repo. Probably it's really more reasonable to create an issue there since the charset property in the .editorconfig file and encoding tslint rule correlate with each other.