#atom

Individual configurable linting checks that enforce code quality standards

Core Idea: ESLint rules are atomic code quality checks that can be individually enabled, disabled, or configured to enforce specific patterns and practices in JavaScript and TypeScript code.

Key Elements


- **Common Core Rules**:
    
    - `no-unused-vars`: Prevent unused variable declarations
    - `no-undef`: Disallow undeclared variables
    - `eqeqeq`: Require === and !== over == and !=
    - `no-console`: Disallow console.log statements
    - `quotes`: Enforce consistent quote style
    - `semi`: Require or disallow semicolons
    - `max-len`: Enforce maximum line length
    - `indent`: Enforce consistent indentation
- **Rule Customization Example**:
    
    ```js
    // Advanced rule configuration
    {
      "rules": {
        "complexity": ["warn", 10],
        "max-depth": ["error", 4],
        "max-lines": ["warn", {"max": 300, "skipBlankLines": true}],
        "no-magic-numbers": ["error", { 
          "ignore": [-1, 0, 1, 2], 
          "ignoreArrayIndexes": true 
        }],
        "no-restricted-syntax": [
          "error", 
          {
            "selector": "ForInStatement",
            "message": "For..in loops are discouraged, use Object.keys instead."
          }
        ]
      }
    }
    ```
    

## Connections

- **Related Concepts**: ESLint (the tool that applies these rules), ESLint Configurations (collections of rule settings)
- **Broader Context**: Code Style Guides (formalized as rule configurations)
- **Applications**: Static Code Analysis (mechanism for automated code review)
- **Components**: ESLint Plugins (provide additional rules beyond core)

## References

1. ESLint Rules Documentation: https://eslint.org/docs/latest/rules/
2. "Understanding ESLint Rules" by Nicholas C. Zakas
3. "JavaScript Linting Essentials" by Cory House

#eslint #javascript #typescript #code-quality #linting-rules

---
**Connections:**
- 
---
**Sources:**
- From: Syntax - Lint como un desarrollador senior con eslint + husky + lint staged + acciones de github