Plugins and Community Rulesets
What you'll learn: How to extend ESLint with plugins and pre-configured rulesets to enforce framework-specific patterns, accessibility standards, and specialized linting needs.
Beyond Core ESLint
ESLint's built-in rules cover JavaScript fundamentals, but modern web development involves frameworks, accessibility concerns, and specialized coding patterns. Rather than writing custom rules from scratch, you can install plugins that add new rules and community rulesets that provide pre-configured rule collections.
How Plugins Work
Think of ESLint plugins like expansion packs for a game—they add new capabilities. A plugin might provide rules for React's JSX syntax, Vue's template logic, or accessibility best practices that core ESLint doesn't know about.
To use a plugin, you install it via npm and reference it in your .eslintrc:
{
"plugins": ["react"],
"rules": {
"react/prop-types": "warn",
"react/jsx-key": "error"
}
}
Popular plugins include eslint-plugin-react, eslint-plugin-vue, and eslint-plugin-jsx-a11y (for accessibility).
Community Rulesets
Instead of configuring hundreds of individual rules, you can extend community rulesets—curated configurations maintained by experts:
{
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended"
]
}
These rulesets bundle sensible defaults. For example, plugin:jsx-a11y/recommended enforces accessible HTML patterns like alt text on images and proper ARIA attributes.
Specialized Linting
Beyond frameworks and accessibility, plugins exist for TypeScript (@typescript-eslint), testing libraries (Jest, Testing Library), security patterns, and more. They catch domain-specific mistakes that general JavaScript linting misses.
Key Takeaway: Plugins extend ESLint with new rules for specific technologies, while community rulesets provide expert-curated configurations—together they catch framework-specific, accessibility, and specialized issues beyond vanilla JavaScript linting.