DEV Community

Discussion on: Sorting your imports correctly in React

Collapse
 
hoangleitvn profile image
Hoang Le

This is awesome.

How about if we use for Angular? Btw have you been able to use any ext that can auto reorder imports based on the eslint rule?

Collapse
 
otamnitram profile image
Martín Mato

To use for Angular, I think you should use a tool like typescript-eslint for ESLint support Typescript and then use the plugin as I mentioned in the article. In theory, this should work, but I didn't try myself.

Regarding extensions to help you auto-reorder, you have the ESLint extension. With the help of setting editor.formatOnPaste": true and editor.formatOnSave": true on the VS Code settings you should be able to sort automatically on save and paste using the ESLint rule.