@icebreakers/eslint-config 5.0.3 → 6.0.0
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/README.md +1 -1
- package/README.zh.md +1 -1
- package/dist/{dist-fjokZKZW.cjs → dist-Cfcd4odI.cjs} +1421 -1373
- package/dist/{dist-Q1ckojP1.js → dist-DTWNkNCv.js} +822 -774
- package/dist/index.cjs +34 -11
- package/dist/index.d.cts +16 -3
- package/dist/index.d.ts +16 -3
- package/dist/index.js +29 -6
- package/dist/{jiti-DflBE4I9.js → jiti-BQvCzdOI.js} +5 -5
- package/dist/{jiti-rvW1Nngq.cjs → jiti-DmQZ8B-l.cjs} +8 -8
- package/dist/{lib-CsDEZ3xL.js → lib-BOuqso-8.js} +1114 -613
- package/dist/{lib-ivfmw_L0.cjs → lib-ByHGIggZ.cjs} +152 -152
- package/dist/{lib-COpZ8-nd.js → lib-CLPiq1xv.js} +1 -1
- package/dist/{lib-_LfrBdIh.cjs → lib-CcedSpss.cjs} +1579 -1078
- package/dist/{modern-Bann1D4p.js → modern-CoGNcL7O.js} +98 -23
- package/dist/{modern-D2OTfylT.cjs → modern-y8Mo-zyc.cjs} +98 -24
- package/dist/{chunk-DwxmvJxx.js → rolldown-runtime-C8SNSOcs.js} +9 -2
- package/dist/{chunk-BrWF7lJc.cjs → rolldown-runtime-DzWaZAza.cjs} +8 -1
- package/dist/{src-seAD4Fwt.cjs → src-Ccb5vGgU.cjs} +10 -10
- package/dist/{src-ByvzhpaY.js → src-zsLgvLJM.js} +2 -2
- package/dist/stylelint.cjs +0 -1
- package/package.json +13 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AST_NODE_TYPES, ESLintUtils, TSESTree } from "@typescript-eslint/utils";
|
|
2
|
-
//#region ../../node_modules/.pnpm/@tanstack+eslint-plugin-query@5.
|
|
2
|
+
//#region ../../node_modules/.pnpm/@tanstack+eslint-plugin-query@5.101.1_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@tanstack/eslint-plugin-query/build/modern/chunk-VALYN6GR.js
|
|
3
3
|
function uniqueBy(arr, fn) {
|
|
4
4
|
return arr.filter((x, i, a) => a.findIndex((y) => fn(x) === fn(y)) === i);
|
|
5
5
|
}
|
|
@@ -616,10 +616,35 @@ var rule2 = ESLintUtils.RuleCreator(getDocsUrl)({
|
|
|
616
616
|
} };
|
|
617
617
|
})
|
|
618
618
|
});
|
|
619
|
-
var
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
619
|
+
var QUERY_RESULT_TYPE_NAMES = /* @__PURE__ */ new Set([
|
|
620
|
+
"UseBaseQueryResult",
|
|
621
|
+
"UseQueryResult",
|
|
622
|
+
"UseSuspenseQueryResult",
|
|
623
|
+
"DefinedUseQueryResult",
|
|
624
|
+
"UseInfiniteQueryResult",
|
|
625
|
+
"UseSuspenseInfiniteQueryResult",
|
|
626
|
+
"DefinedUseInfiniteQueryResult",
|
|
627
|
+
"QueryObserverResult",
|
|
628
|
+
"InfiniteQueryObserverResult"
|
|
629
|
+
]);
|
|
630
|
+
function isQueryResultType(type) {
|
|
631
|
+
if (type.aliasSymbol && QUERY_RESULT_TYPE_NAMES.has(type.aliasSymbol.name)) return true;
|
|
632
|
+
const symbol = type.getSymbol();
|
|
633
|
+
if (symbol && QUERY_RESULT_TYPE_NAMES.has(symbol.name)) return true;
|
|
634
|
+
return type.isUnion() && type.types.some(isQueryResultType);
|
|
635
|
+
}
|
|
636
|
+
var NoRestDestructuringUtils = {
|
|
637
|
+
isObjectRestDestructuring(node) {
|
|
638
|
+
if (node.type !== AST_NODE_TYPES.ObjectPattern) return false;
|
|
639
|
+
return node.properties.some((p) => p.type === AST_NODE_TYPES.RestElement);
|
|
640
|
+
},
|
|
641
|
+
isQueryResultCall(node, parserServices) {
|
|
642
|
+
if (!parserServices?.program || !parserServices.esTreeNodeToTSNodeMap) return false;
|
|
643
|
+
const checker = parserServices.program.getTypeChecker();
|
|
644
|
+
const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node.callee);
|
|
645
|
+
return checker.getTypeAtLocation(tsNode).getCallSignatures().some((sig) => isQueryResultType(sig.getReturnType()));
|
|
646
|
+
}
|
|
647
|
+
};
|
|
623
648
|
var name3 = "no-rest-destructuring";
|
|
624
649
|
var queryHooks = [
|
|
625
650
|
"useQuery",
|
|
@@ -645,9 +670,13 @@ var rule3 = ESLintUtils.RuleCreator(getDocsUrl)({
|
|
|
645
670
|
const queryResultVariables = /* @__PURE__ */ new Set();
|
|
646
671
|
return {
|
|
647
672
|
CallExpression: (node) => {
|
|
648
|
-
if (
|
|
673
|
+
if (node.parent.type !== AST_NODE_TYPES.VariableDeclarator) return;
|
|
649
674
|
const returnValue = node.parent.id;
|
|
650
|
-
if (node.callee
|
|
675
|
+
if (!(ASTUtils.isIdentifierWithOneOfNames(node.callee, queryHooks) && helpers.isTanstackQueryImport(node.callee))) {
|
|
676
|
+
if (!(returnValue.type === AST_NODE_TYPES.Identifier || NoRestDestructuringUtils.isObjectRestDestructuring(returnValue)) || !NoRestDestructuringUtils.isQueryResultCall(node, context.sourceCode.parserServices)) return;
|
|
677
|
+
}
|
|
678
|
+
const calleeName = ASTUtils.isIdentifier(node.callee) ? node.callee.name : null;
|
|
679
|
+
if (calleeName !== "useQueries" && calleeName !== "useSuspenseQueries") {
|
|
651
680
|
if (NoRestDestructuringUtils.isObjectRestDestructuring(returnValue)) return context.report({
|
|
652
681
|
node: node.parent,
|
|
653
682
|
messageId: "objectRestDestructure"
|
|
@@ -710,7 +739,10 @@ var rule4 = ESLintUtils.RuleCreator(getDocsUrl)({
|
|
|
710
739
|
defaultOptions: [],
|
|
711
740
|
create: detectTanstackQueryImports((context, _options, helpers) => {
|
|
712
741
|
const trackedVariables = {};
|
|
742
|
+
const trackedCustomHooks = {};
|
|
713
743
|
const hookAliasMap = {};
|
|
744
|
+
const pendingVariableDeclarators = [];
|
|
745
|
+
const pendingDependencyChecks = [];
|
|
714
746
|
function getReactHook(node) {
|
|
715
747
|
if (node.callee.type === "Identifier") {
|
|
716
748
|
const calleeName = node.callee.name;
|
|
@@ -725,38 +757,81 @@ var rule4 = ESLintUtils.RuleCreator(getDocsUrl)({
|
|
|
725
757
|
else if (element.type === AST_NODE_TYPES.RestElement && element.argument.type === AST_NODE_TYPES.Identifier) trackedVariables[element.argument.name] = queryHook;
|
|
726
758
|
}
|
|
727
759
|
}
|
|
760
|
+
function isCustomHookName(hookName) {
|
|
761
|
+
return /^use[A-Z0-9]/.test(hookName);
|
|
762
|
+
}
|
|
728
763
|
function hasCombineProperty(callExpression) {
|
|
729
764
|
if (callExpression.arguments.length === 0) return false;
|
|
730
765
|
const firstArg = callExpression.arguments[0];
|
|
731
766
|
if (!firstArg || firstArg.type !== AST_NODE_TYPES.ObjectExpression) return false;
|
|
732
767
|
return firstArg.properties.some((prop) => prop.type === AST_NODE_TYPES.Property && prop.key.type === AST_NODE_TYPES.Identifier && prop.key.name === "combine");
|
|
733
768
|
}
|
|
769
|
+
function getDirectQueryHook(callExpression) {
|
|
770
|
+
if (callExpression.callee.type !== AST_NODE_TYPES.Identifier || !allHookNames.includes(callExpression.callee.name) || !helpers.isTanstackQueryImport(callExpression.callee)) return;
|
|
771
|
+
if ((callExpression.callee.name === "useQueries" || callExpression.callee.name === "useSuspenseQueries") && hasCombineProperty(callExpression)) return;
|
|
772
|
+
return callExpression.callee.name;
|
|
773
|
+
}
|
|
774
|
+
function getTrackedQueryHook(callExpression) {
|
|
775
|
+
const directQueryHook = getDirectQueryHook(callExpression);
|
|
776
|
+
if (directQueryHook !== void 0) return directQueryHook;
|
|
777
|
+
if (callExpression.callee.type === AST_NODE_TYPES.Identifier) return trackedCustomHooks[callExpression.callee.name];
|
|
778
|
+
}
|
|
779
|
+
function getReturnedQueryHook(body) {
|
|
780
|
+
if (body.type === AST_NODE_TYPES.CallExpression) return getDirectQueryHook(body);
|
|
781
|
+
if (body.type !== AST_NODE_TYPES.BlockStatement) return;
|
|
782
|
+
const returnStatements = body.body.filter((statement) => statement.type === AST_NODE_TYPES.ReturnStatement);
|
|
783
|
+
if (returnStatements.length !== 1) return;
|
|
784
|
+
const returnArgument = returnStatements[0]?.argument;
|
|
785
|
+
if (returnArgument?.type === AST_NODE_TYPES.CallExpression) return getDirectQueryHook(returnArgument);
|
|
786
|
+
}
|
|
787
|
+
function checkDependencyArray(reactHook, depsArray) {
|
|
788
|
+
depsArray.elements.forEach((dep) => {
|
|
789
|
+
if (dep !== null && dep.type === AST_NODE_TYPES.Identifier && trackedVariables[dep.name] !== void 0) {
|
|
790
|
+
const queryHook = trackedVariables[dep.name];
|
|
791
|
+
context.report({
|
|
792
|
+
node: dep,
|
|
793
|
+
messageId: "noUnstableDeps",
|
|
794
|
+
data: {
|
|
795
|
+
queryHook,
|
|
796
|
+
reactHook
|
|
797
|
+
}
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
});
|
|
801
|
+
}
|
|
734
802
|
return {
|
|
735
803
|
ImportDeclaration(node) {
|
|
736
804
|
if (node.specifiers.length > 0 && node.importKind === "value" && node.source.value === "React") node.specifiers.forEach((specifier) => {
|
|
737
805
|
if (specifier.type === AST_NODE_TYPES.ImportSpecifier && specifier.imported.type === AST_NODE_TYPES.Identifier && reactHookNames.includes(specifier.imported.name)) hookAliasMap[specifier.local.name] = specifier.imported.name;
|
|
738
806
|
});
|
|
739
807
|
},
|
|
808
|
+
FunctionDeclaration(node) {
|
|
809
|
+
if (node.id === null || !isCustomHookName(node.id.name)) return;
|
|
810
|
+
const queryHook = getReturnedQueryHook(node.body);
|
|
811
|
+
if (queryHook !== void 0) trackedCustomHooks[node.id.name] = queryHook;
|
|
812
|
+
},
|
|
740
813
|
VariableDeclarator(node) {
|
|
741
|
-
if (node.
|
|
742
|
-
|
|
743
|
-
|
|
814
|
+
if (node.id.type === AST_NODE_TYPES.Identifier && isCustomHookName(node.id.name) && node.init !== null && (node.init.type === AST_NODE_TYPES.ArrowFunctionExpression || node.init.type === AST_NODE_TYPES.FunctionExpression)) {
|
|
815
|
+
const queryHook = getReturnedQueryHook(node.init.body);
|
|
816
|
+
if (queryHook !== void 0) trackedCustomHooks[node.id.name] = queryHook;
|
|
744
817
|
}
|
|
818
|
+
if (node.init !== null && node.init.type === AST_NODE_TYPES.CallExpression) pendingVariableDeclarators.push(node);
|
|
745
819
|
},
|
|
746
820
|
CallExpression: (node) => {
|
|
747
821
|
const reactHook = getReactHook(node);
|
|
748
|
-
if (reactHook !== void 0 && node.arguments.length > 1 && node.arguments[1]?.type === AST_NODE_TYPES.ArrayExpression)
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
822
|
+
if (reactHook !== void 0 && node.arguments.length > 1 && node.arguments[1]?.type === AST_NODE_TYPES.ArrayExpression) pendingDependencyChecks.push({
|
|
823
|
+
reactHook,
|
|
824
|
+
depsArray: node.arguments[1]
|
|
825
|
+
});
|
|
826
|
+
},
|
|
827
|
+
"Program:exit"() {
|
|
828
|
+
pendingVariableDeclarators.forEach((node) => {
|
|
829
|
+
if (node.init?.type !== AST_NODE_TYPES.CallExpression) return;
|
|
830
|
+
const queryHook = getTrackedQueryHook(node.init);
|
|
831
|
+
if (queryHook !== void 0) collectVariableNames(node.id, queryHook);
|
|
832
|
+
});
|
|
833
|
+
pendingDependencyChecks.forEach(({ reactHook, depsArray }) => {
|
|
834
|
+
checkDependencyArray(reactHook, depsArray);
|
|
760
835
|
});
|
|
761
836
|
}
|
|
762
837
|
};
|
|
@@ -1101,7 +1176,7 @@ var rules = {
|
|
|
1101
1176
|
[name8]: rule8
|
|
1102
1177
|
};
|
|
1103
1178
|
//#endregion
|
|
1104
|
-
//#region ../../node_modules/.pnpm/@tanstack+eslint-plugin-query@5.
|
|
1179
|
+
//#region ../../node_modules/.pnpm/@tanstack+eslint-plugin-query@5.101.1_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@tanstack/eslint-plugin-query/build/modern/index.js
|
|
1105
1180
|
var recommendedRules = {
|
|
1106
1181
|
"@tanstack/query/exhaustive-deps": "error",
|
|
1107
1182
|
"@tanstack/query/no-rest-destructuring": "warn",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
require("./chunk-BrWF7lJc.cjs");
|
|
2
1
|
let _typescript_eslint_utils = require("@typescript-eslint/utils");
|
|
3
|
-
//#region ../../node_modules/.pnpm/@tanstack+eslint-plugin-query@5.
|
|
2
|
+
//#region ../../node_modules/.pnpm/@tanstack+eslint-plugin-query@5.101.1_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@tanstack/eslint-plugin-query/build/modern/chunk-VALYN6GR.js
|
|
4
3
|
function uniqueBy(arr, fn) {
|
|
5
4
|
return arr.filter((x, i, a) => a.findIndex((y) => fn(x) === fn(y)) === i);
|
|
6
5
|
}
|
|
@@ -617,10 +616,35 @@ var rule2 = _typescript_eslint_utils.ESLintUtils.RuleCreator(getDocsUrl)({
|
|
|
617
616
|
} };
|
|
618
617
|
})
|
|
619
618
|
});
|
|
620
|
-
var
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
619
|
+
var QUERY_RESULT_TYPE_NAMES = /* @__PURE__ */ new Set([
|
|
620
|
+
"UseBaseQueryResult",
|
|
621
|
+
"UseQueryResult",
|
|
622
|
+
"UseSuspenseQueryResult",
|
|
623
|
+
"DefinedUseQueryResult",
|
|
624
|
+
"UseInfiniteQueryResult",
|
|
625
|
+
"UseSuspenseInfiniteQueryResult",
|
|
626
|
+
"DefinedUseInfiniteQueryResult",
|
|
627
|
+
"QueryObserverResult",
|
|
628
|
+
"InfiniteQueryObserverResult"
|
|
629
|
+
]);
|
|
630
|
+
function isQueryResultType(type) {
|
|
631
|
+
if (type.aliasSymbol && QUERY_RESULT_TYPE_NAMES.has(type.aliasSymbol.name)) return true;
|
|
632
|
+
const symbol = type.getSymbol();
|
|
633
|
+
if (symbol && QUERY_RESULT_TYPE_NAMES.has(symbol.name)) return true;
|
|
634
|
+
return type.isUnion() && type.types.some(isQueryResultType);
|
|
635
|
+
}
|
|
636
|
+
var NoRestDestructuringUtils = {
|
|
637
|
+
isObjectRestDestructuring(node) {
|
|
638
|
+
if (node.type !== _typescript_eslint_utils.AST_NODE_TYPES.ObjectPattern) return false;
|
|
639
|
+
return node.properties.some((p) => p.type === _typescript_eslint_utils.AST_NODE_TYPES.RestElement);
|
|
640
|
+
},
|
|
641
|
+
isQueryResultCall(node, parserServices) {
|
|
642
|
+
if (!parserServices?.program || !parserServices.esTreeNodeToTSNodeMap) return false;
|
|
643
|
+
const checker = parserServices.program.getTypeChecker();
|
|
644
|
+
const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node.callee);
|
|
645
|
+
return checker.getTypeAtLocation(tsNode).getCallSignatures().some((sig) => isQueryResultType(sig.getReturnType()));
|
|
646
|
+
}
|
|
647
|
+
};
|
|
624
648
|
var name3 = "no-rest-destructuring";
|
|
625
649
|
var queryHooks = [
|
|
626
650
|
"useQuery",
|
|
@@ -646,9 +670,13 @@ var rule3 = _typescript_eslint_utils.ESLintUtils.RuleCreator(getDocsUrl)({
|
|
|
646
670
|
const queryResultVariables = /* @__PURE__ */ new Set();
|
|
647
671
|
return {
|
|
648
672
|
CallExpression: (node) => {
|
|
649
|
-
if (
|
|
673
|
+
if (node.parent.type !== _typescript_eslint_utils.AST_NODE_TYPES.VariableDeclarator) return;
|
|
650
674
|
const returnValue = node.parent.id;
|
|
651
|
-
if (node.callee
|
|
675
|
+
if (!(ASTUtils.isIdentifierWithOneOfNames(node.callee, queryHooks) && helpers.isTanstackQueryImport(node.callee))) {
|
|
676
|
+
if (!(returnValue.type === _typescript_eslint_utils.AST_NODE_TYPES.Identifier || NoRestDestructuringUtils.isObjectRestDestructuring(returnValue)) || !NoRestDestructuringUtils.isQueryResultCall(node, context.sourceCode.parserServices)) return;
|
|
677
|
+
}
|
|
678
|
+
const calleeName = ASTUtils.isIdentifier(node.callee) ? node.callee.name : null;
|
|
679
|
+
if (calleeName !== "useQueries" && calleeName !== "useSuspenseQueries") {
|
|
652
680
|
if (NoRestDestructuringUtils.isObjectRestDestructuring(returnValue)) return context.report({
|
|
653
681
|
node: node.parent,
|
|
654
682
|
messageId: "objectRestDestructure"
|
|
@@ -711,7 +739,10 @@ var rule4 = _typescript_eslint_utils.ESLintUtils.RuleCreator(getDocsUrl)({
|
|
|
711
739
|
defaultOptions: [],
|
|
712
740
|
create: detectTanstackQueryImports((context, _options, helpers) => {
|
|
713
741
|
const trackedVariables = {};
|
|
742
|
+
const trackedCustomHooks = {};
|
|
714
743
|
const hookAliasMap = {};
|
|
744
|
+
const pendingVariableDeclarators = [];
|
|
745
|
+
const pendingDependencyChecks = [];
|
|
715
746
|
function getReactHook(node) {
|
|
716
747
|
if (node.callee.type === "Identifier") {
|
|
717
748
|
const calleeName = node.callee.name;
|
|
@@ -726,38 +757,81 @@ var rule4 = _typescript_eslint_utils.ESLintUtils.RuleCreator(getDocsUrl)({
|
|
|
726
757
|
else if (element.type === _typescript_eslint_utils.AST_NODE_TYPES.RestElement && element.argument.type === _typescript_eslint_utils.AST_NODE_TYPES.Identifier) trackedVariables[element.argument.name] = queryHook;
|
|
727
758
|
}
|
|
728
759
|
}
|
|
760
|
+
function isCustomHookName(hookName) {
|
|
761
|
+
return /^use[A-Z0-9]/.test(hookName);
|
|
762
|
+
}
|
|
729
763
|
function hasCombineProperty(callExpression) {
|
|
730
764
|
if (callExpression.arguments.length === 0) return false;
|
|
731
765
|
const firstArg = callExpression.arguments[0];
|
|
732
766
|
if (!firstArg || firstArg.type !== _typescript_eslint_utils.AST_NODE_TYPES.ObjectExpression) return false;
|
|
733
767
|
return firstArg.properties.some((prop) => prop.type === _typescript_eslint_utils.AST_NODE_TYPES.Property && prop.key.type === _typescript_eslint_utils.AST_NODE_TYPES.Identifier && prop.key.name === "combine");
|
|
734
768
|
}
|
|
769
|
+
function getDirectQueryHook(callExpression) {
|
|
770
|
+
if (callExpression.callee.type !== _typescript_eslint_utils.AST_NODE_TYPES.Identifier || !allHookNames.includes(callExpression.callee.name) || !helpers.isTanstackQueryImport(callExpression.callee)) return;
|
|
771
|
+
if ((callExpression.callee.name === "useQueries" || callExpression.callee.name === "useSuspenseQueries") && hasCombineProperty(callExpression)) return;
|
|
772
|
+
return callExpression.callee.name;
|
|
773
|
+
}
|
|
774
|
+
function getTrackedQueryHook(callExpression) {
|
|
775
|
+
const directQueryHook = getDirectQueryHook(callExpression);
|
|
776
|
+
if (directQueryHook !== void 0) return directQueryHook;
|
|
777
|
+
if (callExpression.callee.type === _typescript_eslint_utils.AST_NODE_TYPES.Identifier) return trackedCustomHooks[callExpression.callee.name];
|
|
778
|
+
}
|
|
779
|
+
function getReturnedQueryHook(body) {
|
|
780
|
+
if (body.type === _typescript_eslint_utils.AST_NODE_TYPES.CallExpression) return getDirectQueryHook(body);
|
|
781
|
+
if (body.type !== _typescript_eslint_utils.AST_NODE_TYPES.BlockStatement) return;
|
|
782
|
+
const returnStatements = body.body.filter((statement) => statement.type === _typescript_eslint_utils.AST_NODE_TYPES.ReturnStatement);
|
|
783
|
+
if (returnStatements.length !== 1) return;
|
|
784
|
+
const returnArgument = returnStatements[0]?.argument;
|
|
785
|
+
if (returnArgument?.type === _typescript_eslint_utils.AST_NODE_TYPES.CallExpression) return getDirectQueryHook(returnArgument);
|
|
786
|
+
}
|
|
787
|
+
function checkDependencyArray(reactHook, depsArray) {
|
|
788
|
+
depsArray.elements.forEach((dep) => {
|
|
789
|
+
if (dep !== null && dep.type === _typescript_eslint_utils.AST_NODE_TYPES.Identifier && trackedVariables[dep.name] !== void 0) {
|
|
790
|
+
const queryHook = trackedVariables[dep.name];
|
|
791
|
+
context.report({
|
|
792
|
+
node: dep,
|
|
793
|
+
messageId: "noUnstableDeps",
|
|
794
|
+
data: {
|
|
795
|
+
queryHook,
|
|
796
|
+
reactHook
|
|
797
|
+
}
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
});
|
|
801
|
+
}
|
|
735
802
|
return {
|
|
736
803
|
ImportDeclaration(node) {
|
|
737
804
|
if (node.specifiers.length > 0 && node.importKind === "value" && node.source.value === "React") node.specifiers.forEach((specifier) => {
|
|
738
805
|
if (specifier.type === _typescript_eslint_utils.AST_NODE_TYPES.ImportSpecifier && specifier.imported.type === _typescript_eslint_utils.AST_NODE_TYPES.Identifier && reactHookNames.includes(specifier.imported.name)) hookAliasMap[specifier.local.name] = specifier.imported.name;
|
|
739
806
|
});
|
|
740
807
|
},
|
|
808
|
+
FunctionDeclaration(node) {
|
|
809
|
+
if (node.id === null || !isCustomHookName(node.id.name)) return;
|
|
810
|
+
const queryHook = getReturnedQueryHook(node.body);
|
|
811
|
+
if (queryHook !== void 0) trackedCustomHooks[node.id.name] = queryHook;
|
|
812
|
+
},
|
|
741
813
|
VariableDeclarator(node) {
|
|
742
|
-
if (node.
|
|
743
|
-
|
|
744
|
-
|
|
814
|
+
if (node.id.type === _typescript_eslint_utils.AST_NODE_TYPES.Identifier && isCustomHookName(node.id.name) && node.init !== null && (node.init.type === _typescript_eslint_utils.AST_NODE_TYPES.ArrowFunctionExpression || node.init.type === _typescript_eslint_utils.AST_NODE_TYPES.FunctionExpression)) {
|
|
815
|
+
const queryHook = getReturnedQueryHook(node.init.body);
|
|
816
|
+
if (queryHook !== void 0) trackedCustomHooks[node.id.name] = queryHook;
|
|
745
817
|
}
|
|
818
|
+
if (node.init !== null && node.init.type === _typescript_eslint_utils.AST_NODE_TYPES.CallExpression) pendingVariableDeclarators.push(node);
|
|
746
819
|
},
|
|
747
820
|
CallExpression: (node) => {
|
|
748
821
|
const reactHook = getReactHook(node);
|
|
749
|
-
if (reactHook !== void 0 && node.arguments.length > 1 && node.arguments[1]?.type === _typescript_eslint_utils.AST_NODE_TYPES.ArrayExpression)
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
822
|
+
if (reactHook !== void 0 && node.arguments.length > 1 && node.arguments[1]?.type === _typescript_eslint_utils.AST_NODE_TYPES.ArrayExpression) pendingDependencyChecks.push({
|
|
823
|
+
reactHook,
|
|
824
|
+
depsArray: node.arguments[1]
|
|
825
|
+
});
|
|
826
|
+
},
|
|
827
|
+
"Program:exit"() {
|
|
828
|
+
pendingVariableDeclarators.forEach((node) => {
|
|
829
|
+
if (node.init?.type !== _typescript_eslint_utils.AST_NODE_TYPES.CallExpression) return;
|
|
830
|
+
const queryHook = getTrackedQueryHook(node.init);
|
|
831
|
+
if (queryHook !== void 0) collectVariableNames(node.id, queryHook);
|
|
832
|
+
});
|
|
833
|
+
pendingDependencyChecks.forEach(({ reactHook, depsArray }) => {
|
|
834
|
+
checkDependencyArray(reactHook, depsArray);
|
|
761
835
|
});
|
|
762
836
|
}
|
|
763
837
|
};
|
|
@@ -1102,7 +1176,7 @@ var rules = {
|
|
|
1102
1176
|
[name8]: rule8
|
|
1103
1177
|
};
|
|
1104
1178
|
//#endregion
|
|
1105
|
-
//#region ../../node_modules/.pnpm/@tanstack+eslint-plugin-query@5.
|
|
1179
|
+
//#region ../../node_modules/.pnpm/@tanstack+eslint-plugin-query@5.101.1_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@tanstack/eslint-plugin-query/build/modern/index.js
|
|
1106
1180
|
var recommendedRules = {
|
|
1107
1181
|
"@tanstack/query/exhaustive-deps": "error",
|
|
1108
1182
|
"@tanstack/query/no-rest-destructuring": "warn",
|
|
@@ -6,7 +6,14 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __esmMin = (fn, res) => () =>
|
|
9
|
+
var __esmMin = (fn, res, err) => () => {
|
|
10
|
+
if (err) throw err[0];
|
|
11
|
+
try {
|
|
12
|
+
return fn && (res = fn(fn = 0)), res;
|
|
13
|
+
} catch (e) {
|
|
14
|
+
throw err = [e], e;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
10
17
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
11
18
|
var __exportAll = (all, no_symbols) => {
|
|
12
19
|
let target = {};
|
|
@@ -32,6 +39,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
32
39
|
value: mod,
|
|
33
40
|
enumerable: true
|
|
34
41
|
}) : target, mod));
|
|
35
|
-
var __require = /*
|
|
42
|
+
var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
36
43
|
//#endregion
|
|
37
44
|
export { __require as a, __reExport as i, __esmMin as n, __toESM as o, __exportAll as r, __commonJSMin as t };
|
|
@@ -5,7 +5,14 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __esmMin = (fn, res) => () =>
|
|
8
|
+
var __esmMin = (fn, res, err) => () => {
|
|
9
|
+
if (err) throw err[0];
|
|
10
|
+
try {
|
|
11
|
+
return fn && (res = fn(fn = 0)), res;
|
|
12
|
+
} catch (e) {
|
|
13
|
+
throw err = [e], e;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
9
16
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
10
17
|
var __exportAll = (all, no_symbols) => {
|
|
11
18
|
let target = {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-DzWaZAza.cjs");
|
|
2
2
|
let node_path = require("node:path");
|
|
3
|
-
node_path =
|
|
3
|
+
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
4
4
|
let node_url = require("node:url");
|
|
5
5
|
let node_fs_promises = require("node:fs/promises");
|
|
6
|
-
node_fs_promises =
|
|
6
|
+
node_fs_promises = require_rolldown_runtime.__toESM(node_fs_promises, 1);
|
|
7
7
|
//#region ../../node_modules/.pnpm/@humanfs+core@0.19.2/node_modules/@humanfs/core/src/hfs.js
|
|
8
8
|
/**
|
|
9
9
|
* Asserts that the given path is a valid file path.
|
|
@@ -40,7 +40,7 @@ function toUint8Array(contents) {
|
|
|
40
40
|
throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.");
|
|
41
41
|
}
|
|
42
42
|
var decoder, encoder, NoSuchMethodError, MethodNotSupportedError, ImplAlreadySetError, LogEntry, Hfs;
|
|
43
|
-
var init_hfs =
|
|
43
|
+
var init_hfs = require_rolldown_runtime.__esmMin((() => {
|
|
44
44
|
decoder = new TextDecoder();
|
|
45
45
|
encoder = new TextEncoder();
|
|
46
46
|
NoSuchMethodError = class extends Error {
|
|
@@ -530,10 +530,10 @@ var init_hfs = require_chunk.__esmMin((() => {
|
|
|
530
530
|
}));
|
|
531
531
|
//#endregion
|
|
532
532
|
//#region ../../node_modules/.pnpm/@humanfs+core@0.19.2/node_modules/@humanfs/core/src/errors.js
|
|
533
|
-
var init_errors =
|
|
533
|
+
var init_errors = require_rolldown_runtime.__esmMin((() => {}));
|
|
534
534
|
//#endregion
|
|
535
535
|
//#region ../../node_modules/.pnpm/@humanfs+core@0.19.2/node_modules/@humanfs/core/src/index.js
|
|
536
|
-
var init_src$1 =
|
|
536
|
+
var init_src$1 = require_rolldown_runtime.__esmMin((() => {
|
|
537
537
|
init_hfs();
|
|
538
538
|
init_errors();
|
|
539
539
|
}));
|
|
@@ -586,7 +586,7 @@ function createPromise() {
|
|
|
586
586
|
};
|
|
587
587
|
}
|
|
588
588
|
var MAX_TASK_TIMEOUT, MAX_TASK_DELAY, MAX_CONCURRENCY, RetryTask, Retrier;
|
|
589
|
-
var init_retrier =
|
|
589
|
+
var init_retrier = require_rolldown_runtime.__esmMin((() => {
|
|
590
590
|
MAX_TASK_TIMEOUT = 6e4;
|
|
591
591
|
MAX_TASK_DELAY = 100;
|
|
592
592
|
MAX_CONCURRENCY = 1e3;
|
|
@@ -873,10 +873,10 @@ var init_retrier = require_chunk.__esmMin((() => {
|
|
|
873
873
|
//#endregion
|
|
874
874
|
//#region ../../node_modules/.pnpm/@humanfs+node@0.16.8/node_modules/@humanfs/node/src/node-hfs.js
|
|
875
875
|
var RETRY_ERROR_CODES, NodeHfsDirectoryEntry, NodeHfsImpl, NodeHfs, hfs;
|
|
876
|
-
var init_node_hfs =
|
|
876
|
+
var init_node_hfs = require_rolldown_runtime.__esmMin((() => {
|
|
877
877
|
init_src$1();
|
|
878
878
|
init_retrier();
|
|
879
|
-
RETRY_ERROR_CODES = new Set(["ENFILE", "EMFILE"]);
|
|
879
|
+
RETRY_ERROR_CODES = /* @__PURE__ */ new Set(["ENFILE", "EMFILE"]);
|
|
880
880
|
NodeHfsDirectoryEntry = class {
|
|
881
881
|
/**
|
|
882
882
|
* The name of the directory entry.
|
|
@@ -1168,7 +1168,7 @@ var init_node_hfs = require_chunk.__esmMin((() => {
|
|
|
1168
1168
|
hfs = new NodeHfs();
|
|
1169
1169
|
}));
|
|
1170
1170
|
//#endregion
|
|
1171
|
-
|
|
1171
|
+
require_rolldown_runtime.__esmMin((() => {
|
|
1172
1172
|
init_node_hfs();
|
|
1173
1173
|
init_src$1();
|
|
1174
1174
|
}))();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as __esmMin } from "./
|
|
1
|
+
import { n as __esmMin } from "./rolldown-runtime-C8SNSOcs.js";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import nativeFsp from "node:fs/promises";
|
|
@@ -874,7 +874,7 @@ var RETRY_ERROR_CODES, NodeHfsDirectoryEntry, NodeHfsImpl, NodeHfs, hfs;
|
|
|
874
874
|
var init_node_hfs = __esmMin((() => {
|
|
875
875
|
init_src$1();
|
|
876
876
|
init_retrier();
|
|
877
|
-
RETRY_ERROR_CODES = new Set(["ENFILE", "EMFILE"]);
|
|
877
|
+
RETRY_ERROR_CODES = /* @__PURE__ */ new Set(["ENFILE", "EMFILE"]);
|
|
878
878
|
NodeHfsDirectoryEntry = class {
|
|
879
879
|
/**
|
|
880
880
|
* The name of the directory entry.
|
package/dist/stylelint.cjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "6.0.0",
|
|
5
5
|
"description": "ESLint preset from Icebreaker's dev-configs",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"index.d.ts"
|
|
40
40
|
],
|
|
41
41
|
"engines": {
|
|
42
|
-
"node": "
|
|
42
|
+
"node": ">=22.12.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"eslint-plugin-pnpm": "^1.6.0"
|
|
@@ -50,20 +50,20 @@
|
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@antfu/eslint-config": "9.
|
|
54
|
-
"@eslint-react/eslint-plugin": "^5.
|
|
55
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
56
|
-
"@typescript-eslint/typescript-estree": "^8.
|
|
57
|
-
"@typescript-eslint/utils": "^8.
|
|
58
|
-
"@vue/compiler-sfc": "^3.5.
|
|
53
|
+
"@antfu/eslint-config": "9.1.0",
|
|
54
|
+
"@eslint-react/eslint-plugin": "^5.9.4",
|
|
55
|
+
"@typescript-eslint/rule-tester": "^8.62.0",
|
|
56
|
+
"@typescript-eslint/typescript-estree": "^8.62.0",
|
|
57
|
+
"@typescript-eslint/utils": "^8.62.0",
|
|
58
|
+
"@vue/compiler-sfc": "^3.5.39",
|
|
59
59
|
"eslint-flat-config-utils": "3.2.0",
|
|
60
|
-
"eslint-plugin-better-tailwindcss": "^4.
|
|
60
|
+
"eslint-plugin-better-tailwindcss": "^4.6.0",
|
|
61
61
|
"eslint-plugin-format": "2.0.1",
|
|
62
62
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
63
|
-
"eslint-plugin-react-refresh": "^0.5.
|
|
64
|
-
"eslint-plugin-tailwindcss": "
|
|
65
|
-
"@icebreakers/stylelint-config": "
|
|
66
|
-
"eslint-plugin-better-stylelint": "
|
|
63
|
+
"eslint-plugin-react-refresh": "^0.5.3",
|
|
64
|
+
"eslint-plugin-tailwindcss": "4.0.4",
|
|
65
|
+
"@icebreakers/stylelint-config": "5.0.0",
|
|
66
|
+
"eslint-plugin-better-stylelint": "2.0.0"
|
|
67
67
|
},
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public",
|