TSLint Origin Ordered Imports Rule
Custom rule for tslint
Strict order for imports ("Lib import" must be higher than "User import") + your own import groups defined by regexps.
🚀 This plugin needs minimum configuration to start:
npm i -D tslint-origin-ordered-imports-rule
Then you might set
one-blank-line option to require a blank line between import groups.
In such a case, the previous code becomes wrong.
one-blank-line, there are a few other options:
This plugin was created to be as simple as possible, with zero-configuration. It could still be used in that way, but if you need more configurable tool just define the array which describes your own order.
Actually, you can omit
user items as they will be added automatically to the beginning and the ending respectively.
To test the rule just run:
npm run compilenpm run test
The code in this project is licensed under MIT license.