Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 2, 2024 via pnpm

jsx-ast-utils 3.3.5

AST utility module for statically analyzing JSX
Package summary
Share
0
issues
1
license
70
MIT
Package created
9 Jun 2016
Version published
29 Jul 2023
Maintainers
3
Total deps
70
Direct deps
4
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
70 Packages, Including:
array-buffer-byte-length@1.0.1
array-includes@3.1.8
array.prototype.flat@1.3.2
arraybuffer.prototype.slice@1.0.3
available-typed-arrays@1.0.7
call-bind@1.0.7
data-view-buffer@1.0.1
data-view-byte-length@1.0.1
data-view-byte-offset@1.0.0
define-data-property@1.1.4
define-properties@1.2.1
es-abstract@1.23.3
es-define-property@1.0.0
es-errors@1.3.0
es-object-atoms@1.0.0
es-set-tostringtag@2.0.3
es-shim-unscopables@1.0.2
es-to-primitive@1.2.1
for-each@0.3.3
function-bind@1.1.2
function.prototype.name@1.1.6
functions-have-names@1.2.3
get-intrinsic@1.2.4
get-symbol-description@1.0.2
globalthis@1.0.4
gopd@1.0.1
has-bigints@1.0.2
has-property-descriptors@1.0.2
has-proto@1.0.3
has-symbols@1.0.3
has-tostringtag@1.0.2
hasown@2.0.2
internal-slot@1.0.7
is-array-buffer@3.0.4
is-bigint@1.0.4
is-boolean-object@1.1.2
is-callable@1.2.7
is-data-view@1.0.1
is-date-object@1.0.5
is-negative-zero@2.0.3
is-number-object@1.0.7
is-regex@1.1.4
is-shared-array-buffer@1.0.3
is-string@1.0.7
is-symbol@1.0.4
is-typed-array@1.1.13
is-weakref@1.0.2
isarray@2.0.5
jsx-ast-utils@3.3.5
object-inspect@1.13.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

4
All Dependencies CSV
β“˜ This is a list of jsx-ast-utils 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
array-includes3.1.825.71 kBMIT
prod
array.prototype.flat1.3.26.64 kBMIT
prod
object.assign4.1.518.68 kBMIT
prod
object.values1.2.030.78 kBMIT
prod

Visualizations

Frequently Asked Questions

What does jsx-ast-utils do?

The jsx-ast-utils package is an Abstract Syntax Tree (AST) utility module, offering the ability to perform static analysis of JSX syntax. Developed mainly as a significant tool in the creation of linting rules for JSX code, it can be beneficial in writing and implementing novel rules to perform static analysis of JSX.

How do you use jsx-ast-utils?

To utilize jsx-ast-utils in your project, you'll first need to install it. This can be easily accomplished by running the npm install command npm i jsx-ast-utils --save in your terminal. Following successful installation, you can start using it for various purposes. For instance, when creating a linting rule for JSX, you can use the hasProp function to check whether a specific prop exists as an attribute on a JSX element node. Here's an ESLint rule example:

import { hasProp } from 'jsx-ast-utils';

module.exports = context => ({
  JSXOpeningElement: node => {
    const onChange = hasProp(node.attributes, 'onChange');

    if (onChange) {
      context.report({
        node,
        message: `No onChange!`
      });
    }
  }
});

In this example, the JSXOpeningElement is being expected to have an 'onChange' prop. If such a prop isn't found, an error message is triggered.

Where are the jsx-ast-utils docs?

The jsx-ast-utils documentations and references can be found on the package's repository on GitHub. They provide a detailed explanation of the functions and how each can be used. Information about the JSX spec is available at JSX spec and for the JS spec at JS spec.

They provide in-depth details and examples for core API functions, including but not limited to hasProp, hasAnyProp, hasEveryProp and getProp. They also detail the return types and parameters required by each function. This can be a valuable resource for developers looking to take advantage of this utility module's features.