You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@typescript-eslint/types

Package Overview
Dependencies
Maintainers
2
Versions
2961
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@typescript-eslint/types

Types for the TypeScript-ESTree AST spec


Version published
Weekly downloads
50M
increased by0.77%
Maintainers
2
Install size
152 kB
Created
Weekly downloads
 

Package description

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

Changelog

Source

6.11.0 (2023-11-13)

Bug Fixes

  • eslint-plugin: [explicit-function-return-type] support JSX attributes in allowTypedFunctionExpressions (#7553) (be2777c)
  • eslint-plugin: [no-unnecessary-qualifier] handle nested namespace id (#7883) (a668f5b)

Features

  • add no-unsafe-unary-minus rule (#7390) (c4709c2)
  • add types for flat config files (#7273) (66cd0c0)
  • allow typescript@5.3.0-RC as devDependency (#7821) (b6c40b4)
  • eslint-plugin: no-unsafe-enum-comparison handles switch cases (#7898) (72cb9e4)
  • typescript-estree: skip isTTY version check if user passes loggerFn on unsupported TypeScript version warning (#7739) (9656e13)
  • utils: add ESLint CodePath selector types (#7551) (99a026f)
  • utils: update types to reflect RuleContext and SourceCode changes and deprecations (#7812) (b73d8b2)

You can read about our versioning strategy and releases on our website.

Readme

Source

@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.

Keywords

FAQs

Package last updated on 13 Nov 2023

Did you know?

Socket

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
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc