{"id":19593,"library":"eslint-config-stylelint","title":"eslint-config-stylelint","description":"Stylelint org's shareable ESLint config. Current stable version 27.0.0, released recently. This package enforces a consistent JavaScript style across Stylelint repositories. It has become a pure ESM package since v26, dropping Node <20.19.0 and ESLint 9.x support. Key differentiator: tailored for Stylelint development, includes Jest-specific config. Peer dependencies include eslint >=10.0.2 and eslint-plugin-jest >=29.15.0. The config extends @eslint/js and uses rules from @stylistic/eslint-plugin and eslint-plugin-regexp.","status":"active","version":"27.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/stylelint/eslint-config-stylelint","tags":["javascript","eslint","eslintconfig"],"install":[{"cmd":"npm install eslint-config-stylelint","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-config-stylelint","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-config-stylelint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for ESLint functionality","package":"eslint","optional":false},{"reason":"Peer dependency for Jest support","package":"eslint-plugin-jest","optional":true}],"imports":[{"note":"ESM-only since v26; CommonJS require will fail. Use the default export directly.","wrong":"const stylelintConfig = require('eslint-config-stylelint')","symbol":"stylelintConfig","correct":"import stylelintConfig from 'eslint-config-stylelint'"},{"note":"The Jest config is a subpath export; use default import (no braces). Also ESM-only.","wrong":"import { stylelintJestConfig } from 'eslint-config-stylelint/jest'","symbol":"stylelintJestConfig","correct":"import stylelintJestConfig from 'eslint-config-stylelint/jest'"},{"note":"ESLint flat config requires export default; CommonJS module.exports will not work. Spread the config arrays.","wrong":"module.exports = [...stylelintConfig]","symbol":"flat config array","correct":"export default [...stylelintConfig, ...stylelintJestConfig]"}],"quickstart":{"code":"// Install: npm install eslint-config-stylelint eslint --save-dev\nimport stylelintConfig from 'eslint-config-stylelint';\nimport stylelintJestConfig from 'eslint-config-stylelint/jest';\n\nexport default [\n  ...stylelintConfig,\n  ...stylelintJestConfig,\n];","lang":"javascript","description":"Shows installation and usage for ESLint flat config with and without Jest support."},"warnings":[{"fix":"Upgrade to Node >=20.19.0 and ESLint >=10.0.2.","message":"Dropped ESLint 9.x support and Node.js <20.19.0 support.","severity":"breaking","affected_versions":">=27.0.0"},{"fix":"Convert project to ESM or use dynamic import().","message":"Became a pure ESM package, breaking CommonJS require.","severity":"breaking","affected_versions":">=26.0.0"},{"fix":"Upgrade to ESLint 9+ and Node >=18.18.","message":"Dropped ESLint 8.x and Node.js <18.18 support.","severity":"breaking","affected_versions":">=23.0.0"},{"fix":"Formatting rules have been deprecated; use @stylistic/eslint-plugin instead.","message":"No-confusing-arrow rule removed in v22.","severity":"deprecated","affected_versions":">=22.0.0"},{"fix":"Import 'eslint-config-stylelint/jest' explicitly.","message":"Jest config requires a separate subpath import, not part of main config.","severity":"gotcha","affected_versions":">=21.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Replace require() with import or use dynamic import().","cause":"Package is ESM-only since v26; require() not allowed.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/eslint-config-stylelint/index.js not supported."},{"fix":"Ensure eslint-plugin-jest is installed and import from 'eslint-config-stylelint/jest'.","cause":"Using wrong import path or not installing eslint-plugin-jest peer dependency.","error":"Cannot find module 'eslint-config-stylelint/jest'"},{"fix":"Export an array of flat config objects as shown in quickstart.","cause":"Using old eslintrc format with flat config.","error":"ConfigError: Config array must contain only flat config objects."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}