eslint-config-cheminfo

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

Shared ESLint configuration for cheminfo and ml.js projects. Current stable version is 18.0.0, released April 2026. It requires ESLint ^9.39.1 and uses the flat config format only. The config bundles rules from eslint-plugin-jsdoc, eslint-plugin-unicorn, and eslint-plugin-vitest into multiple sub-configs: base, jsdoc, unicorn, and vitest. The default export combines them all. Breaking changes in recent major versions include enabling new unicorn rules, adding import order and type-only checks, and updating ESLint and plugin peer dependencies. Unlike generic ESLint configs, this is tightly scoped to the cheminfo ecosystem with opinionated rules for chemistry and machine learning JavaScript libraries.

error Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/eslint-config-cheminfo/index.js from /path/to/eslint.config.js not supported.
cause Using require() on an ESM-only package that has no CJS export.
fix
Change your eslint.config.js to .mjs extension and use import: import cheminfo from 'eslint-config-cheminfo'. Or use dynamic import.
error Parsing error: The keyword 'import' is reserved
cause ESLint is not configured for ES modules or flat config is not enabled.
fix
Ensure you are using ESLint ^9.39.1 and a flat config file (eslint.config.mjs). Check that your Node version supports ES modules (>=12).
error .eslintrc.json: ESLint couldn't find the config 'eslint-config-cheminfo' after extending.
cause Trying to use eslint-config-cheminfo with the legacy .eslintrc format, which is not supported since v15.
fix
Remove the 'extends' field from .eslintrc and create an eslint.config.mjs file following the quickstart.
breaking v17.0.0: Updated ESLint peer dependency to ^9.39.1 and plugins. Old v16 configs are incompatible with ESLint <9.39.1.
fix Update ESLint to ^9.39.1 and migrate to flat config if not already done. See MIGRATION.md.
breaking v15.0.0: Added Vitest plugin and strict config, enforced import order, and switched to ESM-only. The config is now flat config only.
fix Migrate from .eslintrc to eslint.config.mjs. Use default import instead of require().
breaking v18.0.0: Enabled two new unicorn rules. Projects may see new lint errors if code violates these rules.
fix Review the newly enabled unicorn rules in CHANGELOG and fix or disable them as needed.
deprecated The .eslintrc format is deprecated since v15. Flat config only.
fix Use eslint.config.mjs with the default export from 'eslint-config-cheminfo'.
gotcha The default export from 'eslint-config-cheminfo' combines all sub-configs (base, jsdoc, unicorn, vitest). If you only want base, import from 'eslint-config-cheminfo/base'.
fix Use subpath imports: import base from 'eslint-config-cheminfo/base'.
npm install eslint-config-cheminfo
yarn add eslint-config-cheminfo
pnpm add eslint-config-cheminfo

Shows how to use the default config with flat config format and defineConfig helper. Requires ESLint ^9.39.1.

import { defineConfig } from 'eslint/config';
import cheminfo from 'eslint-config-cheminfo';

export default defineConfig(cheminfo);

// package.json scripts:
// "eslint": "eslint src",
// "eslint-fix": "npm run eslint -- --fix"