What is @typescript-eslint/types?
The @typescript-eslint/types package is part of the TypeScript-ESLint project, which provides a TypeScript parser for ESLint and utilities for working with TypeScript and ESLint together. This specific package contains TypeScript definitions for ESLint-specific types, making it easier to work with ESLint configurations, rules, and plugins in a TypeScript environment. It is primarily used by developers who are creating custom ESLint rules or configurations and want to leverage TypeScript's type-checking capabilities for better development experience.
What are @typescript-eslint/types's main functionalities?
AST Node Types
Provides TypeScript interfaces for AST nodes generated by the parser. This is useful for writing type-safe code that inspects or manipulates the AST, such as custom ESLint rules.
import { TSESTree } from '@typescript-eslint/types';
function processNode(node: TSESTree.Node) {
if (node.type === 'Identifier') {
console.log('Found an identifier:', node.name);
}
}
Rule Definition Helpers
Includes types for defining ESLint rules in a TypeScript-friendly way, making it easier to create custom rules with type safety.
import { TSESLint } from '@typescript-eslint/types';
const myRule: TSESLint.RuleModule<'my-error', []> = {
meta: {
type: 'problem',
docs: {
description: 'My custom rule',
recommended: 'error'
}
},
create(context) {
return {
Identifier(node) {
context.report({
node,
messageId: 'my-error'
});
}
};
}
};
Other packages similar to @typescript-eslint/types
@typescript-eslint/experimental-utils
This package provides a set of utilities for working with TypeScript and ESLint, including ESLint rule helpers and AST utilities. It is similar to @typescript-eslint/types but offers a broader range of tools for rule development and AST manipulation.
eslint-plugin-typescript
An older package that aimed to add TypeScript support to ESLint before the official @typescript-eslint project was established. It provides some similar functionalities but is now deprecated in favor of the more comprehensive and up-to-date @typescript-eslint suite of packages.
@typescript-eslint/types
Types for the TypeScript-ESTree AST spec
This package exists to help us reduce cycles and provide lighter-weight packages at runtime.
β Internal Package
This is an internal package to the typescript-eslint monorepo.
You likely don't want to use it directly.
π See https://typescript-eslint.io for docs on typescript-eslint.
8.43.0 (2025-09-08)
π Features
- typescript-estree: disallow empty type parameter/argument lists (#11563)
π©Ή Fixes
- eslint-plugin: [no-non-null-assertion] do not suggest optional chain on LHS of assignment (#11489)
- eslint-plugin: [no-unnecessary-type-conversion] only report ~~ on integer literal types (#11517)
- eslint-plugin: [consistent-type-exports] fix declaration shadowing (#11457)
- eslint-plugin: [no-floating-promises] allowForKnownSafeCalls now supports function names (#11423, #11430)
- eslint-plugin: [no-deprecated] should report deprecated exports and reexports (#11359)
- eslint-plugin: [prefer-return-this-type] don't report an error when returning a union type that includes a classType (#11432)
- rule-tester: normalize paths before checking if they escape cwd (#11525)
- scope-manager: exclude Program from DefinitionBase node types (#11469)
- type-utils: add union type support to TypeOrValueSpecifier (#11526)
- typescript-estree: match filenames starting with a period when using glob in allowDefaultProject / (#11537)
β€οΈ Thank You
- Dima @dbarabashh
- Kirk Waiblinger @kirkwaiblinger
- mdm317
- Nicolas Le Cam
- tao
- Victor Genaev @mainframev
- Yukihiro Hasegawa @y-hsgw
- λ―Όκ°μ(Minji Kim) @mouse0429
- μ‘μ¬μ±
You can read about our versioning strategy and releases on our website.