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
+60-21Lines changed: 60 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,30 +2,53 @@
2
2
3
3
This resolver adds [`TypeScript`][] or [`JavaScript`][] import support to [`eslint-plugin-import`][] with `tsconfig.json` or `jsconfig.json` aliases (`compilerOptions.paths`)
4
4
5
-
This is fork of [`eslint-import-resolver-typescript`][] but much faster **(~30-40%)**
5
+
### Performance
6
6
7
-
For example we can use `strace` package for count of [fstat](`https://nodejs.org/api/fs.html#fsfstatsyncfd-options`) call when linting you codebase
7
+
This is fork of [`eslint-import-resolver-typescript`][] but much faster and more efficient. You can save time on project linting by **(~30-40%)**.
8
8
9
-
Example you codebase has multiple packages with 100k LOC and more
9
+

10
+
11
+
We use `strace` package for count of [fstat](`https://nodejs.org/api/fs.html#fsfstatsyncfd-options`) call when linting codebase
12
+
13
+
For example you codebase has multiple packages with 100 000 LOC ()
14
+
15
+
```
16
+
The following data depends directly on the number of imports in your case, but the comparison table is filled with data on the same code base
We are interested in how many accesses to the file system occurred during the linting process. We can pay attention to `statx` syscall.
27
-
28
-
`eslint-import-resolver-x` makes calls `statx` 10x+ times less.
34
+
| access | 52 900 | 50 641 |
35
+
| chdir | 1 | 1 |
36
+
| execve | 78 | 78 |
37
+
| faccessat2 | 1 | 1 |
38
+
| getcwd | 3 | 3 |
39
+
| mkdir | 2 | 2 |
40
+
| newfstatat | 31 761 | 32 137 🔺 |
41
+
| openat | 74 965 | 81 592 🔺 |
42
+
| readlink | 1 183 525 | 1 194 240 🔺 |
43
+
| statfs | 2 | 2 |
44
+
| statx | 1 058 381 | 11 734 655 🔺 |
45
+
| unlink | 3 | 2 |
46
+
47
+
We are interested in how many accesses to the file system occurred during the linting process.
48
+
49
+
For example we can pay attention to `statx` syscall.
50
+
51
+
`eslint-import-resolver-x` makes **10 MILLION fewer**`statx` calls
29
52
30
53
**If you notice an increase in linting performance in your CI on large code bases, write your feedback [here](https://github.com/helljs/eslint-import-resolver-x/discussions/1)**
31
54
@@ -69,7 +92,7 @@ Add the following to your `.eslintrc` config:
69
92
"@typescript-eslint/parser": [".ts", ".tsx"],
70
93
},
71
94
"import/resolver": {
72
-
"x": {
95
+
"@helljs/eslint-import-resolver-x": {
73
96
"alwaysTryTypes":true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
74
97
75
98
// Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
@@ -107,7 +130,7 @@ Add the following to your `.eslintrc` config:
107
130
"@babel/eslint-parser": [".js", ".mjs"],
108
131
},
109
132
"import/resolver": {
110
-
"x": {
133
+
"@helljs/eslint-import-resolver-x": {
111
134
// use <root>/path/to/folder/jsconfig.json
112
135
"project":"path/to/folder",
113
136
@@ -127,6 +150,22 @@ Add the following to your `.eslintrc` config:
127
150
}
128
151
```
129
152
153
+
You can use this resolver for mixed codebase with javascript & typescript:
0 commit comments