Sort index.js imports alphabetically after adding a component
Spone opened this issue · comments
I think we should sort the imports in the index.js
file after adding a component using the generator.
If we implement this, let's add an option to disable this feature (at the generator level, and in config).
Hello,
I am currently working on this, I just wondering how you would like to handle if there is comments or any other code in the index.js
Options:
- remove everything that is not an import
- create a delimiter where the generator can write safely
Hi! Thanks for contributing :)
Personally I wouldn't mind removing everything that is not an import (it's an index file so theoretically it should only be used for imports).
But maybe it's better to add a delimiter just in case?
@sigmike @florentferry what do you think?
Hello,
The main purpose of this file is about listing others files, in theory only imports generated were been listed here. So keeping only imports is fine.
Great, it makes it easier.