Skip to main content

Migrating from ESLint and Prettier to Biome: A Security Perspective

NR Tech Studio Team
NR Tech Studio
14 min read

When evaluating the transition from the mature, plugin-heavy ecosystems of ESLint and Prettier to the unified, high-performance tooling provided by Biome, it is critical to acknowledge that neither toolset acts as a panacea for software security. Biome, while architecturally superior in terms of speed and configuration simplicity, cannot automatically detect complex logic flaws, nor can it identify insecure third-party dependencies hidden within your node_modules folder. It is a static analysis and formatting engine, not a comprehensive security auditing suite.

As a security engineer, my primary concern with tool migration is not just the speed of the CI/CD pipeline, but the potential for the migration process itself to introduce regressions or bypass existing security gates. Moving from a modular ESLint configuration to Biome requires a fundamental shift in how we enforce linting rules across a codebase. This guide explores the technical realities of replacing legacy JavaScript and TypeScript toolchains with Biome, focusing on maintaining your security posture throughout the transition.

Understanding the Architectural Shift

The traditional ESLint and Prettier stack relies on a decoupled architecture. ESLint manages the abstract syntax tree (AST) traversal to enforce stylistic and logical rules, while Prettier manages the final string serialization of your code. This separation, while historically robust, introduces significant overhead due to the constant re-parsing of files and the potential for configuration drift. In a large-scale project, maintaining harmony between .eslintrc and .prettierrc files often leads to rule conflicts, which developers frequently resolve by disabling rules entirely—a practice that directly compromises code quality and, by extension, security.

Biome consolidates these functions into a single, high-performance binary written in Rust. By unifying the formatter and the linter, Biome eliminates the ‘Prettier vs. ESLint’ conflict loop. However, from a security standpoint, the primary advantage is the reduced attack surface of your build environment. By removing hundreds of npm packages associated with ESLint plugins, you significantly lower the risk of supply chain attacks targeting your development pipeline. In environments where data integrity and secure coding standards are non-negotiable, reducing the number of transient dependencies is a proactive security measure that cannot be overlooked.

However, the transition is not as simple as swapping a package. Biome is opinionated and does not support the vast plugin ecosystem that ESLint does. If your current security posture relies heavily on custom ESLint plugins that enforce specific data sanitization or encryption patterns, you must port those rules to Biome’s internal engine or maintain a bridge. The lack of extensibility in Biome is a design choice meant to ensure performance and consistency, but it forces teams to rely on the core set of rules provided by the maintainers.

The Risks of Automated Migration

One of the most dangerous misconceptions in development is that automated migration scripts are ‘safe’ for production-grade code. When transitioning from ESLint and Prettier to Biome, many teams blindly run migration commands that overwrite existing configuration files. This is a high-risk operation. If your existing ESLint configuration includes specific rules for detecting insecure functions—such as eval(), dangerouslySetInnerHTML, or insecure cryptographic implementations—an automated migration might silently drop these constraints if they are not explicitly mapped to Biome’s ruleset.

Before executing any migration, you must perform a comprehensive audit of your current .eslintrc file. Categorize your existing rules into three buckets: stylistic (which can be safely offloaded to Biome’s formatter), logical (which need to be mapped to Biome’s linter), and security-critical (which may require manual verification or custom implementations). A common failure point is the assumption that the new tool will maintain the same level of strictness. Biome is fast, but it is not a drop-in replacement for complex, custom-written security linters that have been refined over years of production use.

Furthermore, consider the impact on your CI/CD pipeline. If your build process relies on specific exit codes from ESLint to halt a deployment due to security violations, changing the underlying tool will inevitably change those exit codes. A successful migration requires updating your CI environment to interpret Biome’s output correctly. Failure to do so could result in a scenario where insecure code passes through your pipeline simply because the new tool failed to block the build in the same way the old one did.

Mapping Security Rules to Biome

Mapping ESLint security rules to Biome is a manual, deliberate process. ESLint’s plugin ecosystem, particularly plugins like eslint-plugin-security or eslint-plugin-sonarjs, provides advanced pattern matching for common vulnerabilities. Biome currently focuses on a subset of these rules, prioritizing performance and reliability. If your security policy dictates that certain patterns must be blocked, you must verify that Biome provides equivalent coverage. If it does not, you are essentially weakening your security gates by migrating.

To perform this mapping, create a matrix comparing your current ESLint rules against the official Biome rule documentation. For every security-related rule in your current configuration, identify the corresponding Biome rule. If no equivalent exists, you must document this gap. In some cases, you may need to retain a minimal ESLint configuration for specific security checks while using Biome for general linting and formatting. This hybrid approach is often safer than forcing a complete migration where the target tool cannot meet your security requirements.

Consider the example of detecting hardcoded credentials or insecure API endpoints. If your current linting setup uses a custom regex-based ESLint rule to flag these, you cannot simply expect Biome to handle this. You would need to write a custom diagnostic if the tool allows, or supplement your workflow with dedicated static application security testing (SAST) tools. Relying solely on a formatter/linter for deep security analysis is a common mistake; ensure that your broader security strategy remains intact regardless of the formatting engine you choose.

CI/CD Pipeline Security and Integration

Integrating Biome into a hardened CI/CD pipeline requires careful attention to the execution environment. Unlike ESLint, which is often executed as a node process with a massive dependency tree, Biome is a single binary. This reduces the risk of malicious dependency injection, as there are fewer packages to audit during your software composition analysis (SCA) phase. However, you must still ensure that the Biome binary itself is sourced from a trusted, verified location. Always pin your Biome version in your package.json or CI configuration to prevent unexpected upgrades that could introduce breaking changes or unintended rule modifications.

When configuring your pipeline, treat the linter as a security gate. A build should be considered ‘failed’ if any error-level diagnostic is raised. Because Biome is significantly faster than ESLint, you might be tempted to increase the frequency of linting checks. This is a positive development, as it allows for shorter feedback loops. However, ensure that your pipeline configuration does not allow developers to bypass these checks using flags like --no-lint. In a secure development lifecycle, consistency is paramount, and every piece of code merged into the main branch must pass the same rigorous checks.

Finally, consider how your IDE integration handles the new tool. Developers often use local IDE settings that differ from the CI/CD pipeline. This ‘configuration drift’ can lead to situations where code passes locally but fails in CI. Ensure that the Biome configuration file (biome.json) is committed to your repository and that all team members are using the exact same version and configuration. This ensures that the security constraints enforced in the pipeline are identical to those experienced by the developer during the coding process, reducing the risk of ‘it works on my machine’ vulnerabilities.

Handling Legacy Codebases

Migrating a large, legacy codebase to Biome presents unique challenges. Often, legacy projects have accumulated technical debt in the form of ignored linter rules or legacy formatting styles that are deeply ingrained. When applying Biome to such a project, you face the risk of ‘linting churn,’ where the formatter makes massive changes across the codebase. While this improves readability, it can also obscure the history of security-sensitive files, making it harder to track changes in git blame or during a security code review.

To mitigate this, perform the migration in stages. Start by applying formatting rules to non-sensitive directories, then move to core logic. Never attempt to refactor and reformat security-critical modules in a single pull request. By isolating formatting changes from logic changes, you maintain the integrity of your audit trail. If a security vulnerability is discovered after a massive reformatting, having a clean git history is the difference between a quick fix and a week-long investigation.

Additionally, use Biome’s ability to ignore specific files or directories. If a legacy module is too fragile to be reformatted, exclude it from the Biome configuration. It is far better to have a partially linted codebase that remains functional and secure than to break critical business logic in an attempt to modernize your tooling. Security is about managing risk, and the risk of breaking a stable, albeit messy, module is often higher than the benefit of having it conform to new style guidelines.

Performance vs. Security Tradeoffs

The speed of Biome is often cited as its greatest strength, but speed can be a double-edged sword in a security context. When a linter is extremely fast, developers may become less inclined to perform thorough manual reviews, assuming that the ‘fast linter’ has caught everything. This is a dangerous cognitive bias. Biome is excellent at catching syntax errors and enforcing style, but it is not a replacement for human judgment or deep security testing.

In high-security environments, we often intentionally slow down the build process to allow for more intensive static analysis and security scanning. If you find that migrating to Biome has reduced your build time by several minutes, consider reinvesting that time into running more advanced security tools, such as SAST scanners or dependency vulnerability checks, within your pipeline. Do not simply accept the speed increase as a performance gain; use it as an opportunity to strengthen your overall security posture.

Furthermore, ensure that the speed of the formatter does not encourage the rapid, uncontrolled merging of code. A fast pipeline can sometimes mask poor development practices, as developers may push smaller, more frequent commits without the necessary security documentation. Maintain your standards for pull request reviews, regardless of how quickly your build pipeline executes. The speed of your tools should support your security processes, not replace them.

Common Security Pitfalls in Configuration

When configuring biome.json, it is easy to inadvertently disable security-sensitive rules in the name of convenience. For example, if you are struggling with a rule that flags potentially unsafe code, the temptation is to disable it globally. This is a critical mistake. If a rule is causing issues, it is often a sign that the code itself is poorly structured, not that the rule is ‘too strict.’ Always investigate the root cause of linting errors before deciding to suppress them.

Another common pitfall is the misuse of ‘ignore’ patterns. If you configure Biome to ignore entire directories, you are creating ‘blind spots’ in your security scanning. Ensure that your ignore patterns are as specific as possible and are reviewed regularly. Any directory that contains user-facing code or handles sensitive data must be subject to the full suite of linting and security checks. Regularly audit your biome.json file just as you would audit your firewall rules or access control lists.

Lastly, pay attention to the interaction between Biome and other tools in your stack. If you are using TypeScript, ensure that the version of TypeScript supported by Biome matches your project’s version. Incompatibilities here can lead to incorrect parsing, which in turn can lead to the linter failing to detect security issues. Always verify the compatibility matrix in the official documentation to ensure that your tooling stack is fully aligned.

The Importance of Manual Security Audits

No matter how advanced your linting and formatting tools become, they will never replace the necessity of manual security audits. Automated tools are designed to catch known patterns of insecure coding, but they are fundamentally incapable of understanding the business logic, the context of your data, or the unique threat model of your application. A manual audit, conducted by a security professional, is the only way to identify complex vulnerabilities such as broken access control, insecure business logic, or flawed authentication flows.

Use Biome to handle the ‘low-hanging fruit’—the consistent syntax and obvious code smells that distract reviewers from focusing on the real security challenges. By automating the enforcement of stylistic and basic security rules, you free up your security team to focus on the high-value, high-risk areas of your application. This is the true power of an automated toolchain: it allows your human experts to focus on the problems that require human intelligence.

If your team is struggling to implement these practices, consider that we offer specialized support for building secure, high-performance software architectures. Contact NR Studio to build your next project, and let our team help you navigate the complexities of modernizing your development stack while maintaining the highest security standards.

Maintaining Long-Term Security Standards

A migration is not a one-time event; it is the beginning of a new way of working. To maintain your security standards over the long term, you must integrate your tooling updates into your broader security policy. This means regular reviews of your linting rules, continuous training for your development team on secure coding practices, and a commitment to keeping your toolchain updated. As Biome evolves, new rules and features will be added; ensure that your team is aware of these changes and understands how they impact your security posture.

Document your security-related linting rules clearly. Every developer on your team should understand why certain rules exist and what the security implications are if those rules are bypassed. This culture of security is what truly protects your application, not the tools themselves. When developers understand the ‘why’ behind the rules, they are more likely to write secure code by default, reducing the reliance on automated checks.

Finally, remember that the software development landscape is constantly changing. New vulnerabilities are discovered, and new best practices emerge. Stay informed about the latest security research and adjust your linting and formatting strategies accordingly. By maintaining a proactive, security-first mindset, you can ensure that your development environment remains a robust defense against potential threats, regardless of the tools you choose to use.

Moving Forward with Your Development Strategy

Transitioning your toolchain is a significant architectural decision that requires careful planning and execution. By focusing on security at every stage—from the audit of existing rules to the integration into your CI/CD pipeline—you can successfully modernize your development environment without compromising your protection. Biome offers a compelling path forward for teams looking to improve performance and consistency, provided it is implemented with a clear understanding of its limitations and the broader security context.

For those looking to deepen their technical capabilities and ensure their software is built with security at its core, explore our complete Software Development directory for more guides. [Explore our complete Software Development directory for more guides.](/topics/topics-software-development/)

Frequently Asked Questions

Which is better, Biome or Prettier?

Biome is faster and provides an integrated linter, whereas Prettier focuses exclusively on formatting. Biome is better for teams looking to consolidate their toolchain, while Prettier is better for projects that require maximum compatibility with existing ESLint plugins.

Is Prettier deprecated?

No, Prettier is not deprecated and remains a widely used, stable tool for code formatting. Its longevity and extensive ecosystem make it a reliable choice for many development teams.

Which is better, Oxlint and OxFMT, or Biome?

Both are excellent high-performance tools written in Rust. Biome offers a more integrated, ‘all-in-one’ experience, while Oxlint and OxFMT are often preferred for their modularity and specific focus on performance metrics.

Which formatter is better than Prettier?

There is no objective ‘better’ formatter; the choice depends on your project requirements. Biome is often considered superior in terms of speed and tool consolidation, but Prettier’s maturity and widespread adoption make it the industry standard.

The decision to migrate from ESLint and Prettier to Biome should be driven by a desire for efficiency and a commitment to a simplified, more maintainable development workflow. However, this migration must never supersede the fundamental requirements of a secure software development lifecycle. By treating your linting configuration as a critical security asset, auditing your rulesets with precision, and maintaining a culture of security, you can leverage the benefits of new technology while keeping your application and its users safe.

If you are ready to modernize your development stack, reach out to our team for expert guidance and implementation support. Contact NR Studio to build your next project.

NR Studio builds custom web apps, mobile apps, SaaS platforms, and internal tools for growing businesses. If you’re working through a technical decision, feel free to reach out — no commitment required.

References & Further Reading

Leave a Comment

Your email address will not be published. Required fields are marked *