Course contentsShow
← JavaScript
Lesson 2566 of 2,72352. Linting and FormattingFree lesson

The Legacy .eslintrc Configuration Structure

Explore the traditional .eslintrc format with extends, plugins, rules, and environment settings.

The Legacy .eslintrc Configuration Structure

What you'll learn: How the traditional .eslintrc format organizes ESLint configuration using extends, plugins, rules, and env properties.

The Traditional Structure

Before ESLint's flat config system, the .eslintrc format (in .json, .js, or .yaml variants) was the standard way to configure your linter. This structure revolves around four main pillars that work together to define your linting setup.

The Four Key Properties

extends

Think of extends as inheriting rule sets from existing configurations. Instead of defining every rule yourself, you pull in popular presets like "eslint:recommended" or "airbnb-base". You can extend multiple configs, and they merge together (later ones override earlier ones).

plugins

Plugins add new rules beyond ESLint's core set. For example, "react" or "import" plugins bring specialized linting capabilities. You reference plugins by name, and they must be installed separately via npm.

rules

This is where you customize or override specific linting rules. Each rule gets a severity level ("off", "warn", or "error") and optional configuration. This is your fine-tuning control panel.

env

The env property tells ESLint which global variables exist in your runtime environment (like browser, node, es6). This prevents false errors when you use legitimate globals like window or process.

How They Work Together

The .eslintrc acts like a recipe: extend base configurations for a foundation, add plugins for specialized ingredients, customize rules for your taste, and set environments so ESLint knows what's available in your kitchen.

Key Takeaway: The legacy .eslintrc structure uses extends for base configs, plugins for additional rules, rules for customization, and env to define your JavaScript runtime context—all working together to create a complete linting profile.