Socket
Socket
Sign inDemoInstall

@typescript-eslint/experimental-utils

Package Overview
Dependencies
103
Maintainers
1
Versions
2612
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @typescript-eslint/experimental-utils

(Experimental) Utilities for working with TypeScript + ESLint together


Version published
Weekly downloads
9.9M
decreased by-0.55%
Maintainers
1
Install size
3.35 MB
Created
Weekly downloads
 

Package description

What is @typescript-eslint/experimental-utils?

The @typescript-eslint/experimental-utils package provides various utilities for working with TypeScript and ESLint. It is part of the TypeScript ESLint project, which aims to enable ESLint to support TypeScript. The utilities in this package are considered experimental and are primarily intended for use by developers creating custom ESLint rules for TypeScript codebases.

What are @typescript-eslint/experimental-utils's main functionalities?

AST Utilities

Provides utility functions to work with Abstract Syntax Trees (AST), such as checking if a node is an identifier.

const { ASTUtils } = require('@typescript-eslint/experimental-utils');
const { isIdentifier } = ASTUtils;

ESLint Rule Creation

Facilitates the creation of custom ESLint rules with TypeScript support, including a rule creator function that helps define metadata for rules.

const { ESLintUtils } = require('@typescript-eslint/experimental-utils');
const createRule = ESLintUtils.RuleCreator(name => `https://example.com/rule/${name}`);

Type Information

Provides utilities to retrieve type information from TypeScript code, which can be used in custom ESLint rules to perform type-aware linting.

const { TypeScriptUtils } = require('@typescript-eslint/experimental-utils');
const { getParserServices } = TypeScriptUtils;
const parserServices = getParserServices(context);
const checker = parserServices.program.getTypeChecker();

Other packages similar to @typescript-eslint/experimental-utils

Changelog

Source

2.34.0 (2020-05-18)

Bug Fixes

  • typescript-estree: fix handling of range/loc removal (#2028) (ce344d9)

Features

  • eslint-plugin: [no-invalid-void-type] allow union of void and allowInGenericTypeArguments (#1960) (1bc105a)
  • eslint-plugin: [restrict-template-expressions] improve error message (#1926) (1af59ba)
  • experimental-utils: add suggestion property for rule modules (#2033) (f42a5b0)

Readme

Source

@typescript-eslint/experimental-utils

(Experimental) Utilities for working with TypeScript + ESLint together.

Note

This package has inherited its version number from the @typescript-eslint project. Meaning that even though this package is 2.x.y, you shouldn't expect 100% stability between minor version bumps. i.e. treat it as a 0.x.y package.

Feel free to use it now, and let us know what utilities you need or send us PRs with utilities you build on top of it.

Once it is stable, it will be renamed to @typescript-eslint/util for a 3.0.0 release.

Exports

NameDescription
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.
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.
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.
ParserServicesTyping for the parser services provided when parsing a file using @typescript-eslint/typescript-estree.

Contributing

See the contributing guide here

Keywords

FAQs

Last updated on 18 May 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc