I haven't seen an Apex linter and was wondering if anyone knew of one or had repurposed a Java linter? I'm so used to having this available when writing JavaScript or Ruby, it would be awesome to see the same reminders while coding Apex.
4 Answers
There's PMD Apex, which has a bunch of linting, plus various rules for SOQL inside loops, etc. That's the only one I'm aware of today.
sorry, this is an old post. But consider Clayton.io. It attaches to your source control repository (assuming you have one). I think it works on bitbucket and github at least.
I've used it for a month or two and it's great https://www.clayton.io/
Cheers Scott
We are currently working with this one and it seems promising:
You can use Apex PMD in:
Visual Studio Code: Apex PMD VsCode Extension
CI/CD: Mega-linter, for GitHub Actions, Circle CI, Jenkins and Azure, aggregates 70 linters including sfdx-scanner (Apex PMD, eslint for Aura and LWC)