jarb
raw JSON → 3.0.10-0 verified Fri May 01 auth: no javascript
Reusable lint, webpack, babel and jest configuration package, version 3.0.10-0. Provides shared configurations for JavaScript/TypeScript projects, reducing setup overhead. Release cadence is irregular. Key differentiator: combines multiple tool configs into one dependency, but note that many projects now prefer using eslint-config-* or @babel/preset-env directly with more flexibility.
Common errors
error Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: .../node_modules/jarb/index.js ↓
cause Using require() on an ESM-only package in Node.js.
fix
Change to import statement or use --es-module-specifier-resolution=node flag.
error TypeError: Cannot assign to read only property 'rules' of object '#<Object>' ↓
cause Attempting to mutate the frozen config object.
fix
Create a copy: const myConfig = { ...lintConfig, rules: { ...lintConfig.rules, 'my-rule': 'warn' } };
Warnings
breaking Version 3.0.0 drops CommonJS support; require() will fail. ↓
fix Switch to ESM imports or use dynamic import() if necessary.
deprecated The default export jarb() may be deprecated in future versions in favor of named exports. ↓
fix Use named exports like lintConfig, webpackConfig, etc.
gotcha Configuration objects are frozen and cannot be mutated; merging with overrides requires cloning. ↓
fix Use Object.assign or spread operator to create a new config object.
Install
npm install jarb yarn add jarb pnpm add jarb Imports
- jarb wrong
const jarb = require('jarb')correctimport jarb from 'jarb' - lintConfig wrong
const { lintConfig } = require('jarb')correctimport { lintConfig } from 'jarb' - webpackConfig
import { webpackConfig } from 'jarb'
Quickstart
import jarb from 'jarb';
import { lintConfig, webpackConfig, babelConfig, jestConfig } from 'jarb';
// Use configurations directly
// For example, in .eslintrc.js:
module.exports = lintConfig;
// In webpack.config.js:
module.exports = webpackConfig;
// In .babelrc:
module.exports = babelConfig;
// In jest.config.js:
module.exports = jestConfig;
// Or use the default export for combined setup:
const config = jarb();
console.log(config);