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
fix: warnings for short imports should be shown correctly
In case you have a minified content or just several statements on the same line, we may print you a warning that you have short imports, in cases where you do not have such.
Fix this by splitting the content by new line and by `;` after that. This way, in case you have multiple statements on the same line, we'll separate them and should be able to check them correctly.
Also, ensure `node_modules` of the application are not analyzed.
NOTE: Currently in case you have a multiline string, like:
```
const lodash = require("lodash");console.log(`this is
multiline string
that has require "application" in it
and ends somewhere else`);
```
We'll detect the `that has require "application" in it` line as short import. Add test to show that this is the intended behavior at the moment, as fixing it requires additional complex logic without much benefit.
// In case you have a multiline string and one of the lines matches our RegExp we'll detect it as short import
185
+
filesContents: {
186
+
file1: 'const _ = require("lodash");const application = require("application");console.log("application");console.log(`this is line\nyou should import some long words here "application" module and other words here`)',
0 commit comments