first commit
This commit is contained in:
16
node_modules/eslint-plugin-react/lib/util/getTokenBeforeClosingBracket.js
generated
vendored
Normal file
16
node_modules/eslint-plugin-react/lib/util/getTokenBeforeClosingBracket.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
'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;
|
||||
Reference in New Issue
Block a user