prettier-java icon indicating copy to clipboard operation
prettier-java copied to clipboard

Consider adding unused imports removal or java-lint package.

Open mshima opened this issue 1 year ago • 6 comments
trafficstars

I've created https://github.com/mshima/java-lint to remove unused imports in generator-jhipster generated code. Would be nice if it could be moved to jhipster organization in java-parser/prettier-java repository.

mshima avatar Apr 25 '24 11:04 mshima

I think there have already been some discussions about how far prettier-java should go with imports, in https://github.com/jhipster/prettier-java/issues/201. The conclusion - as I understand it - was that prettier is a formatter, but should not act as a linter. So this might be out of the scope of prettier.

murdos avatar Apr 25 '24 15:04 murdos

Yes, I understand that it should be not be implemented in prettier-plugin-java. The proposal is to add a new package in this repository.

mshima avatar Apr 25 '24 15:04 mshima

@clementdessoude Any thoughts on that? @mshima Since the development is already done, working and used in the generator, can you provide a PR so we can evaluate the impacts?

DanielFran avatar May 03 '24 10:05 DanielFran

I agree with @murdos : this might be out of the scope of prettier

@mshima : if you want to include this project to jhipster organization, it should be at github.com/jhispter/java-lint Just send an email to the mailing to discuss about it

pascalgrimaud avatar May 03 '24 12:05 pascalgrimaud

I agree with @murdos : this might be out of the scope of prettier

@mshima : if you want to include this project to jhipster organization, it should be at github.com/jhispter/java-lint Just send an email to the mailing to discuss about it

I only have interest to move to the java-parser repository to keep java-lint updated with it. I don't have interest to move to jhipster organization if the structure will be kept the sample.

mshima avatar May 03 '24 15:05 mshima

can you provide a PR so we can evaluate the impacts?

@DanielFran the idea is to move the entire project to https://github.com/jhipster/prettier-java/tree/main/packages/java-lint. As impact, maybe we should migrate prettier-java to vitest to match java-lint.

mshima avatar May 03 '24 15:05 mshima