Files
FrenoCorp/node_modules/eslint-plugin-solid/dist/rules/jsx-uses-vars.js
Michael Freno 7c684a42cc FRE-600: Fix code review blockers
- Consolidated duplicate UndoManagers to single instance
- Fixed connection promise to only resolve on 'connected' status
- Fixed WebSocketProvider import (WebsocketProvider)
- Added proper doc.destroy() cleanup
- Renamed isPresenceInitialized property to avoid conflict

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-25 00:08:01 -04:00

47 lines
1.7 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const createRule = utils_1.ESLintUtils.RuleCreator.withoutDocs;
exports.default = createRule({
meta: {
type: "problem",
docs: {
description: "Prevent variables used in JSX from being marked as unused.",
url: "https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/jsx-uses-vars.md",
},
schema: [],
messages: {},
},
defaultOptions: [],
create(context) {
return {
JSXOpeningElement(node) {
let parent;
switch (node.name.type) {
case "JSXNamespacedName":
return;
case "JSXIdentifier":
context.markVariableAsUsed(node.name.name);
break;
case "JSXMemberExpression":
parent = node.name.object;
while (parent?.type === "JSXMemberExpression") {
parent = parent.object;
}
if (parent.type === "JSXIdentifier") {
context.markVariableAsUsed(parent.name);
}
break;
}
},
"JSXAttribute > JSXNamespacedName": (node) => {
if (node.namespace?.type === "JSXIdentifier" &&
node.namespace.name === "use" &&
node.name?.type === "JSXIdentifier") {
context.markVariableAsUsed(node.name.name);
}
},
};
},
});