mflorence99 / import-splitnsort

VS Code extension to split and sort TypeScript imports
0 stars 3 forks source link

Integrate Split and Sort rules into ESLint? #6

Closed rfgamaral closed 4 years ago

rfgamaral commented 5 years ago

I'm not sure exactly where this would fit within the typescript-eslint monorepo, but would love to have the rules from this extension be implemented by ESLint for TypeScript and/or a set of ESLint rules.

Why?

This extension is great and provides an opinionated way to sort TypeScript imports with VS Code. I love it and would love to introduce this to some projects at work. However, without ESLint support this will never be possible because this would only work if everyone used VS Code (which is not the case) and had this extension installed.

If we could turn this into ESLint rules/plugin/whatever, we could have these formatting rules be introduced in a lint-staged configuration before commits/pushes, making sure everyone in the code base is formatting the code with the same rules.

I know this might require a lot of work here and there but I'm opening this issue as way for tracking that work from the owner of this extension or anyone else that might want to to contribute.

This might be of relevance:

mflorence99 commented 4 years ago

This is many days late and many dollars short I know, but I finally built the ESLint plugin you were looking for! Happily, all the virus lockdown gave me was cabin fever but I needed to keep busy. I'm sure it is way too late for you but I wanted to thank you for your excellent ideas and your original interest in splitnsort. I hope you are safe and well!

https://github.com/mflorence99/eslint-plugin-import-splitnsort

rfgamaral commented 4 years ago

Wow, that's awesome @mflorence99, and thanks for crediting me on the idea, really appreciate that. I'm also glad to find you safe and sound :)

I'm a bit busy with other things but I'll be sure to test your plugin whenever possible and I'll leave you feedback on the plugin repo. Not sure exactly when that will be but I believe your plugin could be a nice addition to my ESLint configuration for TypeScript projects.

mflorence99 commented 4 years ago

Nice! Thank you again for your great ideas. I got interested in ESLint when in an earlier side project I found it difficult to visualize the interplay of rules inherited from a cascade of plugins -- like your very nice eslint-config-typescript-unified project. So I built a VSCode extension to visualize ESLint configs.