{"id":19498,"library":"eslint-config-cheminfo","title":"eslint-config-cheminfo","description":"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.","status":"active","version":"18.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/cheminfo/eslint-config","tags":["javascript"],"install":[{"cmd":"npm install eslint-config-cheminfo","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-config-cheminfo","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-config-cheminfo","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"ESLint is a peer dependency required to use the config","package":"eslint","optional":false}],"imports":[{"note":"ESM-only since v15 (flat config). CJS require() will fail.","wrong":"const cheminfo = require('eslint-config-cheminfo')","symbol":"default","correct":"import cheminfo from 'eslint-config-cheminfo'"},{"note":"Subpath exports are default exports, not named exports. Use the full path to the sub-config file.","wrong":"import { base } from 'eslint-config-cheminfo'","symbol":"base (named export from subpath)","correct":"import base from 'eslint-config-cheminfo/base'"},{"note":"Same as base: subpath configs are default exports, not named.","wrong":"import { vitest } from 'eslint-config-cheminfo/vitest'","symbol":"vitest (named export from subpath)","correct":"import vitest from 'eslint-config-cheminfo/vitest'"}],"quickstart":{"code":"import { defineConfig } from 'eslint/config';\nimport cheminfo from 'eslint-config-cheminfo';\n\nexport default defineConfig(cheminfo);\n\n// package.json scripts:\n// \"eslint\": \"eslint src\",\n// \"eslint-fix\": \"npm run eslint -- --fix\"","lang":"javascript","description":"Shows how to use the default config with flat config format and defineConfig helper. Requires ESLint ^9.39.1."},"warnings":[{"fix":"Update ESLint to ^9.39.1 and migrate to flat config if not already done. See MIGRATION.md.","message":"v17.0.0: Updated ESLint peer dependency to ^9.39.1 and plugins. Old v16 configs are incompatible with ESLint <9.39.1.","severity":"breaking","affected_versions":"<17.0.0"},{"fix":"Migrate from .eslintrc to eslint.config.mjs. Use default import instead of require().","message":"v15.0.0: Added Vitest plugin and strict config, enforced import order, and switched to ESM-only. The config is now flat config only.","severity":"breaking","affected_versions":"<15.0.0"},{"fix":"Review the newly enabled unicorn rules in CHANGELOG and fix or disable them as needed.","message":"v18.0.0: Enabled two new unicorn rules. Projects may see new lint errors if code violates these rules.","severity":"breaking","affected_versions":">=18.0.0"},{"fix":"Use eslint.config.mjs with the default export from 'eslint-config-cheminfo'.","message":"The .eslintrc format is deprecated since v15. Flat config only.","severity":"deprecated","affected_versions":">=15.0.0"},{"fix":"Use subpath imports: import base from 'eslint-config-cheminfo/base'.","message":"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'.","severity":"gotcha","affected_versions":">=15.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Change your eslint.config.js to .mjs extension and use import: `import cheminfo from 'eslint-config-cheminfo'`. Or use dynamic import.","cause":"Using require() on an ESM-only package that has no CJS export.","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."},{"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).","cause":"ESLint is not configured for ES modules or flat config is not enabled.","error":"Parsing error: The keyword 'import' is reserved"},{"fix":"Remove the 'extends' field from .eslintrc and create an eslint.config.mjs file following the quickstart.","cause":"Trying to use eslint-config-cheminfo with the legacy .eslintrc format, which is not supported since v15.","error":".eslintrc.json: ESLint couldn't find the config 'eslint-config-cheminfo' after extending."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}