The Deska blog
Rolling Out a New Lint Rule Across 400 Files
Learn the best strategies for rolling out a new lint rule across 400 files or more using automated tools, AST migrations, and side-by-side AI coding agents.
· 11 min read
Introducing a new lint rule to a mature codebase often feels like a daunting task. When you are rolling out a new lint rule across 400 files, the challenge is not just the initial fix, but managing the noise, avoiding regressions, and ensuring the change does not block the rest of the team. This guide covers the technical strategies to handle mass refactoring effectively, from native CLI tools to the latest AI agent workflows.
The Challenge of Large Scale Linting Changes
In a project with hundreds of files, a simple eslint --fix command might resolve 80 percent of violations but leave 20 percent that require manual intervention. This manual tail is where the risk lies. If you create a pull request with 400 modified files, your colleagues will find it impossible to review properly.
Large rollouts also create significant merge conflicts. If several developers are working on features while you are changing every third file in the repository, the integration process becomes a nightmare. To succeed, you need a strategy that prioritizes atomic commits and automated verification.
Planning the Rollout Strategy
Before running any commands, decide how you will categorize the violations. Most rules fall into three categories:
- Fully automatable: The linter can fix these without changing the logic.
- Ambiguous but scriptable: These require a codemod or a custom script to handle specific patterns.
- Context dependent: These require a human or a sophisticated agent to understand the original author's intent.
Phased Adoption
Instead of a single massive commit, consider a phased approach. First, add the rule as a warning. This alerts developers to stop introducing new violations without breaking the build. Second, use the overrides section in your configuration to enable the rule as an error only for new directories or specific modules. Finally, migrate the legacy files in logical batches.
Leveraging Native Tools and Codemods
Most modern linters provide a baseline for mass updates. For ESLint, the --fix flag is the primary tool. However, for more complex rules, you might need a formal codemod. tools like jscodeshift allow you to manipulate the Abstract Syntax Tree (AST) directly.
Using an AST based approach is safer than regex because it understands code structure. If you are changing how a specific hook is used across 400 files, a script that identifies the node types and transforms the arguments is far less likely to break your build than a global search and replace.
Using AI Agents for Managed Refactoring
When the rule requires logic changes that a standard codemod cannot handle, AI coding agents become valuable. Traditional scripts struggle with nuances like variable renaming or restructuring complex conditionals.
Operating within a terminal alone can make it hard to track what an agent is doing across hundreds of files. This is where a specialized environment like Deska provides an advantage. By running agents like Claude Code or Codex CLI side by side in an infinite canvas, you can monitor the progress of different batches simultaneously.
Side by Side Workflows
In a typical mass fix scenario, you can set up multiple panels to maintain visibility:
- One panel runs the linting check to identify remaining errors.
- A second panel runs a coding agent specifically tasked with fixing a subset of those files.
- A third panel displays the code editor to verify the agent's output in real time.
This approach keeps the local-first philosophy intact. Your source code and API keys stay on your machine while the agents work through the backlog. Since Deska supports several coding agents simultaneously, you can compare how different models handle a particularly tricky refactor.
Managing the Workflow with Deska
Deska is designed to handle complex developer tasks by providing a high density of information without losing context. When you are deep in a rollout, you can use Ask Deska to automate the setup of your environment. You can ask it to open terminals for every major directory in your project or to start an agent session for a specific file list.
The mobile app also plays a role in long running tasks. If an agent is processing 400 files, you do not need to sit at your desk. You can monitor the terminal output or the status of the linting job through the secure relay, which connects your devices directly without exposing ports.
Comparison of Rollout Methods
| Method | Speed | Safety | Complexity |
|---|---|---|---|
| ESLint --fix | Very Fast | High | Low |
| Custom AST Codemod | Fast | Very High | High |
| Manual Fix | Very Slow | Medium | Low |
| AI Coding Agents | Medium | High | Medium |
Manual fixes are rarely viable for 400 files. AST codemods are the gold standard for safety but require significant time to write and test. AI agents offer a middle ground, providing the flexibility of a human with the speed of an automated tool.
Technical Best Practices
- Use a temporary ignore file: List all 400 files in an
.eslintignorespecific to the new rule, then remove ten files at a time as you fix them. - Verify with tests: Run your full test suite after every batch. Never assume a lint fix is logic neutral.
- Commit frequently: Smaller commits make it easier to identify which change caused a regression.
- Use a dedicated branch: Keep the rollout work isolated until the very end to avoid polluting the main development line.
If you are using agent threads, keep a record of the prompts used for each batch. This ensures consistency in how the AI applies the new rule across different parts of the codebase.
FAQ
How to fix all ESLint errors in project?
The fastest way is to run eslint . --fix in your terminal. For errors that cannot be fixed automatically, you should use a combination of AST codemods or AI coding agents to process the remaining files in batches.
Can I run multiple AI agents at once?
Yes, using a tool like Deska allows you to open multiple panels and run different agents side by side. This is useful for comparing how Claude Code or Codex CLI handle a specific linting rule rollout.
What is the safest way to refactor 400 files?
The safest approach is to use a phased rollout. Start by setting the rule to warning, then use automated scripts for 100 percent safe changes. For the rest, use a tool that allows for manual verification and provides a local-first environment to ensure data privacy.
Streamline Your Next Rollout
Managing large scale changes does not have to be a manual grind. By combining traditional linting tools with modern AI agents, you can transform a week long task into a few hours of supervised automation.
To start managing your workspaces and agents more effectively, you can download the Deska desktop app. It provides the canvas you need to visualize your entire refactoring process in one place.