Shareable ESLint configuration for Merkle projects. Version 5 uses ESLint 9 Flat Config format with native ESM.
npm install --save-dev eslint @merkle-open/eslint-configAll required plugins are bundled — no additional plugin installations needed.
| Preset | Description |
|---|---|
@merkle-open/eslint-config/typescript-browser |
TypeScript + browser globals |
@merkle-open/eslint-config/typescript-node |
TypeScript + Node.js globals |
@merkle-open/eslint-config/typescript-react |
TypeScript + React + JSX A11y |
| Preset | Description |
|---|---|
@merkle-open/eslint-config/es2025-browser |
ES2025 + browser globals |
@merkle-open/eslint-config/es2025-node |
ES2025 + Node.js globals |
@merkle-open/eslint-config/es2025-react |
ES2025 + React + JSX A11y |
Each preset has a -disable-styles variant that disables all formatting rules, for use with Prettier:
| Preset | Description |
|---|---|
@merkle-open/eslint-config/typescript-browser-disable-styles |
TypeScript browser without formatting rules |
@merkle-open/eslint-config/typescript-node-disable-styles |
TypeScript Node without formatting rules |
@merkle-open/eslint-config/typescript-react-disable-styles |
TypeScript React without formatting rules |
@merkle-open/eslint-config/es2025-browser-disable-styles |
ES2025 browser without formatting rules |
@merkle-open/eslint-config/es2025-node-disable-styles |
ES2025 Node without formatting rules |
@merkle-open/eslint-config/es2025-react-disable-styles |
ES2025 React without formatting rules |
Create an eslint.config.js file in your project root:
// eslint.config.js
import merkleConfig from "@merkle-open/eslint-config/typescript-browser";
export default [
...merkleConfig,
{
// Your project-specific overrides
ignores: ["dist/**", "node_modules/**"],
},
];// eslint.config.js
import merkleConfig from "@merkle-open/eslint-config/typescript-react";
export default [
...merkleConfig,
{
ignores: ["dist/**", "build/**", "node_modules/**"],
},
];Use the -disable-styles variant to let Prettier handle formatting:
// eslint.config.js
import merkleConfig from "@merkle-open/eslint-config/typescript-react-disable-styles";
export default [
...merkleConfig,
{
ignores: ["dist/**", "node_modules/**"],
},
];See Using with Prettier for more details.
If you prefer eslint-config-prettier over the built-in disable-styles:
// eslint.config.js
import merkleConfig from "@merkle-open/eslint-config/typescript-react";
import prettierConfig from "eslint-config-prettier";
export default [
...merkleConfig,
prettierConfig,
{
ignores: ["dist/**", "node_modules/**"],
},
];// eslint.config.js
import merkleConfig from "@merkle-open/eslint-config/typescript-node";
export default [
...merkleConfig,
{
ignores: ["dist/**", "node_modules/**"],
},
];// eslint.config.js
import merkleConfig from "@merkle-open/eslint-config/es2025-browser";
export default [
...merkleConfig,
{
ignores: ["dist/**", "node_modules/**"],
},
];{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}Note: The
--extflag is not needed with flat config — ESLint automatically lints.js,.jsx,.ts,.tsx,.mjs,.cjs,.mts,.ctsfiles.
In flat config, linting scope is controlled by a combination of CLI targets and config matching:
- CLI targets (
eslint src packages) decide which folders/files ESLint walks. ignoresremoves files/folders from linting (replacement for.eslintignore).filesdoes not define lint roots — it selects which config objects (rules, parser, overrides) apply to files that were already discovered.
Example:
// eslint.config.js
export default [
...merkleConfig,
{
files: ["**/*.test.ts"],
rules: {
"no-console": "off",
},
},
{
ignores: ["dist/**", "coverage/**", "node_modules/**"],
},
];# Lint roots are provided by CLI args (or ".")
eslint src packagesJavaScript presets use ESLint's built-in espree parser (no Babel parser by default), which natively supports ES2025 and JSX.
TypeScript presets use typescript-eslint with projectService: true for automatic tsconfig detection.
Parser selection follows normal flat-config matching: the parser from the matching config object (via files) is used for each file.
If you need Babel-specific syntax (decorators, Flow, etc.), install and configure @babel/eslint-parser:
npm install --save-dev @babel/eslint-parser @babel/core @babel/preset-react// eslint.config.js
import merkleConfig from "@merkle-open/eslint-config/es2025-browser";
import babelParser from "@babel/eslint-parser";
export default [
...merkleConfig,
{
files: ["**/*.js", "**/*.jsx"],
languageOptions: {
parser: babelParser,
parserOptions: {
requireConfigFile: false,
babelOptions: {
presets: ["@babel/preset-react"],
},
},
},
},
];MDX (.mdx) linting is not bundled, as it requires the remark/unified toolchain that most consumers don't need. If you lint MDX, install eslint-plugin-mdx and add it yourself:
npm install --save-dev eslint-plugin-mdx// eslint.config.js
import merkleConfig from "@merkle-open/eslint-config/typescript-react";
import * as mdx from "eslint-plugin-mdx";
export default [
...merkleConfig,
{
...mdx.flat,
files: ["**/*.mdx"],
processor: mdx.createRemarkProcessor({ lintCodeBlocks: true }),
},
{
...mdx.flatCodeBlocks,
files: ["**/*.mdx"],
},
];Code blocks inside MDX are linted with your existing rules via the MDX processor.
See the Migration Guide for step-by-step instructions.
Key changes:
- ESLint 9 Flat Config format (no more
.eslintrc.js) - ESM modules (no more
require()) - New import paths (e.g.,
/typescript-browserinstead of/configurations/typescript-browser) - TypeScript formatting rules moved from
@typescript-eslint/*style rules to@stylistic/* - ES8 presets renamed to ES2025
- ES5/ES6/ES7 presets removed
| Category | Link |
|---|---|
| Best Practices | documentation/best-practices.md |
| Style | documentation/style.md |
| Variables | documentation/variables.md |
| Errors | documentation/errors.md |
| ES2025 | documentation/es6.md, documentation/es8.md |
| Imports | documentation/imports.md |
| Node | documentation/node.md |
| React | documentation/react.md |
| React A11y | documentation/react-a11y.md |
| React Hooks | documentation/react-hooks.md |
| TypeScript | documentation/typescript.md |
| Using with Prettier | documentation/with-prettier.md |
| Migration Guide | documentation/MIGRATION.md |
- Create a feature branch from
develop - Make changes and create a pull request
- After approval and merge to
develop, changes are tested - Release is created by merging
developtomasterand tagging
See CHANGELOG.md for detailed release notes.