-
Notifications
You must be signed in to change notification settings - Fork 2
Rule manage absolute imports of a custom path as a vendor import #2
Comments
It's a curious point. I've never used this feature. Seems, it's impossible to find out whether it's node_module or something from |
@marcuzy: I've created a fork of your code, which implements support for aliases, like I need it: The rule is: First absolute paths, then aliases (starting with "@"), then relative paths (starting with ".").
But this is wrong:
It doesn't check if the alias links to a node_modules package, nor does it check if there is a node module which starts with an "@". But since both things are very unlikely, it works fine for me. It would be nice if you could implement this, or a similar solution into your package.
|
@jens-duttke I'll consider your idea, thanx. I found out that tslint provides access to the |
I'd love this too, obviously the simpler the better. One option is to use a |
🎉 Just published a beta version which supports custom rules 🎉. You could try this: npm i -D tslint-origin-ordered-imports-rule@beta With tsconfig.json like this: "rules": {
"origin-ordered-imports": [
true,
"one-blank-line",
[
"lib",
"^@docebo/.+",
"user"
]
]
} This config defines three import groups, their order and requires Please, test the beta and write here any issues you will find. 🖖 |
First of all, thanks for your TSLint plugin, very useful.
I tried to order a custom path import after a relative import and the error appears, but it says "Import of node_modules must be higher than custom import".
Is possibile to manage custom path with a different rule? Or maybe, simply change the error message?
For example "Absolute import must be higher than relative import"
The text was updated successfully, but these errors were encountered: