@zayne-labs/eslint-config 0.10.4 → 0.10.5
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.
- package/dist/cli/index.js +35 -38
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +68 -10
- package/dist/index.js +14 -21
- package/dist/index.js.map +1 -1
- package/dist/{src-tkLps0qA.js → src-CqhpNkRz.js} +18 -16
- package/dist/{src-tkLps0qA.js.map → src-CqhpNkRz.js.map} +1 -1
- package/package.json +17 -17
|
@@ -207,7 +207,7 @@ var require_lib = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/eslint-
|
|
|
207
207
|
}) });
|
|
208
208
|
|
|
209
209
|
//#endregion
|
|
210
|
-
//#region ../../node_modules/.pnpm/eslint-utils@3.0.0_eslint@9.
|
|
210
|
+
//#region ../../node_modules/.pnpm/eslint-utils@3.0.0_eslint@9.37.0_jiti@2.6.1_/node_modules/eslint-utils/index.mjs
|
|
211
211
|
var import_lib = /* @__PURE__ */ __toESM(require_lib(), 1);
|
|
212
212
|
/**
|
|
213
213
|
* Get the innermost scope which contains a given location.
|
|
@@ -1318,7 +1318,7 @@ function exceptDefault(name, index) {
|
|
|
1318
1318
|
}
|
|
1319
1319
|
|
|
1320
1320
|
//#endregion
|
|
1321
|
-
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.
|
|
1321
|
+
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.6_eslint@9.37.0_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/util/ast.js
|
|
1322
1322
|
const traverse = (context, node, visit, visited = /* @__PURE__ */ new Set()) => {
|
|
1323
1323
|
if (visited.has(node)) return;
|
|
1324
1324
|
visited.add(node);
|
|
@@ -1350,7 +1350,7 @@ const getCallExpr = (ref, current = ref.identifier.parent) => {
|
|
|
1350
1350
|
};
|
|
1351
1351
|
|
|
1352
1352
|
//#endregion
|
|
1353
|
-
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.
|
|
1353
|
+
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.6_eslint@9.37.0_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/util/react.js
|
|
1354
1354
|
const isReactFunctionalComponent = (node) => (node.type === "FunctionDeclaration" || node.type === "VariableDeclarator" && (node.init.type === "ArrowFunctionExpression" || node.init.type === "CallExpression")) && node.id.type === "Identifier" && node.id.name[0].toUpperCase() === node.id.name[0];
|
|
1355
1355
|
const isReactFunctionalHOC = (node) => node.type === "VariableDeclarator" && node.init && node.init.type === "CallExpression" && node.init.callee.type === "Identifier" && !["memo", "forwardRef"].includes(node.init.callee.name) && node.init.arguments.length > 0 && (node.init.arguments[0].type === "ArrowFunctionExpression" || node.init.arguments[0].type === "FunctionExpression") && node.id.type === "Identifier" && node.id.name[0].toUpperCase() === node.id.name[0];
|
|
1356
1356
|
const isCustomHook = (node) => (node.type === "FunctionDeclaration" || node.type === "VariableDeclarator" && node.init && (node.init.type === "ArrowFunctionExpression" || node.init.type === "FunctionExpression")) && node.id.type === "Identifier" && node.id.name.startsWith("use") && node.id.name[3] === node.id.name[3].toUpperCase();
|
|
@@ -1405,7 +1405,7 @@ const isArgsAllLiterals = (context, callExpr) => callExpr.arguments.flatMap((arg
|
|
|
1405
1405
|
const getUpstreamReactVariables = (context, variable) => getUpstreamVariables(context, variable, (node) => !isUseState(node)).filter((variable$1) => variable$1.defs.every((def) => isPropDef(def) || def.type !== "Parameter"));
|
|
1406
1406
|
|
|
1407
1407
|
//#endregion
|
|
1408
|
-
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.
|
|
1408
|
+
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.6_eslint@9.37.0_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-empty-effect.js
|
|
1409
1409
|
/**
|
|
1410
1410
|
* @type {import("eslint").Rule.RuleModule}
|
|
1411
1411
|
*/
|
|
@@ -1426,7 +1426,7 @@ var no_empty_effect_default = {
|
|
|
1426
1426
|
};
|
|
1427
1427
|
|
|
1428
1428
|
//#endregion
|
|
1429
|
-
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.
|
|
1429
|
+
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.6_eslint@9.37.0_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-adjust-state-on-prop-change.js
|
|
1430
1430
|
/**
|
|
1431
1431
|
* @type {import("eslint").Rule.RuleModule}
|
|
1432
1432
|
*/
|
|
@@ -1457,7 +1457,7 @@ var no_adjust_state_on_prop_change_default = {
|
|
|
1457
1457
|
};
|
|
1458
1458
|
|
|
1459
1459
|
//#endregion
|
|
1460
|
-
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.
|
|
1460
|
+
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.6_eslint@9.37.0_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-reset-all-state-on-prop-change.js
|
|
1461
1461
|
/**
|
|
1462
1462
|
* @type {import("eslint").Rule.RuleModule}
|
|
1463
1463
|
*/
|
|
@@ -1476,6 +1476,8 @@ var no_reset_all_state_on_prop_change_default = {
|
|
|
1476
1476
|
const effectFnRefs = getEffectFnRefs(context, node);
|
|
1477
1477
|
const depsRefs = getEffectDepsRefs(context, node);
|
|
1478
1478
|
if (!effectFnRefs || !depsRefs) return;
|
|
1479
|
+
const containingNode = findContainingNode(node);
|
|
1480
|
+
if (containingNode && isCustomHook(containingNode)) return;
|
|
1479
1481
|
const propUsedToResetAllState = findPropUsedToResetAllState(context, effectFnRefs, depsRefs, node);
|
|
1480
1482
|
if (propUsedToResetAllState) context.report({
|
|
1481
1483
|
node,
|
|
@@ -1512,7 +1514,7 @@ const findContainingNode = (node) => {
|
|
|
1512
1514
|
};
|
|
1513
1515
|
|
|
1514
1516
|
//#endregion
|
|
1515
|
-
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.
|
|
1517
|
+
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.6_eslint@9.37.0_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-event-handler.js
|
|
1516
1518
|
/**
|
|
1517
1519
|
* @type {import("eslint").Rule.RuleModule}
|
|
1518
1520
|
*/
|
|
@@ -1541,7 +1543,7 @@ var no_event_handler_default = {
|
|
|
1541
1543
|
};
|
|
1542
1544
|
|
|
1543
1545
|
//#endregion
|
|
1544
|
-
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.
|
|
1546
|
+
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.6_eslint@9.37.0_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-pass-live-state-to-parent.js
|
|
1545
1547
|
/**
|
|
1546
1548
|
* @type {import("eslint").Rule.RuleModule}
|
|
1547
1549
|
*/
|
|
@@ -1571,7 +1573,7 @@ var no_pass_live_state_to_parent_default = {
|
|
|
1571
1573
|
};
|
|
1572
1574
|
|
|
1573
1575
|
//#endregion
|
|
1574
|
-
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.
|
|
1576
|
+
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.6_eslint@9.37.0_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-initialize-state.js
|
|
1575
1577
|
/**
|
|
1576
1578
|
* @type {import("eslint").Rule.RuleModule}
|
|
1577
1579
|
*/
|
|
@@ -1601,7 +1603,7 @@ var no_initialize_state_default = {
|
|
|
1601
1603
|
};
|
|
1602
1604
|
|
|
1603
1605
|
//#endregion
|
|
1604
|
-
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.
|
|
1606
|
+
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.6_eslint@9.37.0_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-chain-state-updates.js
|
|
1605
1607
|
/**
|
|
1606
1608
|
* @type {import("eslint").Rule.RuleModule}
|
|
1607
1609
|
*/
|
|
@@ -1632,7 +1634,7 @@ var no_chain_state_updates_default = {
|
|
|
1632
1634
|
};
|
|
1633
1635
|
|
|
1634
1636
|
//#endregion
|
|
1635
|
-
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.
|
|
1637
|
+
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.6_eslint@9.37.0_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-derived-state.js
|
|
1636
1638
|
/**
|
|
1637
1639
|
* @type {import('eslint').Rule.RuleModule}
|
|
1638
1640
|
*/
|
|
@@ -1671,7 +1673,7 @@ var no_derived_state_default = {
|
|
|
1671
1673
|
const countCalls = (ref) => ref.resolved.references.filter((ref$1) => ref$1.identifier.parent.type === "CallExpression").length;
|
|
1672
1674
|
|
|
1673
1675
|
//#endregion
|
|
1674
|
-
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.
|
|
1676
|
+
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.6_eslint@9.37.0_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-pass-data-to-parent.js
|
|
1675
1677
|
/**
|
|
1676
1678
|
* @type {import("eslint").Rule.RuleModule}
|
|
1677
1679
|
*/
|
|
@@ -1701,7 +1703,7 @@ var no_pass_data_to_parent_default = {
|
|
|
1701
1703
|
};
|
|
1702
1704
|
|
|
1703
1705
|
//#endregion
|
|
1704
|
-
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.
|
|
1706
|
+
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.6_eslint@9.37.0_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-manage-parent.js
|
|
1705
1707
|
/**
|
|
1706
1708
|
* @type {import("eslint").Rule.RuleModule}
|
|
1707
1709
|
*/
|
|
@@ -1726,13 +1728,13 @@ var no_manage_parent_default = {
|
|
|
1726
1728
|
};
|
|
1727
1729
|
|
|
1728
1730
|
//#endregion
|
|
1729
|
-
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.
|
|
1731
|
+
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.6_eslint@9.37.0_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/util/javascript.js
|
|
1730
1732
|
Array.prototype.notEmptyEvery = function(predicate) {
|
|
1731
1733
|
return this.length > 0 && this.every(predicate);
|
|
1732
1734
|
};
|
|
1733
1735
|
|
|
1734
1736
|
//#endregion
|
|
1735
|
-
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.
|
|
1737
|
+
//#region ../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.6_eslint@9.37.0_jiti@2.6.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/index.js
|
|
1736
1738
|
/**
|
|
1737
1739
|
* @type {import("eslint").ESLint.Plugin}
|
|
1738
1740
|
*/
|
|
@@ -1777,4 +1779,4 @@ var src_default = plugin;
|
|
|
1777
1779
|
|
|
1778
1780
|
//#endregion
|
|
1779
1781
|
export { src_default as default };
|
|
1780
|
-
//# sourceMappingURL=src-
|
|
1782
|
+
//# sourceMappingURL=src-CqhpNkRz.js.map
|