$ npm install eslint-config-bevry
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.
package.json editions to extract syntax, module system, and target environment informationdependencies and devDependencies to automatically enable relevant plugins and configurationskeywords, browser field, and other metadata to determine your project's target environment@eslint/js as the baseline for all linting rules.eslint-plugin-import with appropriate module validationeslint-plugin-n with module-aware or script-aware settingseslint-plugin-react with auto-detected React version and eslint-plugin-react-hookstypescript-eslint with strict configuration, disables conflicting JavaScript rules@babel/eslint-parser and @babel/eslint-plugin when detectedeslint-plugin-jsdoc, TypeScript-aware when applicableeslint-config-prettier with comprehensive stylistic rule management:
specialRule rather than disabled)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 */
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)
eslint-config-bevry supports customization through your package.json or programmatically:
Default Files: When no files are specified, eslint-config-bevry automatically includes:
{sourceEdition.directory}/**/*.{js,cjs,mjs,jsx,mjsx,ts,cts,mts,tsx,mtsx}**/*.{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 dependenciesVia 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',
},
})
Use ESLint as normal:
npx eslint --fix
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.
Discover the release history by heading on over to the HISTORY.md file.
Discover how to contribute via the CONTRIBUTING.md file.
Unless stated otherwise all works are:
and licensed under:
© 2010 - cnpmjs.org x YWFE | Home | YWFE