{"id":19528,"library":"eslint-config-hexo","title":"Hexo ESLint Configuration","description":"The official ESLint shareable config for Hexo projects. Current version 6.0.0 requires Node >=18 and ESLint >=9.17.0, and has migrated to ESLint's flat config system (eslint.config.js), breaking from the legacy .eslintrc format used in prior versions. It includes overrides for Hexo's code style and supports TypeScript via a separate import (eslint-config-hexo/ts). Use this to enforce consistent linting rules across Hexo plugins and themes. Differentiator: tailored specifically for Hexo, not a generic config.","status":"active","version":"6.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/hexojs/eslint-config-hexo","tags":["javascript","hexo","eslint-config"],"install":[{"cmd":"npm install eslint-config-hexo","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-config-hexo","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-config-hexo","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; required to run ESLint with this config. Must be ESLint >= 9.17.0 starting from v6.","package":"eslint","optional":false}],"imports":[{"note":"ESLint flat config expects an array of config objects. From v6 onwards, the default export is an array. In CommonJS, use require, but ensure ESLint is configured for flat config.","wrong":"const hexoConfig = require('eslint-config-hexo')","symbol":"hexoConfig (default)","correct":"import hexoConfig from 'eslint-config-hexo'"},{"note":"TypeScript config is provided at the subpath 'eslint-config-hexo/ts'. It is an array of flat configs for TypeScript support.","wrong":"const hexoTsLintConfig = require('eslint-config-hexo/ts')","symbol":"hexoTsLintConfig (TypeScript)","correct":"import hexoTsLintConfig from 'eslint-config-hexo/ts'"},{"note":"For CommonJS projects using eslint.config.js, use require to import the flat config array. Works with ESLint >=9.","wrong":"","symbol":"FlatConfig export","correct":"const hexoConfig = require('eslint-config-hexo')"}],"quickstart":{"code":"// eslint.config.js\nimport hexoConfig from 'eslint-config-hexo';\nimport hexoTsLintConfig from 'eslint-config-hexo/ts';\n\nexport default [\n  ...hexoConfig,\n  ...hexoTsLintConfig,\n  {\n    rules: {\n      'no-console': 'warn',\n      '@typescript-eslint/no-explicit-any': 'off'\n    }\n  }\n];","lang":"javascript","description":"Shows how to extend both the base and TypeScript ESLint flat configs with custom rules."},"warnings":[{"fix":"Replace .eslintrc.* with eslint.config.js. Import config as an array and spread it.","message":"v6.0.0 migrated to ESLint flat config (eslint.config.js). Legacy .eslintrc files are no longer supported.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Update Node.js to >=18 and ESLint to >=9.17.0.","message":"v6.0.0 requires Node.js >=18 and ESLint >=9.17.0. Older Node or ESLint versions will fail.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Disable 'no-console' rule in your config if console is allowed.","message":"v5.0.0 enabled no-console rule, which was not enabled before. Existing code with console.log may now fail linting.","severity":"deprecated","affected_versions":">=5.0.0 <6.0.0"},{"fix":"Import TypeScript rules from 'eslint-config-hexo/ts' as a separate array.","message":"The TypeScript config (eslint-config-hexo/ts) is only available from an undocumented subpath. Not all users may know to import from '/ts'.","severity":"gotcha","affected_versions":">=4.2.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Ensure eslint-config-hexo is installed: npm install eslint-config-hexo --save-dev. If using require, use require('eslint-config-hexo').","cause":"Attempting to import an ESM-only package from a CommonJS context without proper handling, or package not installed.","error":"Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'eslint-config-hexo'"},{"fix":"Set 'no-console' to 'off' or 'warn' in your config: rules: { 'no-console': 'off' }","cause":"The 'no-console' rule was enabled in v5 but user may have misconfigured it.","error":"Configuration for rule \"no-console\" is invalid"},{"fix":"Run npm install eslint-config-hexo --save-dev","cause":"Package not installed or not in node_modules.","error":"ESLint couldn't find the config 'eslint-config-hexo'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}