Enterprise ESLint config package that ships dual v8/v9 flat-config presets aligned to Prettier-first formatting, Sonar, and Jest workflows โ standardizing dev setup while enforcing consistent quality gates across repositories.
- ๐ Dual ESLint Support: Seamlessly works with both ESLint v8 (legacy
.eslintrcformat) and v9 (flat config format), providing maximum compatibility across different project setups and team preferences - โจ Prettier Enforced: Runs Prettier as an ESLint rule (
prettier/prettier) and disables conflicting formatting rules - ๐ง Sonar Baseline: Includes
eslint-plugin-sonarjsrecommended rules for code-smell detection; this config also enforces ESLint'sno-warning-commentsrule, so// nosonarand/* eslint-disable */comments will trigger errors to maintain quality gates - ๐งน Unused Imports: Flags dead imports (
eslint-plugin-unused-imports) - ๐งพ YAML Linting: Includes
eslint-plugin-ymlrecommended rules
This configuration provides maximum compatibility by supporting both ESLint v8 and v9, allowing teams to adopt modern linting practices without breaking existing workflows.
Recommended for new projects or when modernizing existing ones:
- โ Future-proof: ESLint v9's flat config is the direction of the ecosystem
- โ ESM-first: Native support for ES modules and modern JavaScript
- โ Performance: Faster configuration loading and resolution
- โ
Simplicity: Single configuration file instead of multiple
.eslintrcfiles
File naming: eslint.config.mjs (ESM) or eslint.config.js (with "type": "module")
Best for existing projects that need stability:
- โ Proven stability: Battle-tested in production environments
- โ
Gradual migration: Can coexist with existing
.eslintrcfiles - โ Tool compatibility: Some tools and plugins still expect legacy format
- โ
Team familiarity: Many developers are already comfortable with
.eslintrc
File naming: eslint.config.cjs (CommonJS flat config) or .eslintrc.js (legacy)
From ESLint v8 to v9:
- Keep your existing v8 setup working
- Add ESLint v9 flat config alongside (
eslint.config.cjs) - Test both configurations in parallel
- Gradually migrate teams and CI/CD
- Remove legacy config when ready
Both configurations use the same rule set, ensuring consistent code quality regardless of ESLint version.
npm install --save-dev @checkmarkdevtools/eslint-config-echo eslint prettieror
yarn add -D @checkmarkdevtools/eslint-config-echo eslint prettierCreate or update your eslint.config.mjs:
import echoConfig from '@checkmarkdevtools/eslint-config-echo';
export default [
...echoConfig,
// Your custom configurations
];Or in eslint.config.js if your project has "type": "module" in package.json:
import echoConfig from '@checkmarkdevtools/eslint-config-echo';
export default [
...echoConfig,
// Your custom configurations
];Create or update your .eslintrc.cjs:
module.exports = {
extends: ['@checkmarkdevtools/eslint-config-echo'],
// Your project-specific overrides
};If your project is CommonJS-only but you want flat config, use the explicit flat entrypoint:
const echoConfig = require('@checkmarkdevtools/eslint-config-echo/flat');
module.exports = [
...echoConfig,
// Your custom configurations
];The ./examples folder contains copy-pasteable configs:
examples/eslint.config.mjsโ ESLint v9 flat config (recommended)examples/.eslintrc.cjsโ ESLint v8 legacy.eslintrcconfig (extends this package)
See examples/README.md for the minimal index.
## Configuration Details
### Included Plugins
- **eslint-plugin-prettier** + **eslint-config-prettier**: Enforces Prettier (`prettier/prettier`) and disables conflicting formatting rules
- **eslint-plugin-sonarjs**: Sonar rule presets
- **eslint-plugin-unused-imports**: Flags unused imports
- **eslint-plugin-yml**: YAML linting rules
### Key Rules
- **No Console**: `console.*` is an error
- **Unused Imports**: Dead imports are an error
- **Modernization**: Prefer newer safer APIs (primarily via SonarJS)
### Test File Support
Test files get extra restrictions (no try/catch and no catch clauses) to force explicit error assertions.
### Customization
Append your own config objects after the shared config:
```javascript
import echoConfig from '@checkmarkdevtools/eslint-config-echo';
export default [
...echoConfig,
{
rules: {
// Override any rules here
'no-console': 'warn',
},
},
];
This config requires Prettier and enforces it through ESLint.
Precedence is intentional:
- Prettier formatting (must win)
- SonarJS (quality rules)
- Everything else
Create a .prettierrc:
{
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 100,
"tabWidth": 2
}Note: This config explicitly disables Sonar's trailing-comma rule (sonarjs/enforce-trailing-comma) to avoid conflicts with Prettier.
The repository includes commitlint configuration following conventional commits:
npm install --save-dev @commitlint/cli @commitlint/config-conventionalAdd these scripts to your package.json:
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier --write .",
"format:check": "prettier --check ."
}
}- ESLint: v8.x or v9.x
- ESLint v10: planned. This repo includes a forward-compat export setup and a conditional test hook, but cannot be verified until
eslint@10is published.
- ESLint v10: planned. This repo includes a forward-compat export setup and a conditional test hook, but cannot be verified until
- Node.js: >= 24
- Prettier: required (v3.x)
This project exists to standardize linting behavior across environments. Itโs meant to be used, extended, and reused inside real codebases without ceremony.
Youโre free to use this configuration, fork it, adapt it for your own projects, and run it internally. Thatโs the expected use case.
What you canโt do is package it as a paid product, service, or commercial offering without permission. If this configuration becomes part of something you sell or monetize, that requires a conversation first.
This repository is licensed under the PolyForm Shield License 1.0.0. Public forks or substantial reuse require attribution. No warranties are provided, no endorsements are implied, and if it breaks, thatโs on whoever wired it in. ๐
Contributions are welcome! Please follow the conventional commits specification for commit messages.
For issues and questions, please use the GitHub Issues page.
