haxe-checkstyle icon indicating copy to clipboard operation
haxe-checkstyle copied to clipboard

UnusedImport: take imports.hx into account

Open Gama11 opened this issue 9 years ago • 2 comments

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?

Gama11 avatar Mar 16 '16 12:03 Gama11

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.

AlexHaxe avatar Mar 16 '16 17:03 AlexHaxe

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+. :)

Gama11 avatar Mar 16 '16 18:03 Gama11