You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,15 +56,15 @@ An ESLint plugin that enforces the use of import aliases. Also supports autofixi
56
56
Aliases are a great thing to make imports more readable and you do not have to change import paths that often when a file path is changed.
57
57
58
58
```js
59
-
importfoofrom'../../model/sub/foo'
60
-
importbarfrom'../other/bar'
59
+
importfoofrom'../../model/sub/foo';
60
+
importbarfrom'../other/bar';
61
61
```
62
62
63
63
changes to
64
64
65
65
```js
66
-
importfoofrom'@/model/sub/foo'
67
-
importbarfrom'@/sub/other/bar'
66
+
importfoofrom'@/model/sub/foo';
67
+
importbarfrom'@/sub/other/bar';
68
68
```
69
69
70
70
Now what if you are in a bigger team or you have a lot of projects to update. Or you just want to make sure that everything is consistent. This is where a linter comes into the play. This rule allows you to detect inconsistent imports and even autofix them. This works by matching alias paths agains the imports and replacing the import paths with the first matching aliased path.
0 commit comments