Intelligent, self-configuring ESLint configuration that automatically analyzes your project structure, dependencies, and metadata to apply optimal linting rules for JavaScript, TypeScript, React, Node.js, and more.


Keywords
babel, bevry, editions, eslint, eslint-config, eslintconfig, esnext, export-default, flow, flow-type, flowtype, javascript, lint, node, prettier, tsx
License
Artistic-2.0
Install
npm install eslint-config-bevry@6.1.0-next.1754598040.bcd68da32bcac20801bb1019b45b90ca132ffa3a

Documentation

eslint-config-bevry

Status of the GitHub Workflow: bevry NPM version NPM downloads
GitHub Sponsors donate button ThanksDev donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button
Discord server badge Twitch community badge

Bevry's ESLint configuration is an intelligent, self-configuring system that automatically analyzes your project and adapts ESLint configuration accordingly. It performs comprehensive project analysis to detect your development environment and applies the optimal ESLint setup.

πŸš€ For the ultimate zero-configuration experience: Use Boundation - Bevry's automatic scaffolding and upgrading tool. When your project is scaffolded and managed by Boundation, nearly everything (including ESLint, TypeScript, testing, documentation, CI/CD, and more) is automatically configured and maintained using Bevry's battle-tested best practices. Simply run npx boundation in your project directory for complete project setup and ongoing maintenance.

πŸ” Intelligent Project Analysis

  • Boundation Ecosystem (optional): Complete automation via interactive Q&A system. When using Boundation, virtually all project metadata (editions, dependencies, keywords, browser fields, TypeScript/Babel/React setup, etc.) is automatically injected and managed, eliminating the need for manual configuration of the elements below.
  • Editions Integration (optional): When present, analyzes your package.json editions to extract syntax, module system, and target environment information
  • Dependency Detection: Scans dependencies and devDependencies to automatically enable relevant plugins and configurations
  • Package.json Analysis: Examines keywords, browser field, and other metadata to determine your project's target environment
  • ECMAScript Version Intelligence: Dynamically detects and configures for your specific ECMAScript target (ES5, ES2015, ES2017, ES2020, ES2021+)
    • Automatically disables incompatible rules for older targets
    • Configures appropriate globals and language features
    • Adjusts rule severity based on target capabilities

βš™οΈ Adaptive Configuration

  • ESLint Foundation: Extends ESLint's recommended configuration from @eslint/js as the baseline for all linting rules.
  • Module System Detection: Automatically configures for ES modules or CommonJS based on your project structure
    • Enables eslint-plugin-import with appropriate module validation
    • Configures TypeScript-aware import rules when applicable
  • Environment-Specific Setup: Intelligently configures globals and rules for detected environments:
    • Node.js: Configures eslint-plugin-n with module-aware or script-aware settings
    • Browser: Applies browser globals and environment-specific rules
    • Web Workers: Configures worker and service worker globals
  • Framework Integration: Automatically detects and configures framework-specific linting:
  • Language Support: Comprehensive language tooling integration:
  • Documentation Standards: Automatic JSDoc validation with eslint-plugin-jsdoc, TypeScript-aware when applicable
  • Code Formatting: Intelligent Prettier integration via eslint-config-prettier with comprehensive stylistic rule management:
    • Prettier-Compatible Rules: Special rules that can coexist with Prettier (marked as specialRule rather than disabled)
    • Legacy Stylistic Rules: Non-Prettier rules managed by ESLint Stylistic for comprehensive code consistency
    • Smart Conflict Resolution: Automatic detection and resolution of formatting conflicts between ESLint and Prettier

πŸ“‹ Comprehensive Rule Set

The configuration includes 120+ carefully curated ESLint rules designed to enforce best practices and coding conventions battle-tested by Bevry across 200+ packages and 20 years of JavaScript development.

Zero-Conflict Architecture: Takes great care to ensure zero conflicts between custom rules and plugin configurations. Each rule override is intentional and documented, preventing configurations from inadvertently disabling important plugin-provided rules.

Battle-Tested Standards: These conventions have evolved through maintaining hundreds of open source projects, from simple utilities to complex applications, ensuring they work reliably across diverse JavaScript environments and use cases.

All rules automatically adapt based on your detected environment, target ECMAScript version, and enabled features.

For your test.ts you probably want to add the following:

/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-function-type, @typescript-eslint/no-empty-object-type, @typescript-eslint/no-unsafe-argument -- we are writing tests, we have to test type-unsafe inputs */

✨ Benefits

  • πŸš€ Zero Configuration: Works out-of-the-box with intelligent project detection
  • πŸ“¦ Dependency-Free: No need to install or manage individual ESLint plugins
  • πŸ”§ Self-Maintaining: Configuration updates automatically with your project changes
  • ⚑ Performance Optimized: Only loads and configures plugins you actually need
  • πŸ›‘οΈ Battle-Tested: Used across Bevry's ecosystem of 200+ open source projects

Usage

Use boundation to automate installation and maintenance, making the rest of this usage section unnecessary.

Otherwise, to proceed and maintain manually, first install it and ESLint:

npm install --save-dev eslint eslint-config-bevry

πŸ’‘ Zero Plugin Management: With eslint-config-bevry, there's no need to manually install or configure any ESLint plugins (eslint-plugin-react, typescript-eslint, eslint-plugin-import, etc.). The configuration automatically includes and configures all necessary plugins based on your project's detected features, saving you from dependency management complexity.

Then add eslint.config.js file to your project root:

import { defineConfig } from 'eslint/config'
import eslintBevry from 'eslint-config-bevry'
export default defineConfig(eslintBevry)

Advanced Configuration

eslint-config-bevry supports customization through your package.json or programmatically:

Default Files and Ignores

Default Files: When no files are specified, eslint-config-bevry automatically includes:

  • If Editions are detected: {sourceEdition.directory}/**/*.{js,cjs,mjs,jsx,mjsx,ts,cts,mts,tsx,mtsx}
  • Otherwise: **/*.{js,cjs,mjs,jsx,mjsx,ts,cts,mts,tsx,mtsx}

Default Ignores: Always includes these patterns (your custom ignores are appended):

  • **/*.d.ts - TypeScript declaration files
  • **/vendor/ - Third-party vendor directories
  • **/node_modules/ - Node.js dependencies

Customization Options

Via package.json:

{
    "eslintConfig": {
        "files": [
            // Replaces the configuration from `eslint-config-bevry`
            "source/**/*.{js,ts}"
        ],
        "ignores": [
            // Appends to the configuration from `eslint-config-bevry`
            "dist/",
            "*.config.js"
        ],
        "rules": {
            // Overrides the configuration from `eslint-config-bevry`
            "no-console": "off"
        }
    }
}

Programmatic customization:

import { defineConfig } from 'eslint/config'
import eslintBevry from 'eslint-config-bevry'
export default defineConfig({
    extends: [eslintBevry],
    files: [
        // Replaces the configuration from `eslint-config-bevry`
        'source/**/*.{js,ts}',
    ],
    ignores: [
        // Appends to the configuration from `eslint-config-bevry`
        'dist/',
        '*.config.js',
    ],
    rules: {
        // Overrides the configuration from `eslint-config-bevry`
        'no-console': 'off',
    },
})

Running ESLint

Use ESLint as normal:

npx eslint --fix

Debugging and Inspection

To see, inspect, and debug the resultant configuration:

npx eslint --inspect-config

To validate your configuration is working correctly:

# Check specific files
npx eslint source/index.js --max-warnings 0

# See what files ESLint will process
npx eslint --dry-run

πŸ” Troubleshooting: If you encounter unexpected behavior, the configuration adapts based on your package.json dependencies and metadata. Check that your project's dependencies, devDependencies, keywords, and editions accurately reflect your project setup.

History

Discover the release history by heading on over to the HISTORY.md file.

Backers

Code

Discover how to contribute via the CONTRIBUTING.md file.

Authors

Maintainers

Contributors

Finances

GitHub Sponsors donate button ThanksDev donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button

Sponsors

Donors

License

Unless stated otherwise all works are:

and licensed under: