Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@typescript-eslint/eslint-plugin
Advanced tools
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.
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;
}
This package provides linting rules for React and JSX. It's similar to @typescript-eslint/eslint-plugin in that it extends ESLint's capabilities to a specific language extension, but it focuses on React rather than TypeScript.
This package is designed for linting Vue.js templates and scripts. Like @typescript-eslint/eslint-plugin, it provides additional rules that are specific to the Vue.js framework, complementing the standard ESLint rules.
This plugin provides a set of rules that help ensure proper imports, exports, and module structure. While it's not specific to TypeScript, it complements @typescript-eslint/eslint-plugin by enforcing best practices in module usage.
@typescript-eslint/eslint-plugin
An ESLint plugin which provides lint rules for TypeScript codebases.
👉 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.
6.20.0 (2024-01-29)
You can read about our versioning strategy and releases on our website.
FAQs
TypeScript plugin for ESLint
The npm package @typescript-eslint/eslint-plugin receives a total of 28,437,784 weekly downloads. As such, @typescript-eslint/eslint-plugin popularity was classified as popular.
We found that @typescript-eslint/eslint-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
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.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.