{"id":19610,"library":"eslint-config-unjs","title":"eslint-config-unjs","description":"ESLint flat config preset for unjs projects, currently at v0.6.2. It integrates eslint recommended rules, eslint-plugin-unicorn, typescript-eslint, and eslint-plugin-markdown. This package is designed exclusively for ESLint's new flat config system (ESLint v9+). It provides a single exported function that accepts options for ignoring paths, overriding rules, and customizing markdown-specific rules. The package ships TypeScript types and is actively maintained with frequent dependency updates. Key differentiators include its tailored rule set for the unjs ecosystem and support for type-generated rule configurations via eslint-typegen.","status":"active","version":"0.6.2","language":"javascript","source_language":"en","source_url":"https://github.com/unjs/eslint-config","tags":["javascript","typescript"],"install":[{"cmd":"npm install eslint-config-unjs","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-config-unjs","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-config-unjs","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for ESLint flat config system","package":"eslint","optional":false},{"reason":"peer dependency for TypeScript integration","package":"typescript","optional":true}],"imports":[{"note":"ESLint flat config requires ES modules; CommonJS require may fail or need .default.","wrong":"const unjs = require('eslint-config-unjs')","symbol":"default","correct":"import unjs from 'eslint-config-unjs'"},{"note":"The function expects an options object (even if empty) to configure ignores, rules, and markdown.","wrong":"export default unjs() // missing object argument","symbol":"unjs function usage","correct":"export default unjs({ ignores: [], rules: {} })"},{"note":"Config types are exported for TypeScript projects; importing as value will cause runtime error.","wrong":"import { UnjsConfig } from 'eslint-config-unjs' // type import used as value","symbol":"TypeScript type imports","correct":"import type { UnjsConfig } from 'eslint-config-unjs'"},{"note":"The function returns a single config array; to merge multiple configs, spread the result.","wrong":"export default unjs({ ignores: [] }, otherConfigs) // cannot pass additional configs as second argument","symbol":"chaining multiple configs","correct":"export default [...unjs({ ignores: [] }), ...otherConfigs]"}],"quickstart":{"code":"import unjs from 'eslint-config-unjs';\n\nexport default unjs({\n  ignores: [\n    'dist',\n    'node_modules',\n    '*.config.*',\n  ],\n  rules: {\n    'unicorn/filename-case': ['error', { case: 'kebabCase' }],\n    '@typescript-eslint/no-unused-vars': 'warn',\n  },\n  markdown: {\n    rules: {\n      'unicorn/filename-case': 'off',\n    },\n  },\n});","lang":"typescript","description":"Creates an ESLint flat config using unjs preset with custom ignores, rule overrides, and markdown-specific overrides."},"warnings":[{"fix":"Migrate to flat config: use eslint.config.mjs and call import unjs from 'eslint-config-unjs'.","message":"ESLint flat config only: This preset does not support legacy .eslintrc configuration. Requires ESLint v9 and flat config.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Upgrade ESLint to v9 and rewrite config as flat config.","message":"v0.3.0 dropped support for ESLint <9 and legacy config. All previous versions (0.2.x) are incompatible.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Review unicorn plugin updates and adjust rules accordingly.","message":"Some unicorn rules may change between minor versions. Check changelog when upgrading.","severity":"deprecated","affected_versions":">=0.6.0"},{"fix":"Spread the result if merging with other configs: export default [ ...unjs(...), ...otherConfigs ];","message":"The unjs function returns an array, not a single object. Attempting to use it directly as a config object will fail.","severity":"gotcha","affected_versions":">=0.3.0"},{"fix":"Install @antfu/eslint-typegen and run it to generate rule types.","message":"Types for rules are not auto-generated in this package; you must use eslint-typegen separately.","severity":"gotcha","affected_versions":">=0.4.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run npm install -D eslint-config-unjs and use import (ESM) instead of require.","cause":"Missing npm install or using CommonJS require.","error":"Cannot find module 'eslint-config-unjs' or its corresponding type declarations."},{"fix":"Migrate to flat config (eslint.config.mjs) and use import unjs from 'eslint-config-unjs'.","cause":"Attempting to use preset in legacy .eslintrc with 'extends' field.","error":"Error: Failed to load config 'eslint-config-unjs' to extend from."},{"fix":"Rename file to .mjs or add \"type\": \"module\" in package.json.","cause":"ES module syntax used in a CommonJS file (e.g., .js without type: module).","error":"Parsing error: The keyword 'export' is reserved."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}