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
feat: detect and report short imports used in application
In NativeScript 5.2.0 we've deprecated support for short imports. Add ability in CLI to check if there are such imports in the application's code and report them to users. The logic will be executed whenever application is prepared for build/livesync or when `tns doctor` is executed inside project dir.
Create class with static variables for ProjectTypes. These values must not be changed as they are used in Analytics, so changing them will break the current reports.
this.$logger.printMarkdown("Detected short imports in your application. Please note that `short imports are deprecated` since NativeScript 5.2.0. More information can be found in this blogpost https://www.nativescript.org/blog/say-goodbye-to-short-imports-in-nativescript");
127
+
shortImports.forEach(shortImport=>{
128
+
this.$logger.printMarkdown(`In file \`${shortImport.file}\` line \`${shortImport.line}\` is short import. Add \`tns-core-modules/\` in front of the required/imported module.`);
129
+
});
130
+
}
131
+
}catch(err){
132
+
this.$logger.trace(`Unable to validate if project has short imports. Error is`,err);
0 commit comments