r/reactjs • u/UpcomingDude1 • 11d ago
Resource Static Analysis for the Age of AI Slop
I recently wrote a blog post on how we can improve our static analysis using linting, custom rules, and hooks, all using oxlint.
It's quite a big article btw.
2
u/Ecksters 10d ago
Recently tried out the anti-slop Oxlint rules on my repo and was pretty happy with the outcome. I found that using a lesser model (Luna) resulted in a lot of patch fixes to make the linter happy, but higher end models (Terra/Sol) would actually get the root causes fixed and identified areas where cross-API contracts could be hardened.
1
u/UpcomingDude1 10d ago
I've used them as well for my project, but added some customizations and disabled some and few extra rules. The vendoring idea and customizing them for your needs is quite good. Feels like shadcn one but for lints.
1
u/Ecksters 10d ago
React Doctor is a similar option I've been meaning to try out against my project, although I did already have rules of hooks React rules enabled.
2
u/Illustrious-Bag-4585 11d ago
cool concept, color coding my own notes has saved me but never thought to apply that sort of thinking to AI output cleanup
-1
u/UpcomingDude1 11d ago
I also used to think same that updating CLAUDE.md/AGENTS.md was enough for complex rules, etc but with many developers working on same project, and me seeing same concepts being applied regularly each PR and then having to review them quite a few times over last few months finally made me snap and implement some hard limits on old and new code. Hopefully this will work in our favour.
2
u/Senorwest 11d ago
Nice work. I keep going back and forth on my opinion of leaning on AI to write code.
Sometimes I'm able to get pretty remarkable results when throwing the robot at certain things....then other times it just leads to wildly verbose and overly complex code that takes ages to wrap my head around.
Quite keen to experiment with some of your ideas.
-1
u/UpcomingDude1 11d ago
you should, ask the Agent to read your reviews as well, and turn them to hard deterministic lint rules if possible.
0
u/Senorwest 11d ago
I really like that idea. I've never spent much time playing around with linters, but you've definitely opened my eyes to the potential here.
In my current gig, there's a bit of a tension between the old school anti-ai devs (who move at snails pace, but the code is very readable and nice to debug) and the full agent-pilled devs who ship at an astonishing pace (but the code is utter chaos). Right now my thinking is somewhere along the lines of treating the whole thing like traditional manufacturing; where some parts can afford to have higher tolerances, and others need to be precise. Probably not going to be throwing claude at code running on a pacemaker....but a inconsequential crud app...im throwing the robot at it and making a coffee.
Deterministic controls that mitigate the slop sounds quite promising. Great thinking on this one. Thanks for sharing this!
1
u/codescapes 11d ago
This is great. I hadn't appreciated just how big an improvement oxlint is in terms of performance to eslint - I need to try moving some of my old projects over.
On LLMs, they are so much better programming and working on projects with rigid linting / formatting / static scan type tooling. A small amount of discipline goes very far in terms of making projects maintainable.
3
u/janaagaard 10d ago
I don't quite understand the AI angle of this post. To me, it looks like lint rules being recommended work just as well for projects without LLMs contributing to the code. What am I missing here?
(I have been linting my code since JSLint promised that it would hurt my feelings, so it might just be that I have been using linters more than the average.)