This repository has been archived on 2024-09-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
front/node_modules/eslint-plugin-react/lib/util/getTokenBeforeClosingBracket.js
2024-09-18 13:34:19 -03:00

17 lines
428 B
JavaScript

'use strict';
/**
* Find the token before the closing bracket.
* @param {ASTNode} node - The JSX element node.
* @returns {Token} The token before the closing bracket.
*/
function getTokenBeforeClosingBracket(node) {
const attributes = node.attributes;
if (!attributes || attributes.length === 0) {
return node.name;
}
return attributes[attributes.length - 1];
}
module.exports = getTokenBeforeClosingBracket;