Socket
Socket
Sign inDemoInstall

@typescript-eslint/eslint-plugin

Package Overview
Dependencies
126
Maintainers
2
Versions
3416
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @typescript-eslint/eslint-plugin

TypeScript plugin for ESLint


Version published
Weekly downloads
27M
decreased by-0.99%
Maintainers
2
Install size
7.17 MB
Created
Weekly downloads
Ā 

Package description

What is @typescript-eslint/eslint-plugin?

The @typescript-eslint/eslint-plugin package is an ESLint plugin that contains a set of ESLint rules that are specifically designed for TypeScript code. It helps in identifying and reporting on patterns found in TypeScript code, and it can be used to enforce a wide range of coding standards and conventions.

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

Type-aware linting

This feature allows for rules that require type information. For example, the 'strict-boolean-expressions' rule ensures that boolean expressions are clear and error-free by considering the types involved in the expression.

/* eslint @typescript-eslint/strict-boolean-expressions: 'error' */
function isTruthy(value: any): boolean {
  return Boolean(value);
}

Code style enforcement

Enforces naming conventions for everything from variables to type parameters. This example enforces camelCase naming for variables.

/* eslint @typescript-eslint/naming-convention: ['error', { 'selector': 'variable', 'format': ['camelCase'] }] */
let myVariable = 1;

Accessibility checks

This feature requires functions and methods to explicitly define their return type to improve code readability and maintainability.

/* eslint @typescript-eslint/explicit-function-return-type: 'warn' */
function add(x: number, y: number) {
  return x + y;
}

Other packages similar to @typescript-eslint/eslint-plugin

Changelog

Source

6.0.0 (2023-07-10)

Bug Fixes

  • ast-spec: remove more invalid properties (#6243) (aa20f63)
  • bumped ts-api-utils to 0.0.39 (#6497) (217c710)
  • correct handling of additionalProperties in object schemas (#6939) (489c7a5)
  • correct jest.mock path post merge (778d254)
  • correct lint error after merge (277fdb5)
  • eslint-plugin: [explicit-module-boundary-types] remove shouldTrackReferences option from schema (#5399) (6d32734)
  • eslint-plugin: allow parser@^6.0.0 (#6630) (92908bd)
  • eslint-plugin: remove valid-typeof disable in eslint-recommended (#5381) (b82df5e)
  • fix illegal decorator check (#6723) (c456f8c)
  • rename typeParameters to typeArguments where needed (#5384) (08d757b)
  • replace tsutils with ts-api-tools (#6428) (79327b4)
  • type-utils: checking of type aliases' type names by typeMatchesSpecifier (#6820) (7ca2c90)
  • type-utils: file variant of TypeOrValueSpecifier uses canonical filenames instead of lowercasing (#6781) (5095d05)
  • type-utils: fixed TypeOrValueSpecifier not accounting for scoped DT packages (#6780) (3350940)
  • type-utils: treat intrinsic types as if they are from lib and never match error types (#6869) (ecb57de)
  • typescript-estree: account for namespace nesting in AST conversion (#6272) (09e3877)
  • typescript-estree: allow writing to deprecated node properties (#6670) (6652ebe)
  • typescript-estree: fix error handling on ImportExpression (#6587) (e8cdd5c)
  • typescript-estree: forbid override on non-constructor function/methods (#6729) (2f3638f)
  • typescript-estree: wrap import = declaration in an export node (#5885) (1c3f470), closes #5036 #5834 #5882 #5864 #3076 #5834 #5882 #5864 #5889 #5834 #5882 #5864 #5883 #4863 #5381 #5256
  • update exports field in package.json files (#6550) (53776c2)
  • utils: removed TRuleListener generic from the createRule (#5036) (361f8bc), closes #5834 #5882 #5864

chore

Features

BREAKING CHANGES

  • Removes experimental-utils - we will no longer update this package and it will be forever frozen at v5.x
  • eslint-plugin: Adds an additional class of checks to the rule
  • drop support for ESLint v6
  • drops support for node v17
  • utils: Removes meta.docs.suggestion property
  • Bumps the minimum supported range and removes handling for old versions
  • drops support for node v12

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

Readme

Source

@typescript-eslint/eslint-plugin

An ESLint plugin which provides lint rules for TypeScript codebases.

NPM Version NPM Downloads

šŸ‘‰ See https://typescript-eslint.io/getting-started for our Getting Started docs.

See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code.

Keywords

FAQs

Last updated on 10 Jul 2023

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