Skip to content

CLI warns incorrectly for used short imports in minified code #4435

Closed
@rosen-vladimirov

Description

@rosen-vladimirov

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.2.3
  • Cross-platform modules: Not applicable
  • Android Runtime: Not applicable
  • iOS Runtime: Not applicable
  • Plugin(s): Not applicable

Describe the bug
In case you have minified code in your application or just several statements on one line, CLI may warn you that you have short imports, in cases when there aren't such.

To Reproduce

  1. tns create myApp --js
  2. cd myApp
  3. Open app/main-view-model.js and add the following line at the top of the app:
const Observable2 = require("tns-core-modules/data/observable").Observable; console.log("application");
  1. tns prepare android
    This will show warning, while in fact there's no short import in the file.

Expected behavior
CLI should not warn in such case.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions