@salesforce-ux/eslint-plugin-slds
Version:
ESLint plugin provides custom linting rules specifically built for Salesforce Lightning Design System 2 (SLDS 2 beta)
80 lines (79 loc) • 2.37 kB
TypeScript
/**
* @param {TagNode | ScriptTagNode | StyleTagNode} node
* @param {string} key
* @returns {AttributeNode | undefined}
*/
declare function findAttr(node: any, key: any): any;
/**
* Checks whether a node's attributes is empty or not.
* @param {TagNode | ScriptTagNode | StyleTagNode} node
* @returns {boolean}
*/
declare function isAttributesEmpty(node: any): boolean;
/**
* Checks whether a node's all tokens are on the same line or not.
* @param {AnyNode} node A node to check
* @returns {boolean} `true` if a node's tokens are on the same line, otherwise `false`.
*/
declare function isNodeTokensOnSameLine(node: any): boolean;
/**
*
* @param {Range} rangeA
* @param {Range} rangeB
* @returns {boolean}
*/
declare function isRangesOverlap(rangeA: any, rangeB: any): boolean;
/**
* @param {(TextNode | CommentContentNode)['templates']} templates
* @param {Range} range
* @returns {boolean}
*/
declare function isOverlapWithTemplates(templates: any, range: any): any;
/**
*
* @param {TextNode | CommentContentNode} node
* @returns {LineNode[]}
*/
declare function splitToLineNodes(node: any): any[];
/**
* Get location between two nodes.
* @param {BaseNode} before A node placed in before
* @param {BaseNode} after A node placed in after
* @returns {Location} location between two nodes.
*/
declare function getLocBetween(before: any, after: any): {
start: any;
end: any;
};
/**
* @param {AttributeValueNode} node
* @return {boolean}
*/
declare function isExpressionInTemplate(node: any): boolean;
/**
* @param {AnyNode} node
* @returns {node is TagNode}
*/
declare function isTag(node: any): boolean;
/**
* @param {AnyNode} node
* @returns {node is CommentNode}
*/
declare function isComment(node: any): boolean;
/**
* @param {AnyNode} node
* @returns {node is TextNode}
*/
declare function isText(node: any): boolean;
/**
* @param {string} source
* @returns {string[]}
*/
declare function codeToLines(source: any): any;
/**
*
* @param {AnyToken[]} tokens
* @returns {((CommentContentNode | TextNode)['templates'][number])[]}
*/
declare function getTemplateTokens(tokens: any): any[];
export { findAttr, isAttributesEmpty, isNodeTokensOnSameLine, splitToLineNodes, getLocBetween, isExpressionInTemplate, isTag, isComment, isText, isOverlapWithTemplates, codeToLines, isRangesOverlap, getTemplateTokens, };