Registry / testing / eslint-config-typed

eslint-config-typed

JSON →
library4.9.6jsnpmunverified

eslint-config-typed (v4.9.6) is a comprehensive, fully typed ESLint configuration package for the modern flat config system. It provides strongly-typed rule definitions, pre-configured setups for TypeScript, React, Preact, Vitest, Jest, and Playwright, and custom ESLint plugins (ts-restrictions, vitest-coding-style, react-coding-style). Requires ESLint >=9 and TypeScript >=5. Actively maintained with weekly releases. Differentiators: type-safe rule options, TypeScript config support, and built-in custom rules not found in other config packages.

npm install eslint-config-typed
INSTALL
IMPORT
SIG · ESLINT-CONFIG-TYPE
E
eslint-config-typed
testingjavascriptv4.9.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

defineConfig
import { defineConfig } from 'eslint-config-typed'
const defineConfig = require('eslint-config-typed')
ESM-only since v4. Requires ESLint flat config. CommonJS require() will fail.
eslintConfigForTypeScript
import { eslintConfigForTypeScript } from 'eslint-config-typed'
Function that returns a flat config array for TypeScript projects.
eslintConfigForVitest
import { eslintConfigForVitest } from 'eslint-config-typed'
Pre-configured Vitest setup. Use eslintConfigForJest for Jest.
defineKnownRules
import { defineKnownRules } from 'eslint-config-typed'
import defineKnownRules from 'eslint-config-typed'
Named export only. Default export is not available in v4.
withDefaultOption
import { withDefaultOption } from 'eslint-config-typed'
Utility to apply default options to a rule configuration.

Sets up a TypeScript project with Vitest using eslint-config-typed flat config.

// eslint.config.js import { defineConfig, eslintConfigForTypeScript, eslintConfigForVitest, } from 'eslint-config-typed'; export default defineConfig([ // TypeScript config for source files ...eslintConfigForTypeScript({ tsconfigRootDir: import.meta.dirname, tsconfig: 'tsconfig.json', files: ['src/**/*.ts', 'src/**/*.tsx'], }), // Vitest config for test files ...eslintConfigForVitest({ files: ['src/**/*.test.ts', 'src/**/*.spec.ts'], }), // Custom overrides { rules: { 'no-console': 'warn', }, }, ]);
Debug
Known issues
breakingPackage is ESM-only since v4. CommonJS require() will throw an error.
fix
Switch to ESM (type: "module" in package.json) and use import statements.
affects: >=4.0.0
breakingRequires ESLint 9+ flat config. Legacy .eslintrc format is not supported.
fix
Migrate to eslint.config.js with flat config. See ESLint migration guide.
affects: >=4.0.0
breakingRequires TypeScript >=5.0.0. Older TypeScript versions are not compatible.
fix
Upgrade TypeScript to version 5 or later.
affects: >=4.0.0
deprecatedSome configuration functions from v3 are replaced by new functions in v4. Old imports may break.
fix
Check the API reference and replace old function names.
affects: >=4.0.0
gotchaTypeScript config files (eslint.config.ts) require tsx or ts-node to execute. Ensure your Node version and loader support TypeScript.
fix
Use tsx (npm i -D tsx) and run eslint with node --loader tsx/esm.
affects: >=4.0.0
gotchaIf using import-x/no-unused-modules, you must enable the 'unusedImports' option in tsconfig.json or provide a separate config.
fix
Set compilerOptions.unusedLocals to false or configure import-x/no-unused-modules correctly.
affects: >=4.0.0
gotchaPerformance can degrade on large monorepos. Consider caching and ignoring node_modules.
fix
Add ignorePatterns: ['node_modules'] and use ESLint cache (--cache).
affects: >=4.0.0
Errors
Common errors & fixes
Cannot find module 'eslint-config-typed' or its corresponding type declarations.
Missing peer dependencies or incorrect module resolution.
fix
Install eslint-config-typed with its peer dependencies: npm add -D eslint eslint-config-typed typescript
Error: Failed to load config "eslint-config-typed" to extend from.
Using legacy eslintrc format instead of flat config.
fix
Create an eslint.config.js file and use flat config. Remove .eslintrc files.
TypeError: defineConfig is not a function
Using default import incorrectly; defineConfig is a named export.
fix
Use import { defineConfig } from 'eslint-config-typed' instead of import defineConfig from '...'
ERR_REQUIRE_ESM: require() of ES Module not supported.
Package is ESM-only, but you are using require().
fix
Switch to ESM by adding "type": "module" to package.json and use import declarations.
Upgrade
Version history
4.9.6latest on npm
Audit
Dependencies
eslintoptionalPeer dependency — ESLint 9+ flat config is required.
typescriptoptionalPeer dependency — TypeScript 5+ required for TypeScript configurations.
Agent activity
2 hits · last 30 days
node
2
Resources