Extending Shared Configurations
What you'll learn: How to inherit battle-tested rule sets from popular presets instead of configuring hundreds of rules manually.
Standing on the Shoulders of Giants
You could configure every single ESLint rule yourself—but why reinvent the wheel? Shared configurations are pre-packaged collections of rules that teams and organizations have refined over years of real-world use. By extending these presets, you inherit their wisdom instantly.
Think of it like moving into a furnished apartment instead of buying every piece of furniture yourself. You get a sensible baseline immediately, and you can still add your personal touches later.
Using Popular Presets
The most common shared configurations include:
eslint:recommended — ESLint's official starter pack. It enables rules that catch common errors and obvious bugs. This is lightweight and unopinionated about style.
Airbnb — One of the most comprehensive style guides, covering ES6+, React, and accessibility. It's opinionated but widely respected. You'll need to install eslint-config-airbnb separately.
How to Extend in .eslintrc
In your .eslintrc file, use the extends field:
{
"extends": "eslint:recommended"
}
Or stack multiple configurations:
{
"extends": ["eslint:recommended", "airbnb"]
}
When you extend multiple configs, later ones override earlier rules if there's a conflict.
Why This Matters
Instead of learning and configuring 200+ rules, you get a proven foundation in one line. You can still override specific rules afterward to match your team's preferences—the preset is just your starting point, not a prison.
Key Takeaway: Extending shared configurations like eslint:recommended or airbnb gives you instant access to battle-tested rule sets, letting you focus on customization rather than setup from scratch.