@zayne-labs/eslint-config 0.11.5 → 0.11.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"src-nCsOdMZJ.js","names":["ref","ref","ref","ref","ref","ref","ref","callExpr","ref","noEmptyEffect","noAdjustStateOnPropChange","noResetAllStateOnPropChange","noEventHandler","noPassLiveStateToParent","noPassDataToParent","noPassRefToParent","noInitializeState","noChainStateUpdates","noDerivedState"],"sources":["../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.8.1_eslint@9.39.2_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/util/ast.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.8.1_eslint@9.39.2_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/util/react.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.8.1_eslint@9.39.2_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/rules/no-empty-effect.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.8.1_eslint@9.39.2_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/rules/no-adjust-state-on-prop-change.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.8.1_eslint@9.39.2_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/rules/no-reset-all-state-on-prop-change.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.8.1_eslint@9.39.2_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/rules/no-event-handler.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.8.1_eslint@9.39.2_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/rules/no-pass-live-state-to-parent.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.8.1_eslint@9.39.2_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/rules/no-initialize-state.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.8.1_eslint@9.39.2_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/rules/no-chain-state-updates.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.8.1_eslint@9.39.2_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/rules/no-derived-state.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.8.1_eslint@9.39.2_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/rules/no-pass-data-to-parent.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.8.1_eslint@9.39.2_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/rules/no-pass-ref-to-parent.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.8.1_eslint@9.39.2_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/index.js"],"sourcesContent":["/**\n * @import {Scope,Rule} from 'eslint'\n */\n\n/**\n * Get all references that ultimately flow into `ref`.\n *\n * @param {Rule.RuleContext} context\n * @param {Scope.Reference} ref\n * @param {\"leaf\" | \"all\"} [mode=\"all\"]\n * @param {Set<Scope.Reference>} visited\n *\n * @returns {Scope.Reference[]}\n */\nexport const getUpstreamRefs = (\n context,\n ref,\n mode = \"all\",\n visited = new Set(),\n) => {\n // TODO: Probably best to track this here but let the downstream `traverse()` handle it?\n // Especially if we can simplify/eliminate `getDownstreamRefs()` -> `findDownstreamNodes()` from the path.\n visited.add(ref);\n\n const upstreamRefs = ref.resolved?.defs\n // We have no analytical use for import statements; terminate at the previous reference (actually using the imported thing).\n .filter((def) => def.type !== \"ImportBinding\")\n // Don't traverse parameter definitions.\n // Their definition node is the function, so downstream would include the whole function body.\n .filter((def) => def.type !== \"Parameter\")\n // `def.node.init` is for ArrowFunctionExpression, VariableDeclarator, (etc?).\n // `def.node.body` is for FunctionDeclaration.\n .map((def) => def.node.init ?? def.node.body)\n .filter(Boolean)\n .flatMap((node) => getDownstreamRefs(context, node))\n // Prevent infinite recursion from circular references.\n .filter((ref) => !visited.has(ref))\n .flatMap((ref) => getUpstreamRefs(context, ref, mode, visited));\n\n const isLeafRef =\n // Unresolvable references (e.g. missing imports, misconfigured globals).\n upstreamRefs === undefined ||\n // Actually terminal references (e.g. parameters, imports, globals).\n upstreamRefs.length === 0;\n\n return mode === \"leaf\"\n ? isLeafRef\n ? [ref]\n : upstreamRefs\n : [ref].concat(upstreamRefs ?? []);\n // We don't care to analyze non-prop parameters.\n // They are local to the function and essentially duplicate the argument reference.\n // NOTE: Okay to return them while we use `some()` on the result.\n // .filter(\n // (ref) =>\n // isProp(ref) ||\n // !ref.resolved ||\n // ref.resolved.defs.some((def) => def.type !== \"Parameter\"),\n // )\n};\n\n/**\n * Descend the AST from `node`, calling `visit` on each node.\n *\n * @param {Rule.RuleContext} context\n * @param {Rule.Node} node\n * @param {(node: Rule.Node) => void} visit\n * @param {Set<Rule.Node>} visited\n */\nexport const descend = (context, node, visit, visited = new Set()) => {\n if (visited.has(node)) {\n return;\n }\n visit(node);\n visited.add(node);\n\n (context.sourceCode.visitorKeys[node.type] || [])\n .map((key) => node[key])\n // Some `visitorKeys` are optional, e.g. `IfStatement.alternate`.\n .filter(Boolean)\n // Can be an array, like `CallExpression.arguments`\n .flatMap((child) => (Array.isArray(child) ? child : [child]))\n // Can rarely be `null`, e.g. `ArrayPattern.elements[1]` when an element is skipped - `const [a, , b] = arr`\n .filter(Boolean)\n // Check it's a valid AST node\n .filter((child) => typeof child.type === \"string\")\n .forEach((child) => descend(context, child, visit, visited));\n};\n\n/**\n * @param {Rule.RuleContext} context\n * @param {Rule.Node} topNode\n * @param {string} type\n */\nexport const findDownstreamNodes = (context, topNode, type) => {\n const nodes = [];\n descend(context, topNode, (node) => {\n if (node.type === type) {\n nodes.push(node);\n }\n });\n return nodes;\n};\n\n/**\n * @param {Rule.RuleContext} context\n * @param {Rule.Node} node\n */\nexport const getDownstreamRefs = (context, node) =>\n findDownstreamNodes(context, node, \"Identifier\")\n .map((identifier) => getRef(context, identifier))\n .filter(Boolean);\n\n/**\n * @param {Scope.Reference} ref\n * @param {Rule.Node} current\n * @returns {Rule.Node | undefined}\n */\nexport const getCallExpr = (ref, current = ref.identifier.parent) => {\n if (current.type === \"CallExpression\") {\n // We've reached the top - confirm that the ref is the (eventual) callee, as opposed to an argument.\n let node = ref.identifier;\n while (node.parent.type === \"MemberExpression\") {\n node = node.parent;\n }\n\n if (current.callee === node) {\n return current;\n }\n }\n\n if (current.type === \"MemberExpression\") {\n return getCallExpr(ref, current.parent);\n }\n\n return undefined;\n};\n\n/**\n * When using this, we assume that args passed to the derived function are always eventually passed to underlying functions.\n * Which they may not be. Would be better to trace the actual flow of values, but that's complex. We'll start with this for now.\n *\n * @param {Rule.RuleContext} context\n * @param {Scope.Reference} ref\n * @param {\"leaf\" | \"all\"} [mode=\"all\"] Whether to return all refs, or only leaf refs. Note that \"all\" includes `ref` itself.\n * @returns {Rule.Node[]}\n */\nexport const getArgsUpstreamRefs = (context, ref, mode) =>\n getUpstreamRefs(context, ref, mode)\n .map((ref) => getCallExpr(ref))\n .filter(Boolean)\n .flatMap((callExpr) => callExpr.arguments)\n .flatMap((arg) => getDownstreamRefs(context, arg))\n .flatMap((ref) => getUpstreamRefs(context, ref));\n\n/**\n * Walks up the AST until `within` (returns `true`) or finding any of (returns `false`):\n * - An `async` function\n * - A function declaration, which may be called at an arbitrary later time.\n * - While we return false for *this* call, we may still return true for a call to a function containing this call. Combined with `getUpstreamRefs()`, it will still flag calls to the containing function.\n * - A function passed as a callback to another function or `new` - event handler, `setTimeout`, `Promise.then()` `new ResizeObserver()`, etc.\n *\n * Inspired by https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-effect\n *\n * @param {Rule.Node} node\n * @param {Rule.Node} within\n * @returns {boolean}\n */\nexport const isSynchronous = (node, within) => {\n if (node == within) {\n // Reached the top without finding any blocking conditions\n return true;\n } else if (\n // Obviously not immediate if async. I think this never occurs in isolation from the below conditions? But just in case for now.\n node.async ||\n // Inside a named or anonymous function that may be called later, either as a callback or by the developer.\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"ArrowFunctionExpression\"\n ) {\n return false;\n } else {\n // Keep going up\n return isSynchronous(node.parent, within);\n }\n};\n\n/**\n * @param {Rule.RuleContext} context\n * @param {Rule.Node} identifier\n *\n * @returns {Scope.Reference | undefined}\n */\nexport const getRef = (context, identifier) =>\n context.sourceCode\n .getScope(identifier)\n ?.references.find((ref) => ref.identifier == identifier);\n\n/**\n * @param {Rule.RuleContext} context\n * @param {Scope.Reference} ref\n * @param {(ref: Scope.Reference) => boolean} predicate\n * @returns {boolean} Whether this reference eventually calls a function matching the given predicate.\n */\nexport const isEventualCallTo = (context, ref, predicate) =>\n getCallExpr(ref) !== undefined &&\n getUpstreamRefs(context, ref).some(predicate);\n","import { getDownstreamRefs, getUpstreamRefs, isEventualCallTo } from \"./ast.js\";\n\n/**\n * @import {Scope,Rule} from 'eslint'\n */\n\n/**\n * @param {Rule.Node} node\n * @returns {boolean}\n */\nexport const isReactFunctionalComponent = (node) =>\n (node.type === \"FunctionDeclaration\" ||\n (node.type === \"VariableDeclarator\" &&\n (node.init.type === \"ArrowFunctionExpression\" ||\n node.init.type === \"CallExpression\"))) &&\n node.id.type === \"Identifier\" &&\n node.id.name[0].toUpperCase() === node.id.name[0];\n\n/**\n * Excludes known pure HOCs like `memo` and `forwardRef`.\n * Basically this is meant to detect custom HOCs that may have side effects, particularly when using their props.\n *\n * TODO: Will not detect when the component is defined normally and then exported wrapped in an HOC.\n * e.g. `const MyComponent = (props) => {...}; export default memo(MyComponent);`\n *\n * @param {Rule.Node} node\n * @returns {boolean}\n */\nexport const isReactFunctionalHOC = (node) =>\n node.type === \"VariableDeclarator\" &&\n node.init &&\n node.init.type === \"CallExpression\" &&\n node.init.callee.type === \"Identifier\" &&\n ![\"memo\", \"forwardRef\"].includes(node.init.callee.name) &&\n node.init.arguments.length > 0 &&\n (node.init.arguments[0].type === \"ArrowFunctionExpression\" ||\n node.init.arguments[0].type === \"FunctionExpression\") &&\n node.id.type === \"Identifier\" &&\n node.id.name[0].toUpperCase() === node.id.name[0];\n\n/**\n * @param {Rule.Node} node\n * @returns {boolean}\n */\nexport const isCustomHook = (node) =>\n (node.type === \"FunctionDeclaration\" ||\n (node.type === \"VariableDeclarator\" &&\n node.init &&\n (node.init.type === \"ArrowFunctionExpression\" ||\n node.init.type === \"FunctionExpression\"))) &&\n node.id.type === \"Identifier\" &&\n node.id.name.startsWith(\"use\") &&\n node.id.name[3] === node.id.name[3].toUpperCase();\n\n/**\n * @param {Scope.Reference} ref\n * @returns {boolean}\n */\nexport const isUseState = (ref) =>\n (ref.identifier.type === \"Identifier\" &&\n ref.identifier.name === \"useState\") ||\n (ref.identifier.parent.type === \"MemberExpression\" &&\n ref.identifier.parent.object.name === \"React\" &&\n ref.identifier.parent.property.name === \"useState\");\n\n/**\n * @param {Scope.Reference} ref\n * @returns {boolean}\n */\nexport const isState = (ref) =>\n ref.resolved?.defs.some(\n (def) =>\n def.node.type === \"VariableDeclarator\" &&\n def.node.id.type === \"ArrayPattern\" &&\n (def.node.id.elements.length === 1 ||\n def.node.id.elements.length === 2) &&\n def.node.id.elements[0]?.type === \"Identifier\" &&\n def.node.id.elements[0].name === ref.identifier.name,\n );\n\n/**\n * @param {Scope.Reference} ref\n * @returns {boolean}\n */\nexport const isStateSetter = (ref) =>\n ref.resolved?.defs.some(\n (def) =>\n def.node.type === \"VariableDeclarator\" &&\n def.node.id.type === \"ArrayPattern\" &&\n def.node.id.elements.length === 2 &&\n def.node.id.elements[1]?.type === \"Identifier\" &&\n def.node.id.elements[1].name === ref.identifier.name,\n );\n\n/**\n * Returns false for props of HOCs (e.g. `withRouter`) because they usually have side effects.\n *\n * @param {Scope.Reference} ref\n * @returns {boolean}\n */\nexport const isProp = (ref) =>\n ref.resolved?.defs.some((def) => {\n const declaringNode =\n def.node.type === \"ArrowFunctionExpression\"\n ? def.node.parent.type === \"CallExpression\"\n ? def.node.parent.parent\n : def.node.parent\n : def.node;\n return (\n def.type === \"Parameter\" &&\n ((isReactFunctionalComponent(declaringNode) &&\n !isReactFunctionalHOC(declaringNode)) ||\n isCustomHook(declaringNode))\n );\n });\n\n/**\n * @param {Scope.Reference} ref\n * @returns {boolean}\n */\nexport const isConstant = (ref) =>\n (ref.resolved?.defs ?? []).some(\n (def) =>\n (def.node.type === \"VariableDeclarator\" &&\n def.node.init?.type === \"Literal\") ||\n def.node.init?.type === \"TemplateLiteral\" ||\n def.node.init?.type === \"ArrayExpression\" ||\n def.node.init?.type === \"ObjectExpression\",\n );\n\n/**\n * @param {Scope.Reference} ref\n * @returns {boolean}\n */\nexport const isUseRef = (ref) =>\n (ref.identifier.type === \"Identifier\" && ref.identifier.name === \"useRef\") ||\n (ref.identifier.parent.type === \"MemberExpression\" &&\n ref.identifier.parent.object.name === \"React\" &&\n ref.identifier.parent.property.name === \"useRef\");\n\n/**\n * @param {Scope.Reference} ref\n * @returns {boolean}\n */\nexport const isRef = (ref) =>\n ref.resolved?.defs.some(\n (def) =>\n def.node.type === \"VariableDeclarator\" &&\n def.node.init?.type === \"CallExpression\" &&\n ((def.node.init.callee.type === \"Identifier\" &&\n def.node.init.callee.name === \"useRef\") ||\n (def.node.init.callee.type === \"MemberExpression\" &&\n def.node.init.callee.object.name === \"React\" &&\n def.node.init.callee.property.name === \"useRef\")),\n );\n\n/**\n * Whether the reference's `current` property is being accessed.\n * Heuristic for whether the reference is a React ref object.\n * Because we don't always have access to the `useRef` call itself.\n * For example when receiving a ref from props.\n *\n * @param {Scope.Reference} ref\n * @returns {boolean}\n */\nexport const isRefCurrent = (ref) =>\n ref.identifier.parent.type === \"MemberExpression\" &&\n ref.identifier.parent.property.type === \"Identifier\" &&\n ref.identifier.parent.property.name === \"current\";\n\n/**\n * Does not include `useLayoutEffect`.\n * When used correctly, it interacts with the DOM = external system = (probably) valid effect.\n * When used incorrectly, it's probably too difficult to accurately analyze anyway.\n *\n * @param {Rule.Node} node\n * @returns {boolean}\n */\nexport const isUseEffect = (node) =>\n node.type === \"CallExpression\" &&\n ((node.callee.type === \"Identifier\" && node.callee.name === \"useEffect\") ||\n (node.callee.type === \"MemberExpression\" &&\n node.callee.object.name === \"React\" &&\n node.callee.property.name === \"useEffect\"));\n\n/**\n * @param {Rule.Node} node - The `useEffect` `CallExpression` node\n * @returns {Rule.Node | undefined}\n */\nexport const getEffectFn = (node) => {\n const effectFn = node.arguments[0];\n if (\n effectFn?.type !== \"ArrowFunctionExpression\" &&\n effectFn?.type !== \"FunctionExpression\"\n ) {\n return undefined;\n }\n\n return effectFn;\n};\n\n/**\n * @param {Rule.RuleContext} context\n * @param {Rule.Node} node - The `useEffect` `CallExpression` node\n * @returns {Scope.Reference[] | undefined}\n */\nexport const getEffectFnRefs = (context, node) => {\n const effectFn = getEffectFn(node);\n return effectFn ? getDownstreamRefs(context, effectFn) : undefined;\n};\n\n/**\n * @param {Rule.RuleContext} context\n * @param {Rule.Node} node - The `useEffect` `CallExpression` node\n * @returns {Scope.Reference[] | undefined}\n */\nexport function getEffectDepsRefs(context, node) {\n const depsArr = node.arguments[1];\n if (depsArr?.type !== \"ArrayExpression\") {\n return undefined;\n }\n\n return getDownstreamRefs(context, depsArr);\n}\n\n/**\n * @param {Rule.RuleContext} context\n * @param {Scope.Reference} ref\n * @returns {boolean} Whether this reference eventually calls a state setter function or a method on state.\n */\nexport const callsStateSetter = (context, ref) =>\n isEventualCallTo(context, ref, isStateSetter);\n\n/**\n * @param {Rule.RuleContext} context\n * @param {Scope.Reference} ref\n * @returns {boolean} Whether this reference eventually calls a prop function or a method on a prop.\n */\nexport const callsProp = (context, ref) =>\n isEventualCallTo(context, ref, isProp);\n\n/**\n * @param {Rule.RuleContext} context\n * @param {Scope.Reference} ref\n * @returns {boolean} Whether this reference eventually calls a method on a ref.\n */\nexport const callsRef = (context, ref) =>\n isEventualCallTo(context, ref, (ref) => isRefCurrent(ref) || isRef(ref));\n\n/**\n * @param context {Rule.RuleContext}\n * @param {Scope.Reference} ref\n * @returns {Rule.Node | undefined} The `VariableDeclarator` node of the `useState` call.\n */\nexport const getUseStateDecl = (context, ref) => {\n let node = getUpstreamRefs(context, ref).find((ref) =>\n isUseState(ref),\n )?.identifier;\n while (node && node.type !== \"VariableDeclarator\") {\n node = node.parent;\n }\n return node;\n};\n\n/**\n * While it *could* be an anti-pattern or unnecessary, effects *are* meant to synchronize systems.\n * So we presume that a \"subscription effect\" is usually valid, or at least may be more readable.\n *\n * TODO: We might be able to use this more granularly, e.g. ignore state setters inside a subscription effect,\n * instead of ignoring the whole effect...? But it'd have to be more complicated, like also ignore the same state setters called in the body.\n *\n * @param {Rule.Node} node - The `useEffect` `CallExpression` node\n * @returns {boolean}\n */\nexport const hasCleanup = (node) => {\n const effectFn = node.arguments[0];\n return (\n (effectFn.type === \"ArrowFunctionExpression\" ||\n effectFn.type === \"FunctionExpression\") &&\n effectFn.body.type === \"BlockStatement\" &&\n effectFn.body.body.some(\n (stmt) => stmt.type === \"ReturnStatement\" && stmt.argument,\n )\n );\n};\n","import { isUseEffect, getEffectFnRefs } from \"../util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow empty effects.\",\n },\n schema: [],\n messages: {\n avoidEmptyEffect: \"This effect is empty and could be removed.\",\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n if (!isUseEffect(node)) return;\n\n if (\n node.arguments?.length === 0 ||\n getEffectFnRefs(context, node)?.length === 0\n ) {\n // Hopefully it's obvious the effect can be removed.\n // More a follow-up for once they fix/remove other issues.\n context.report({\n node,\n messageId: \"avoidEmptyEffect\",\n });\n }\n },\n }),\n};\n","import {\n getArgsUpstreamRefs,\n getCallExpr,\n getUpstreamRefs,\n isSynchronous,\n} from \"../util/ast.js\";\nimport {\n getEffectDepsRefs,\n getEffectFn,\n getEffectFnRefs,\n isProp,\n callsStateSetter,\n isUseEffect,\n} from \"../util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow adjusting state in an effect when a prop changes.\",\n url: \"https://react.dev/learn/you-might-not-need-an-effect#adjusting-some-state-when-a-prop-changes\",\n },\n schema: [],\n messages: {\n avoidAdjustingStateWhenAPropChanges:\n \"Avoid adjusting state when a prop changes. Instead, adjust the state directly during render, or refactor your state to avoid this need entirely.\",\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n if (!isUseEffect(node)) return;\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n const isSomeDepsProps = depsRefs\n .flatMap((ref) => getUpstreamRefs(context, ref))\n .some((ref) => isProp(ref));\n\n effectFnRefs\n .filter((ref) => callsStateSetter(context, ref))\n .filter((ref) => isSynchronous(ref.identifier, getEffectFn(node)))\n .forEach((ref) => {\n const callExpr = getCallExpr(ref);\n\n // Avoid overlap with no-derived-state\n const isSomeArgsProps = getArgsUpstreamRefs(context, ref).some(\n (ref) => isProp(ref),\n );\n\n if (isSomeDepsProps && !isSomeArgsProps) {\n context.report({\n node: callExpr,\n messageId: \"avoidAdjustingStateWhenAPropChanges\",\n });\n }\n });\n },\n }),\n};\n","import {\n getCallExpr,\n getDownstreamRefs,\n getUpstreamRefs,\n} from \"../util/ast.js\";\nimport {\n getEffectFnRefs,\n getEffectDepsRefs,\n callsStateSetter,\n isProp,\n getUseStateDecl,\n isReactFunctionalComponent,\n isReactFunctionalHOC,\n isCustomHook,\n isState,\n isUseEffect,\n} from \"../util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description:\n \"Disallow resetting all state in an effect when a prop changes.\",\n url: \"https://react.dev/learn/you-might-not-need-an-effect#resetting-all-state-when-a-prop-changes\",\n },\n schema: [],\n messages: {\n avoidResettingAllStateWhenAPropChanges:\n 'Avoid resetting all state when a prop changes. If \"{{prop}}\" is a key, pass it as `key` instead so React will reset the component.',\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n if (!isUseEffect(node)) return;\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n // Skip custom hooks because they can't receive `key` like components can.\n const containingNode = findContainingNode(node);\n if (containingNode && isCustomHook(containingNode)) return;\n\n const propUsedToResetAllState = findPropUsedToResetAllState(\n context,\n effectFnRefs,\n depsRefs,\n node,\n );\n\n if (propUsedToResetAllState) {\n context.report({\n node: node,\n messageId: \"avoidResettingAllStateWhenAPropChanges\",\n data: { prop: propUsedToResetAllState.identifier.name },\n });\n }\n },\n }),\n};\n\nconst findPropUsedToResetAllState = (\n context,\n effectFnRefs,\n depsRefs,\n useEffectNode,\n) => {\n const stateSetterRefs = effectFnRefs.filter((ref) =>\n callsStateSetter(context, ref),\n );\n\n const isAllStateReset =\n stateSetterRefs.length > 0 &&\n stateSetterRefs.every((ref) => isSetStateToInitialValue(context, ref)) &&\n stateSetterRefs.length ===\n countUseStates(context, findContainingNode(useEffectNode));\n\n return isAllStateReset\n ? depsRefs\n .flatMap((ref) => getUpstreamRefs(context, ref))\n .find((ref) => isProp(ref))\n : undefined;\n};\n\nconst isSetStateToInitialValue = (context, setterRef) => {\n const setStateToValue = getCallExpr(setterRef).arguments[0];\n const stateInitialValue = getUseStateDecl(context, setterRef).init\n .arguments[0];\n\n // `useState()` (with no args) defaults to `undefined`,\n // so ommitting the arg is equivalent to passing `undefined`.\n // Technically this would false positive if they shadowed\n // `undefined` in only one of the scopes (only possible via `var`),\n // but I hope no one would do that.\n const isUndefined = (node) => node === undefined || node.name === \"undefined\";\n if (isUndefined(setStateToValue) && isUndefined(stateInitialValue)) {\n return true;\n }\n\n // `sourceCode.getText()` returns the entire file when passed null/undefined - let's short circuit that\n if (setStateToValue === null && stateInitialValue === null) {\n return true;\n } else if (\n (setStateToValue && !stateInitialValue) ||\n (!setStateToValue && stateInitialValue)\n ) {\n return false;\n }\n\n // TODO: This is one of the few times we compare just the immediate nodes,\n // not upstream variables - that seems pretty complicated here?\n // At the least, upstream functions would have to return literals for us to consider too, not just variables...\n return (\n context.sourceCode.getText(setStateToValue) ===\n context.sourceCode.getText(stateInitialValue)\n );\n};\n\nconst countUseStates = (context, componentNode) => {\n if (!componentNode) {\n return 0;\n }\n\n return getDownstreamRefs(context, componentNode).filter((ref) => isState(ref))\n .length;\n};\n\n// Returns the component or custom hook that contains the `useEffect` node.\n// WARNING: Per the `isReactFunctionalComponent` etc. internals, this will return undefined for some non-idiomatic component definitions.\n// e.g. `function buildComponent(arg1, arg2) { return <div />; }`\n// Not sure we can account for that without introducing false positives, and those are rare and arguably bad practice.\nconst findContainingNode = (node) => {\n if (!node) {\n return undefined;\n } else if (\n isReactFunctionalComponent(node) ||\n isReactFunctionalHOC(node) ||\n isCustomHook(node)\n ) {\n return node;\n } else {\n return findContainingNode(node.parent);\n }\n};\n","import {\n findDownstreamNodes,\n getDownstreamRefs,\n getUpstreamRefs,\n} from \"../util/ast.js\";\nimport {\n getEffectFnRefs,\n getEffectDepsRefs,\n hasCleanup,\n isState,\n isUseEffect,\n} from \"../util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow using state and an effect as an event handler.\",\n url: \"https://react.dev/learn/you-might-not-need-an-effect#sharing-logic-between-event-handlers\",\n },\n schema: [],\n messages: {\n avoidEventHandler:\n \"Avoid using state and effects as an event handler. Instead, call the event handling code directly when the event occurs.\",\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n if (!isUseEffect(node) || hasCleanup(node)) return;\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n // TODO: Can we also flag this when the deps are internal, and the body calls internal stuff?\n // That'd overlap with other rules though... maybe just useRefs?\n\n findDownstreamNodes(context, node, \"IfStatement\")\n .filter((ifNode) => !ifNode.alternate)\n .filter((ifNode) =>\n getDownstreamRefs(context, ifNode.test)\n .flatMap((ref) => getUpstreamRefs(context, ref))\n // TODO: Should flag props too, but maybe with a different message?\n .some((ref) => isState(ref)),\n )\n .forEach((ifNode) => {\n context.report({\n node: ifNode.test,\n messageId: \"avoidEventHandler\",\n });\n });\n },\n }),\n};\n","import {\n getArgsUpstreamRefs,\n getCallExpr,\n isSynchronous,\n} from \"../util/ast.js\";\nimport {\n getEffectFnRefs,\n getEffectDepsRefs,\n callsProp,\n isState,\n isUseEffect,\n getEffectFn,\n} from \"../util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description:\n \"Disallow passing live state to parent components in an effect.\",\n url: \"https://react.dev/learn/you-might-not-need-an-effect#notifying-parent-components-about-state-changes\",\n },\n schema: [],\n messages: {\n avoidPassingLiveStateToParent:\n \"Avoid passing live state to parents in an effect. Instead, lift the state to the parent and pass it down to the child as a prop.\",\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n if (!isUseEffect(node)) return;\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n effectFnRefs\n .filter((ref) => callsProp(context, ref))\n .filter((ref) => isSynchronous(ref.identifier, getEffectFn(node)))\n .forEach((ref) => {\n const callExpr = getCallExpr(ref);\n const isStateInArgs = getArgsUpstreamRefs(context, ref).some((ref) =>\n isState(ref),\n );\n\n if (isStateInArgs) {\n context.report({\n node: callExpr,\n messageId: \"avoidPassingLiveStateToParent\",\n });\n }\n });\n },\n }),\n};\n","import { getCallExpr, isSynchronous } from \"../util/ast.js\";\nimport {\n getEffectDepsRefs,\n getEffectFn,\n getEffectFnRefs,\n getUseStateDecl,\n callsStateSetter,\n isUseEffect,\n} from \"../util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow initializing state in an effect.\",\n url: \"https://tkdodo.eu/blog/avoiding-hydration-mismatches-with-use-sync-external-store\",\n },\n schema: [],\n messages: {\n avoidInitializingState:\n 'Avoid initializing state in an effect. Instead, initialize \"{{state}}\"\\'s `useState()` with \"{{arguments}}\". For SSR hydration, prefer `useSyncExternalStore()`.',\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n if (!isUseEffect(node)) return;\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n // TODO: Should this length check account for the setter in the deps? exhaustive-deps doesn't warn one way or the other\n if (depsRefs.length > 0) return;\n\n effectFnRefs\n .filter((ref) => callsStateSetter(context, ref))\n .filter((ref) => isSynchronous(ref.identifier, getEffectFn(node)))\n .forEach((ref) => {\n const callExpr = getCallExpr(ref);\n const useStateNode = getUseStateDecl(context, ref);\n const stateName = (\n useStateNode.id.elements[0] ?? useStateNode.id.elements[1]\n )?.name;\n const argumentText = callExpr.arguments[0]\n ? context.sourceCode.getText(callExpr.arguments[0])\n : \"undefined\";\n\n context.report({\n node: getCallExpr(ref),\n messageId: \"avoidInitializingState\",\n data: { state: stateName, arguments: argumentText },\n });\n });\n },\n }),\n};\n","import {\n getArgsUpstreamRefs,\n getCallExpr,\n getUpstreamRefs,\n isSynchronous,\n} from \"../util/ast.js\";\nimport {\n getEffectDepsRefs,\n getEffectFnRefs,\n hasCleanup,\n isState,\n callsStateSetter,\n isUseEffect,\n getEffectFn,\n} from \"../util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow chaining state changes in an effect.\",\n url: \"https://react.dev/learn/you-might-not-need-an-effect#chains-of-computations\",\n },\n schema: [],\n messages: {\n avoidChainingStateUpdates:\n \"Avoid chaining state changes. When possible, update all relevant state simultaneously.\",\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n if (!isUseEffect(node) || hasCleanup(node)) return;\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n const isSomeDepsState = depsRefs\n .flatMap((ref) => getUpstreamRefs(context, ref))\n .some((ref) => isState(ref));\n\n effectFnRefs\n .filter((ref) => callsStateSetter(context, ref))\n .filter((ref) => isSynchronous(ref.identifier, getEffectFn(node)))\n .forEach((ref) => {\n const callExpr = getCallExpr(ref);\n\n // Avoid overlap with no-derived-state\n const isSomeArgsState = getArgsUpstreamRefs(context, ref).some(\n (ref) => isState(ref),\n );\n\n if (isSomeDepsState && !isSomeArgsState) {\n context.report({\n node: callExpr,\n messageId: \"avoidChainingStateUpdates\",\n });\n }\n });\n },\n }),\n};\n","import {\n getArgsUpstreamRefs,\n getCallExpr,\n getUpstreamRefs,\n isSynchronous,\n} from \"../util/ast.js\";\nimport {\n getEffectFnRefs,\n getEffectDepsRefs,\n callsStateSetter,\n getUseStateDecl,\n isProp,\n hasCleanup,\n isState,\n isUseEffect,\n getEffectFn,\n} from \"../util/react.js\";\n\n/**\n * @type {import('eslint').Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow storing derived state in an effect.\",\n url: \"https://react.dev/learn/you-might-not-need-an-effect#updating-state-based-on-props-or-state\",\n },\n schema: [],\n messages: {\n avoidDerivedState:\n 'Avoid storing derived state. Compute \"{{state}}\" directly during render, optionally with `useMemo` if it\\'s expensive.',\n avoidSingleSetter:\n 'Avoid storing derived state. \"{{state}}\" is only set here, and thus could be computed directly during render.',\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n if (!isUseEffect(node) || hasCleanup(node)) return;\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n effectFnRefs\n .filter((ref) => callsStateSetter(context, ref))\n .filter((ref) => isSynchronous(ref.identifier, getEffectFn(node)))\n .forEach((ref) => {\n const callExpr = getCallExpr(ref);\n const useStateNode = getUseStateDecl(context, ref);\n const stateName = (\n useStateNode?.id.elements[0] ?? useStateNode?.id.elements[1]\n )?.name;\n\n const argsUpstreamRefs = getArgsUpstreamRefs(context, ref);\n const depsUpstreamRefs = depsRefs.flatMap((ref) =>\n getUpstreamRefs(context, ref),\n );\n const isSomeArgsInternal = argsUpstreamRefs.some(\n (ref) => isState(ref) || isProp(ref),\n );\n\n const isAllArgsInDeps =\n argsUpstreamRefs.length &&\n argsUpstreamRefs.every((argRef) =>\n depsUpstreamRefs.some(\n (depRef) => argRef.resolved == depRef.resolved,\n ),\n );\n const isValueAlwaysInSync = isAllArgsInDeps && countCalls(ref) === 1;\n\n if (isSomeArgsInternal) {\n context.report({\n node: callExpr,\n messageId: \"avoidDerivedState\",\n data: { state: stateName },\n });\n } else if (isValueAlwaysInSync) {\n context.report({\n node: callExpr,\n messageId: \"avoidSingleSetter\",\n data: { state: stateName },\n });\n }\n });\n },\n }),\n};\n\nconst countCalls = (ref) =>\n ref.resolved.references.filter(\n (ref) => ref.identifier.parent.type === \"CallExpression\",\n ).length;\n","import {\n getCallExpr,\n getDownstreamRefs,\n getUpstreamRefs,\n isSynchronous,\n} from \"../util/ast.js\";\nimport {\n getEffectFnRefs,\n getEffectDepsRefs,\n callsProp,\n isConstant,\n isRefCurrent,\n isUseState,\n isUseRef,\n isProp,\n hasCleanup,\n isUseEffect,\n callsRef,\n getEffectFn,\n} from \"../util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow passing data to parents in an effect.\",\n url: \"https://react.dev/learn/you-might-not-need-an-effect#passing-data-to-the-parent\",\n },\n schema: [],\n messages: {\n avoidPassingDataToParent:\n \"Avoid passing data to parents in an effect. Instead, let the parent fetch the data itself and pass it down to the child as a prop.\",\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n if (!isUseEffect(node) || hasCleanup(node)) return;\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n effectFnRefs\n .filter((ref) => callsProp(context, ref))\n .filter((ref) => !callsRef(context, ref))\n .filter((ref) => isSynchronous(ref.identifier, getEffectFn(node)))\n .forEach((ref) => {\n const callExpr = getCallExpr(ref);\n\n const argsUpstreamRefs = getUpstreamRefs(context, ref)\n .map((ref) => getCallExpr(ref))\n .filter(Boolean)\n .flatMap((callExpr) => callExpr.arguments)\n .flatMap((arg) => getDownstreamRefs(context, arg))\n // Leaf because our \"is data\" check is essentially \"is not all this other stuff\",\n // and the \"other stuff\" only works on leaf nodes.\n // Mid-stream nodes are effectively nothing, and so would pass those.\n // TODO: DIYing getArgsUpstreamRefs for that reason.\n .flatMap((ref) => getUpstreamRefs(context, ref, \"leaf\"));\n const isSomeArgsData = argsUpstreamRefs.some(\n (ref) =>\n // TODO: Ideally would use isState and isRef, not the hooks.\n // But because it goes to leaves. Must be some other way?\n !isUseState(ref) &&\n !isProp(ref) &&\n !isUseRef(ref) &&\n !isRefCurrent(ref) &&\n !isConstant(ref),\n );\n\n if (isSomeArgsData) {\n context.report({\n node: callExpr,\n messageId: \"avoidPassingDataToParent\",\n });\n }\n });\n },\n }),\n};\n","import { getArgsUpstreamRefs, getCallExpr } from \"../util/ast.js\";\nimport {\n getEffectFnRefs,\n getEffectDepsRefs,\n callsProp,\n isRef,\n hasCleanup,\n isUseEffect,\n callsRef,\n} from \"../util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description:\n \"Disallow passing refs, or data from callbacks registered on them, to parents in an effect. Use `forwardRef` instead.\",\n url: \"https://react.dev/reference/react/forwardRef\",\n },\n schema: [],\n messages: {\n avoidPassingRefToParent:\n \"Avoid passing refs to parents in an effect. Use `forwardRef` instead.\",\n avoidPropCallbackInRefCallback:\n \"Avoid calling props inside callbacks registered on refs in an effect. Use `forwardRef` to register the callback in the parent instead.\",\n avoidReceivingRefFromParent:\n \"Avoid receiving refs from parents to use in an effect. Use `forwardRef` instead.\",\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n if (!isUseEffect(node) || hasCleanup(node)) return;\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n effectFnRefs\n .filter((ref) => callsProp(context, ref))\n .forEach((ref) => {\n const callExpr = getCallExpr(ref);\n\n const hasRefArg = getArgsUpstreamRefs(context, ref).some((ref) =>\n isRef(ref),\n );\n\n if (hasRefArg) {\n context.report({\n node: callExpr,\n messageId: \"avoidPassingRefToParent\",\n });\n }\n });\n\n effectFnRefs\n .filter((ref) => callsRef(context, ref))\n .forEach((ref) => {\n const callExpr = getCallExpr(ref);\n\n const passesDataToParent = getArgsUpstreamRefs(context, ref).some(\n (ref) => callsProp(context, ref),\n );\n\n if (passesDataToParent) {\n context.report({\n node: callExpr,\n messageId: \"avoidPropCallbackInRefCallback\",\n });\n }\n });\n\n effectFnRefs\n .filter((ref) => callsProp(context, ref) && callsRef(context, ref))\n .forEach((ref) => {\n const callExpr = getCallExpr(ref);\n\n context.report({\n node: callExpr,\n messageId: \"avoidReceivingRefFromParent\",\n });\n });\n },\n }),\n};\n","import noEmptyEffect from \"./rules/no-empty-effect.js\";\nimport noAdjustStateOnPropChange from \"./rules/no-adjust-state-on-prop-change.js\";\nimport noResetAllStateOnPropChange from \"./rules/no-reset-all-state-on-prop-change.js\";\nimport noEventHandler from \"./rules/no-event-handler.js\";\nimport noPassLiveStateToParent from \"./rules/no-pass-live-state-to-parent.js\";\nimport noInitializeState from \"./rules/no-initialize-state.js\";\nimport noChainStateUpdates from \"./rules/no-chain-state-updates.js\";\nimport noDerivedState from \"./rules/no-derived-state.js\";\nimport noPassDataToParent from \"./rules/no-pass-data-to-parent.js\";\nimport noPassRefToParent from \"./rules/no-pass-ref-to-parent.js\";\nimport globals from \"globals\";\n\n/**\n * @type {import(\"eslint\").ESLint.Plugin}\n */\nconst plugin = {\n meta: {\n name: \"react-you-might-not-need-an-effect\",\n },\n configs: {},\n rules: {\n \"no-empty-effect\": noEmptyEffect,\n \"no-adjust-state-on-prop-change\": noAdjustStateOnPropChange,\n \"no-reset-all-state-on-prop-change\": noResetAllStateOnPropChange,\n \"no-event-handler\": noEventHandler,\n \"no-pass-live-state-to-parent\": noPassLiveStateToParent,\n \"no-pass-data-to-parent\": noPassDataToParent,\n \"no-pass-ref-to-parent\": noPassRefToParent,\n \"no-initialize-state\": noInitializeState,\n \"no-chain-state-updates\": noChainStateUpdates,\n \"no-derived-state\": noDerivedState,\n },\n};\n\nconst recommendedRules = Object.keys(plugin.rules).reduce((acc, ruleName) => {\n acc[plugin.meta.name + \"/\" + ruleName] = \"warn\";\n return acc;\n}, {});\nconst languageOptions = {\n globals: {\n // Required so we can resolve global references to their upstream global variables\n ...globals.browser,\n },\n parserOptions: {\n ecmaFeatures: {\n jsx: true,\n },\n },\n};\n\nObject.assign(plugin.configs, {\n // flat config format\n recommended: {\n files: [\"**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}\"],\n plugins: {\n // Object.assign above so we can reference `plugin` here\n [plugin.meta.name]: plugin,\n },\n rules: recommendedRules,\n languageOptions,\n },\n \"legacy-recommended\": {\n plugins: [plugin.meta.name],\n rules: recommendedRules,\n ...languageOptions,\n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B,SAAS,IAAI,CAAC,MAC1D,UAAQ,UAAU,SAASA,MAAI,CACjC,CAGC,SAAQ,OAAO;IACb,MAAM;IACN,WAAW;IACZ,CAAC;IAEJ;AAEJ,eACG,QAAQ,QAAQ,UAAU,SAAS,IAAI,IAAI,SAAS,SAAS,IAAI,CAAC,CAClE,SAAS,QAAQ;GAChB,MAAM,WAAW,YAAY,IAAI;AAEjC,WAAQ,OAAO;IACb,MAAM;IACN,WAAW;IACZ,CAAC;IACF;IAEP;CACF;;;;;;;ACtED,MAAM,SAAS;CACb,MAAM,EACJ,MAAM,sCACP;CACD,SAAS,EAAE;CACX,OAAO;EACL,mBAAmBC;EACnB,kCAAkCC;EAClC,qCAAqCC;EACrC,oBAAoBC;EACpB,gCAAgCC;EAChC,0BAA0BC;EAC1B,yBAAyBC;EACzB,uBAAuBC;EACvB,0BAA0BC;EAC1B,oBAAoBC;EACrB;CACF;AAED,MAAM,mBAAmB,OAAO,KAAK,OAAO,MAAM,CAAC,QAAQ,KAAK,aAAa;AAC3E,KAAI,OAAO,KAAK,OAAO,MAAM,YAAY;AACzC,QAAO;GACN,EAAE,CAAC;AACN,MAAM,kBAAkB;CACtB,SAAS,EAEP,GAAG,QAAQ,SACZ;CACD,eAAe,EACb,cAAc,EACZ,KAAK,MACN,EACF;CACF;AAED,OAAO,OAAO,OAAO,SAAS;CAE5B,aAAa;EACX,OAAO,CAAC,uCAAuC;EAC/C,SAAS,GAEN,OAAO,KAAK,OAAO,QACrB;EACD,OAAO;EACP;EACD;CACD,sBAAsB;EACpB,SAAS,CAAC,OAAO,KAAK,KAAK;EAC3B,OAAO;EACP,GAAG;EACJ;CACF,CAAC;AAEF,kBAAe"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zayne-labs/eslint-config",
3
3
  "type": "module",
4
- "version": "0.11.5",
4
+ "version": "0.11.7",
5
5
  "description": "Zayne Labs' ESLint config preset",
6
6
  "author": "Ryan Zayne",
7
7
  "license": "MIT",
@@ -16,7 +16,8 @@
16
16
  "keywords": [],
17
17
  "sideEffects": false,
18
18
  "exports": {
19
- ".": "./dist/index.js"
19
+ ".": "./dist/index.js",
20
+ "./constants/*": "./dist/constants/*.js"
20
21
  },
21
22
  "bin": "./bin/index.js",
22
23
  "files": [
@@ -39,7 +40,6 @@
39
40
  "eslint-plugin-depend": "1.x.x",
40
41
  "eslint-plugin-erasable-syntax-only": "0.x.x",
41
42
  "eslint-plugin-jsx-a11y": "6.x.x",
42
- "eslint-plugin-pnpm": "1.x.x",
43
43
  "eslint-plugin-react-hooks": "7.x.x",
44
44
  "eslint-plugin-react-refresh": "0.x.x",
45
45
  "eslint-plugin-solid": "0.x.x",
@@ -82,9 +82,6 @@
82
82
  "eslint-plugin-jsx-a11y": {
83
83
  "optional": true
84
84
  },
85
- "eslint-plugin-pnpm": {
86
- "optional": true
87
- },
88
85
  "eslint-plugin-react-hooks": {
89
86
  "optional": true
90
87
  },
@@ -114,11 +111,11 @@
114
111
  "@antfu/install-pkg": "1.1.0",
115
112
  "@clack/prompts": "0.11.0",
116
113
  "@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
117
- "@eslint/compat": "1.4.1",
118
- "@eslint/js": "9.39.1",
114
+ "@eslint/compat": "2.0.0",
115
+ "@eslint/js": "9.39.2",
119
116
  "@eslint/markdown": "^7.5.1",
120
- "@stylistic/eslint-plugin": "5.5.0",
121
- "@zayne-labs/toolkit-type-helpers": "0.12.12",
117
+ "@stylistic/eslint-plugin": "5.6.1",
118
+ "@zayne-labs/toolkit-type-helpers": "0.12.17",
122
119
  "ansis": "4.2.0",
123
120
  "cac": "6.7.14",
124
121
  "eslint-config-flat-gitignore": "2.1.0",
@@ -126,64 +123,64 @@
126
123
  "eslint-import-resolver-typescript": "4.4.4",
127
124
  "eslint-merge-processors": "2.0.0",
128
125
  "eslint-plugin-import-x": "4.16.1",
129
- "eslint-plugin-jsdoc": "61.1.12",
126
+ "eslint-plugin-jsdoc": "61.5.0",
130
127
  "eslint-plugin-jsonc": "2.21.0",
131
128
  "eslint-plugin-n": "17.23.1",
132
- "eslint-plugin-perfectionist": "4.15.1",
129
+ "eslint-plugin-perfectionist": "5.1.0",
130
+ "eslint-plugin-pnpm": "1.4.3",
133
131
  "eslint-plugin-security": "3.0.1",
134
132
  "eslint-plugin-toml": "^0.12.0",
135
133
  "eslint-plugin-unicorn": "62.0.0",
136
- "eslint-plugin-yml": "^1.19.0",
134
+ "eslint-plugin-yml": "^1.19.1",
137
135
  "globals": "16.5.0",
138
- "jsonc-eslint-parser": "2.4.1",
136
+ "jsonc-eslint-parser": "2.4.2",
139
137
  "local-pkg": "1.1.2",
140
138
  "parse-gitignore": "2.0.0",
141
- "toml-eslint-parser": "0.10.0",
142
- "typescript-eslint": "8.46.3",
143
- "yaml-eslint-parser": "1.3.0"
139
+ "toml-eslint-parser": "0.10.1",
140
+ "typescript-eslint": "8.50.1",
141
+ "yaml-eslint-parser": "1.3.2"
144
142
  },
145
143
  "devDependencies": {
146
144
  "@arethetypeswrong/cli": "0.18.2",
147
- "@changesets/cli": "2.29.7",
148
- "@eslint-react/eslint-plugin": "2.3.1",
149
- "@next/eslint-plugin-next": "16.0.1",
145
+ "@changesets/cli": "2.29.8",
146
+ "@eslint-react/eslint-plugin": "2.4.0",
147
+ "@next/eslint-plugin-next": "16.1.1",
150
148
  "@tanstack/eslint-plugin-query": "5.91.2",
151
- "@tanstack/eslint-plugin-router": "1.133.19",
149
+ "@tanstack/eslint-plugin-router": "1.141.0",
152
150
  "@total-typescript/ts-reset": "0.6.1",
153
151
  "@types/eslint-plugin-jsx-a11y": "^6.10.1",
154
152
  "@types/eslint-plugin-security": "3.0.0",
155
- "@types/node": "24.10.0",
156
- "@typescript-eslint/parser": "^8.46.3",
153
+ "@types/node": "25.0.3",
154
+ "@typescript-eslint/parser": "^8.50.0",
157
155
  "astro-eslint-parser": "1.2.2",
158
156
  "concurrently": "9.2.1",
159
157
  "cross-env": "10.1.0",
160
- "eslint": "9.39.1",
158
+ "eslint": "9.39.2",
161
159
  "eslint-config-expo": "^10.0.0",
162
160
  "eslint-plugin-astro": "1.5.0",
163
- "eslint-plugin-better-tailwindcss": "3.7.10",
164
- "eslint-plugin-depend": "1.3.1",
161
+ "eslint-plugin-better-tailwindcss": "3.8.0",
162
+ "eslint-plugin-depend": "1.4.0",
165
163
  "eslint-plugin-erasable-syntax-only": "0.4.0",
166
164
  "eslint-plugin-jsx-a11y": "^6.10.2",
167
- "eslint-plugin-pnpm": "1.3.0",
168
165
  "eslint-plugin-react-hooks": "7.0.1",
169
- "eslint-plugin-react-refresh": "0.4.24",
170
- "eslint-plugin-react-you-might-not-need-an-effect": "0.7.0",
166
+ "eslint-plugin-react-refresh": "0.4.26",
167
+ "eslint-plugin-react-you-might-not-need-an-effect": "0.8.1",
171
168
  "eslint-plugin-solid": "0.14.5",
172
- "eslint-plugin-svelte": "3.13.0",
173
- "eslint-plugin-vue": "10.5.1",
169
+ "eslint-plugin-svelte": "3.13.1",
170
+ "eslint-plugin-vue": "10.6.2",
174
171
  "eslint-processor-vue-blocks": "2.0.0",
175
172
  "eslint-typegen": "2.3.0",
173
+ "find-up-simple": "^1.0.1",
176
174
  "husky": "9.1.7",
177
- "lint-staged": "16.2.6",
178
- "pkg-pr-new": "0.0.60",
179
- "prettier": "3.6.2",
180
- "publint": "0.3.15",
181
- "tailwindcss": "^4.1.17",
182
- "tsdown": "^0.16.0",
183
- "tsx": "4.20.6",
175
+ "pkg-pr-new": "0.0.62",
176
+ "prettier": "3.7.4",
177
+ "publint": "0.3.16",
178
+ "tailwindcss": "^4.1.18",
179
+ "tsdown": "^0.18.2",
180
+ "tsx": "4.21.0",
184
181
  "typescript": "5.9.3",
185
182
  "vue-eslint-parser": "10.2.0",
186
- "@zayne-labs/tsconfig": "0.11.5"
183
+ "@zayne-labs/tsconfig": "0.11.7"
187
184
  },
188
185
  "publishConfig": {
189
186
  "access": "public",