eslint-config-rollup

raw JSON →
3.0.1 verified Mon Apr 27 auth: no javascript

A shareable ESLint configuration for Rollup projects, providing a consistent linting setup across Rollup's codebase. Version 3.0.1 is current, with active maintenance alongside Rollup's development cycle. This package enforces specific rules tailored for Rollup's code style, including TypeScript support and Prettier integration. Unlike generic ESLint configs, it is tightly coupled to Rollup's internal coding standards, making it ideal for contributors to Rollup itself or projects following similar patterns. It exports both an ESLint config and a Prettier configuration for consistency.

error Configuration for rule "import/no-unresolved" is invalid: Value "off" is not a valid severity.
cause Using an older version of eslint-plugin-import which does not support string severity.
fix
Upgrade eslint-plugin-import to >=2.25.0 or change to numeric severity (e.g., 0).
error ESLint couldn't find the config "rollup". Required by your ESLint configuration.
cause eslint-config-rollup is not installed or not being resolved correctly.
fix
Run 'npm install --save-dev eslint-config-rollup' and ensure node_modules is in the correct directory.
error Cannot find module 'eslint-config-rollup/prettier'
cause Using incorrect path for Prettier config.
fix
Use require('eslint-config-rollup/prettier') instead of require('eslint-config-rollup/prettier.js').
gotcha Extending 'eslint-config-rollup' directly instead of 'rollup' will not work.
fix Use the short name 'rollup' in the extends field.
gotcha Prettier config is exported at a subpath, not from the main entry.
fix Use require('eslint-config-rollup/prettier') for Prettier config.
gotcha This config is intended for Rollup projects; using it for other projects may result in incorrect linting rules.
fix Consider using a more generic ESLint config like eslint-config-airbnb.
deprecated ESLint 'extends' format changed; old style may cause issues in modern ESLint.
fix Ensure you are using ESLint >=7 and update extends format if using .eslintrc.
npm install eslint-config-rollup
yarn add eslint-config-rollup
pnpm add eslint-config-rollup

Sets up ESLint with the Rollup config and optionally extends the exported Prettier config.

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

// Then run:
// npx eslint .

// If using Prettier:
// .prettierrc.js
const rollupPrettier = require('eslint-config-rollup/prettier');
module.exports = {
  ...rollupPrettier,
  semi: true
};