# Understanding ESLint Rules — ESLint + Prettier

Source: https://www.geekswithgeeks.com/en/eslint-prettier/eslint-prettier-06

> Learn how ESLint rules work and enforce code quality.

## Rule severity levels

Each rule has a severity: off (disabled), warn (warning), or error (blocks build). Use warn for learning, error for production-critical issues.

## Common rules and severities

Set different severity levels for different rules based on importance.

```json
"rules": {
  "no-unused-vars": "warn",
  "no-undef": "error",
  "no-var": "error",
  "prefer-const": "warn",
  "semi": ["error", "always"],
  "no-console": "warn"
}
```

Output:

```
Rules configured with mixed severity levels
```

## Progressive enforcement

Start with 'warn' for new rules. Upgrade to 'error' once the team adapts. This reduces friction during adoption.

Quick check

**Quiz:** What does severity 'error' mean?

- [x] Blocks the build; must be fixed.
- [ ] Just a warning, doesn't block build.
- [ ] The rule is disabled.

*Answer:* Blocks the build; must be fixed.. 'error' severity prevents the build from succeeding until the issue is resolved.
