Skip to main content

@typescript-eslint/utils

Utilities for working with TypeScript + ESLint together. ✨

This package contains public utilities for writing custom rules and plugins in TypeScript. Rules declared in @typescript-eslint/eslint-plugin are created using these utility functions. Any custom rules you write generally will be as well.

See Custom Rules for documentation on creating your own custom ESLint rules for TypeScript code.

Exports

NameDescription
AST_NODE_TYPESAn enum with the names of every single node found in TSESTree.
AST_TOKEN_TYPESAn enum with the names of every single token found in TSESTree.
ASTUtilsTools for operating on the ESTree AST. Also includes the eslint-utils package, correctly typed to work with the types found in TSESTree
ESLintUtilsTools for creating ESLint rules with TypeScript.
JSONSchemaTypes from the @types/json-schema package, re-exported to save you having to manually import them. Also ensures you're using the same version of the types as this package.
ParserServicesTyping for the parser services provided when parsing a file using @typescript-eslint/typescript-estree.
TSESLintTypes for ESLint, correctly typed to work with the types found in TSESTree.
TSESLintScopeThe eslint-scope package, correctly typed to work with the types found in both TSESTree and TSESLint
TSESTreeTypes for the TypeScript flavor of ESTree created by @typescript-eslint/typescript-estree.