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 not be shown for minified code
In some cases when there's minified code, CLI prints warning for short imports, while in fact there's no such thing in the code.
Fix the regular exepression to be more strict.
Also, instead of iterrating over each regular expression for core-modules directories, join them in a single RegExp. This improves the worst case scenario (i.e. when there are short imports for `xml` of `tns-core-modules`) with around 40%.
{file: "file1",line: "import { run } from 'application' "}
213
+
]
214
+
},
215
+
{
216
+
filesContents: {
217
+
// spaces in import line
218
+
file1: "import { run } from 'tns-core-modules/application' ;",
219
+
},
220
+
expectedShortImports: []
221
+
},
182
222
{
183
223
// Incorrect behavior, currently by design
184
224
// In case you have a multiline string and one of the lines matches our RegExp we'll detect it as short import
185
225
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`)',
226
+
file1: 'const _ = require("lodash");const application = require("application");console.log("application");console.log(`this is line\nyou should import some long words here require("application") module and other words here`)',
0 commit comments