Registry / testing / eslint-config-unjs

eslint-config-unjs

JSON →
library0.6.2jsnpmunverified

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.

npm install eslint-config-unjs
INSTALL
IMPORT
SIG · ESLINT-CONFIG-UNJS
E
eslint-config-unjs
testingjavascriptv0.6.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import unjs from 'eslint-config-unjs'
const unjs = require('eslint-config-unjs')
ESLint flat config requires ES modules; CommonJS require may fail or need .default.
unjs function usage
export default unjs({ ignores: [], rules: {} })
export default unjs() // missing object argument
The function expects an options object (even if empty) to configure ignores, rules, and markdown.
TypeScript type imports
import type { UnjsConfig } from 'eslint-config-unjs'
import { UnjsConfig } from 'eslint-config-unjs' // type import used as value
Config types are exported for TypeScript projects; importing as value will cause runtime error.
chaining multiple configs
export default [...unjs({ ignores: [] }), ...otherConfigs]
export default unjs({ ignores: [] }, otherConfigs) // cannot pass additional configs as second argument
The function returns a single config array; to merge multiple configs, spread the result.

Creates an ESLint flat config using unjs preset with custom ignores, rule overrides, and markdown-specific overrides.

import unjs from 'eslint-config-unjs'; export default unjs({ ignores: [ 'dist', 'node_modules', '*.config.*', ], rules: { 'unicorn/filename-case': ['error', { case: 'kebabCase' }], '@typescript-eslint/no-unused-vars': 'warn', }, markdown: { rules: { 'unicorn/filename-case': 'off', }, }, });
Debug
Known issues
breakingESLint flat config only: This preset does not support legacy .eslintrc configuration. Requires ESLint v9 and flat config.
fix
Migrate to flat config: use eslint.config.mjs and call import unjs from 'eslint-config-unjs'.
affects: >=0.3.0
breakingv0.3.0 dropped support for ESLint <9 and legacy config. All previous versions (0.2.x) are incompatible.
fix
Upgrade ESLint to v9 and rewrite config as flat config.
affects: >=0.3.0
deprecatedSome unicorn rules may change between minor versions. Check changelog when upgrading.
fix
Review unicorn plugin updates and adjust rules accordingly.
affects: >=0.6.0
gotchaThe unjs function returns an array, not a single object. Attempting to use it directly as a config object will fail.
fix
Spread the result if merging with other configs: export default [ ...unjs(...), ...otherConfigs ];
affects: >=0.3.0
gotchaTypes for rules are not auto-generated in this package; you must use eslint-typegen separately.
fix
Install @antfu/eslint-typegen and run it to generate rule types.
affects: >=0.4.0
Errors
Common errors & fixes
Cannot find module 'eslint-config-unjs' or its corresponding type declarations.
Missing npm install or using CommonJS require.
fix
Run npm install -D eslint-config-unjs and use import (ESM) instead of require.
Error: Failed to load config 'eslint-config-unjs' to extend from.
Attempting to use preset in legacy .eslintrc with 'extends' field.
fix
Migrate to flat config (eslint.config.mjs) and use import unjs from 'eslint-config-unjs'.
Parsing error: The keyword 'export' is reserved.
ES module syntax used in a CommonJS file (e.g., .js without type: module).
fix
Rename file to .mjs or add "type": "module" in package.json.
Upgrade
Version history
0.6.2latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required for ESLint flat config system
typescriptoptionalpeer dependency for TypeScript integration
Agent activity
6 hits · last 30 days
node
6
Resources
eslint-config-unjs — npm install eslint-config-unjs · libregistry