Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnusedImport: take imports.hx into account #189

Open
Gama11 opened this issue Mar 16, 2016 · 2 comments
Open

UnusedImport: take imports.hx into account #189

Gama11 opened this issue Mar 16, 2016 · 2 comments

Comments

@Gama11
Copy link
Member

Gama11 commented Mar 16, 2016

See http://haxe.org/blog/importhx-intro.

This probably requires a haxeVersion to be added to the config, so you don't get unnecessary warnings if you're targetting older Haxe versions?

@AlexHaxe
Copy link
Member

Regular Haxe files should start with an upper case letter, so UnusedImportCheck can just skip performing checks on import.hx files, regardless of Haxe version.

Since import.hx applies to all files in a folder, it's hard to find unused imports, unless UnusedImportCheck has a special mode for import.hx files, where it checks imports against all files from the same folder.

Detecting duplicate imports might be possible, if UnusedImportCheck populates seenModules from import.hx before checking a file.

@Gama11
Copy link
Member Author

Gama11 commented Mar 16, 2016

Hm.. I brought up the Haxe version thing to have a way of avoiding false positives, but I suppose if you have files named import.hx, it's pretty safe to assume are you're using Haxe 3.3.0+. :)

AlexHaxe added a commit to AlexHaxe/haxe-checkstyle that referenced this issue Mar 17, 2016
AlexHaxe added a commit that referenced this issue Mar 17, 2016
added support for import.hx files (see #189)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants