ESLint Config for Electron React Boilerplate

raw JSON →
4.1.0 verified Sat Apr 25 auth: no javascript

eslint-config-erb is the official ESLint configuration for electron-react-boilerplate. Current stable version is 4.1.0, released with Node >=16 support. It extends eslint-config-airbnb with TypeScript, Prettier, and browser compatibility plugins. Release cadence is irregular, tied to the boilerplate's updates. Key differentiators: pre-configured for Electron + React + TypeScript, includes eslint-plugin-compat for targeting Chrome-specific Electron versions, and enforces Prettier formatting. Designed for building Electron apps with React, it handles the specific linting needs of that stack out of the box.

error Cannot find module 'eslint-config-erb'
cause The package is not installed or ESLint cannot resolve it.
fix
Run 'yarn add --dev eslint-config-erb' or 'npm install --save-dev eslint-config-erb'.
error ESLint: Failed to load plugin 'prettier' declared in 'eslint-config-erb'
cause Peer dependency eslint-plugin-prettier is missing.
fix
Install eslint-plugin-prettier: 'yarn add --dev eslint-plugin-prettier'.
error Parsing error: Cannot read file 'tsconfig.json'.
cause The config expects a TypeScript project with a tsconfig.json.
fix
Create a tsconfig.json or override 'parserOptions.project' in your ESLint config.
error A valid project must be set in parserOptions
cause TypeScript ESLint parser requires parserOptions.project to be set.
fix
Ensure tsconfig.json exists and is referenced correctly, or set parserOptions.project: null.
breaking Version 4.x requires Node >=16. Older Node versions cause install failures.
fix Upgrade Node to >=16 or use eslint-config-erb@3.x if on Node 14.
breaking Peer dependency eslint moved from >=7 to >=8 in v4.1.0, dropping ESLint 7 support.
fix Upgrade ESLint to >=8.
breaking React peer dependency now requires React 17 or 18; React 16 is no longer supported.
fix Upgrade React to >=17.
deprecated The old extends value 'eslint-config-erb' still works but is deprecated; use 'erb' instead.
fix Use 'extends': 'erb' for future compatibility.
gotcha The config sets 'parserOptions.project' for TypeScript, which requires a tsconfig.json. Missing it causes lint errors.
fix Ensure a tsconfig.json exists in the project root or set 'parserOptions.project' to false.
gotcha eslint-plugin-compat may raise false positives for browser APIs in Electron because it targets Chrome versions. Override with 'targets' in settings.
fix Add 'settings': { 'polyfills': [/*...*/] } or set targets in .browserslistrc.
npm install eslint-config-erb
yarn add eslint-config-erb
pnpm add eslint-config-erb

Quick setup: install the config with its peer deps and extend it in .eslintrc.json.

// Install
yarn add --dev eslint-config-erb eslint prettier

// .eslintrc.json
{
  "extends": "erb"
}

// Lint
yarn eslint src/