Module rslint_core::util[][src]

Expand description

General utilities to make linting easier.

Traits

Extensions to nodes and tokens used for stylistic linting which cares about trivia (whitespace)

Functions

Check if this is either a Call expression with the callee of name, or if this is a New expression with a callee of name. e.g. Boolean() or new Boolean()

Find the best match for a string in an iterator of strings based on levenshtein distance.

Expands an assignment to the returned value, e.g. foo += 5 -> foo + 5, foo = 6 -> 6

Check whether an expr is constant and is always falsey or truthy

Whether this is a predefined constant identifier such as NaN and undefined

Find the Levenshtein distance between two strings

Get the combined range of multiple nodes.

Get the first enclosing function of a node, this does not consider if the node itself is a function.

Attempt to check if a simple expression is always truthy or always falsey.

Issue more context around the effects of a constant condition on a node.

Compare two lists of tokens by comparing their underlying string value.

Get the range represented by a list of tokens.