Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@typescript-eslint/utils
Advanced tools
Utilities for working with TypeScript + ESLint together
The @typescript-eslint/utils package provides utility functions and types that are used across the TypeScript ESLint project. It's designed to help with the development of ESLint rules, parsers, and plugins by providing a consistent set of tools for working with TypeScript code. This package is particularly useful for those creating custom ESLint rules or integrating TypeScript more deeply into their ESLint configurations.
AST Utilities
AST Utilities provide functions to work with Abstract Syntax Tree (AST) nodes. These utilities can help in identifying node types, such as checking if a node is an identifier or a literal, which is useful when writing custom ESLint rules.
import { ASTUtils } from '@typescript-eslint/utils';
const { isIdentifier, isLiteral } = ASTUtils;
Type Checking
This feature allows rule developers to access TypeScript's type checker, enabling them to perform more sophisticated analyses, such as type inference or type checking, within their custom ESLint rules.
import { ESLintUtils } from '@typescript-eslint/utils';
const { getParserServices } = ESLintUtils;
const parserServices = getParserServices(context);
const checker = parserServices.program.getTypeChecker();
ESLint Rule Creation
Provides a utility for creating ESLint rules with a consistent structure and metadata. This is particularly useful for developers creating custom rules for projects that use TypeScript.
import { ESLintUtils } from '@typescript-eslint/utils';
const createRule = ESLintUtils.RuleCreator(name => `https://example.com/rule/${name}`);
const myRule = createRule({
name: 'my-custom-rule',
meta: { /* rule metadata */ },
defaultOptions: [],
create(context) { /* rule implementation */ }
});
This package provides a set of ESLint rules that help ensure proper import/export syntax and order. While it focuses on module syntax, it doesn't offer TypeScript-specific utilities or type checking capabilities like @typescript-eslint/utils.
Similar to @typescript-eslint/utils, eslint-utils provides utility functions for working with ESLint and AST nodes. However, it is not specifically tailored for TypeScript, lacking direct integrations with TypeScript's type system and parser.
@typescript-eslint/utils
Utilities for working with TypeScript + ESLint together.
š See https://typescript-eslint.io/packages/utils for documentation on this package.
See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code.
FAQs
Utilities for working with TypeScript + ESLint together
We found that @typescript-eslint/utils 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.