persona-community-5/.pnpm-store/v3/files/05/6dfb22325477a3bea0224ab2dc4501062edf59663677c96ce19f4cc469fb8e8a6a23ee686db9e5c5a597d5fd0c0741a26b510e6ad2284dd2a2e6cb999b6294
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

27 lines
1.0 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getForStatementHeadLoc = getForStatementHeadLoc;
const eslint_utils_1 = require("@typescript-eslint/utils/eslint-utils");
/**
* Gets the location of the head of the given for statement variant for reporting.
*
* - `for (const foo in bar) expressionOrBlock`
* ^^^^^^^^^^^^^^^^^^^^^^
*
* - `for (const foo of bar) expressionOrBlock`
* ^^^^^^^^^^^^^^^^^^^^^^
*
* - `for await (const foo of bar) expressionOrBlock`
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*
* - `for (let i = 0; i < 10; i++) expressionOrBlock`
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*/
function getForStatementHeadLoc(sourceCode, node) {
const closingParens = (0, eslint_utils_1.nullThrows)(sourceCode.getTokenBefore(node.body, token => token.value === ')'), 'for statement must have a closing parenthesis.');
return {
start: structuredClone(node.loc.start),
end: structuredClone(closingParens.loc.end),
};
}
//# sourceMappingURL=getForStatementHeadLoc.js.map