Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
eslint-utils
Advanced tools
Package description
The eslint-utils package provides utility functions for developers working with ESLint, a static code analysis tool for identifying problematic patterns in JavaScript code. It offers a set of APIs that can be used to manipulate and query the abstract syntax tree (AST) generated by ESLint, making it easier to create custom rules and analyze code.
AST Utilities
Provides functions to interact with the AST, such as finding variables, their references, and their definitions within the code.
{"findVariable": "function (initializer) { return getVariableByName(initializer, 'myVariable'); }"}
Reference Utilities
Offers methods to determine if a variable is being used in the code, which can help in identifying unused variables and potential bugs.
{"isUsedVariable": "function (variable) { return isUsedVariable(variable); }"}
Scope Analysis
Allows for analysis of variable scope, which can be used to ensure that variables are declared and used within the correct scope.
{"getInnermostScope": "function (scope, node) { return getInnermostScope(scope, node); }"}
ESLint is the core package that eslint-utils is designed to complement. It provides the framework for static code analysis, including parsing code into an AST, managing rules, and reporting issues. eslint-utils offers additional utilities that can be used within the context of ESLint's ecosystem.
babel-eslint is a parser that allows ESLint to run on source code that is transpiled with Babel. While it does not provide utility functions like eslint-utils, it serves a similar purpose in extending the capabilities of ESLint to work with a wider range of JavaScript syntax.
typescript-eslint is a plugin that enables ESLint to support TypeScript, a superset of JavaScript. It includes a parser and a set of rules specifically designed for TypeScript code. Like eslint-utils, it extends the functionality of ESLint but is focused on TypeScript rather than providing general utility functions.
Readme
This package provides utility functions and classes for make ESLint custom rules.
For examples:
See documentation.
See releases.
Welcome contributing!
Please use GitHub's Issues/PRs.
npm test
runs tests and measures coverage.npm run clean
removes the coverage result of npm test
command.npm run coverage
shows the coverage result of the last npm test
command.npm run lint
runs ESLint.npm run watch
runs tests on each file change.FAQs
Utilities for ESLint plugins.
The npm package eslint-utils receives a total of 22,841,164 weekly downloads. As such, eslint-utils popularity was classified as popular.
We found that eslint-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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 Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.