@icebreakers/eslint-config 5.0.1 → 5.0.2
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-Dk5MjvLV.js → dist-Q1ckojP1.js} +579 -556
- package/dist/{dist-Br-vKI2G.cjs → dist-fjokZKZW.cjs} +579 -556
- package/dist/index.cjs +12 -9
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +12 -9
- package/dist/{lib-DS3f4hEx.js → lib-CsDEZ3xL.js} +108 -108
- package/dist/{lib-gbm6XY5m.cjs → lib-_LfrBdIh.cjs} +108 -108
- package/dist/{modern-DnYnDvqZ.js → modern-Bann1D4p.js} +8 -3
- package/dist/{modern-BlDFWU8k.cjs → modern-D2OTfylT.cjs} +8 -3
- package/package.json +7 -7
|
@@ -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.100.
|
|
2
|
+
//#region ../../node_modules/.pnpm/@tanstack+eslint-plugin-query@5.100.14_eslint@10.4.0_jiti@2.7.0__typescript@6.0.3/node_modules/@tanstack/eslint-plugin-query/build/modern/chunk-DL47ZJZ5.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
|
}
|
|
@@ -719,6 +719,11 @@ var rule4 = ESLintUtils.RuleCreator(getDocsUrl)({
|
|
|
719
719
|
}
|
|
720
720
|
function collectVariableNames(pattern, queryHook) {
|
|
721
721
|
if (pattern.type === AST_NODE_TYPES.Identifier) trackedVariables[pattern.name] = queryHook;
|
|
722
|
+
else if (pattern.type === AST_NODE_TYPES.ArrayPattern) for (const element of pattern.elements) {
|
|
723
|
+
if (element === null) continue;
|
|
724
|
+
if (element.type === AST_NODE_TYPES.Identifier) trackedVariables[element.name] = queryHook;
|
|
725
|
+
else if (element.type === AST_NODE_TYPES.RestElement && element.argument.type === AST_NODE_TYPES.Identifier) trackedVariables[element.argument.name] = queryHook;
|
|
726
|
+
}
|
|
722
727
|
}
|
|
723
728
|
function hasCombineProperty(callExpression) {
|
|
724
729
|
if (callExpression.arguments.length === 0) return false;
|
|
@@ -734,7 +739,7 @@ var rule4 = ESLintUtils.RuleCreator(getDocsUrl)({
|
|
|
734
739
|
},
|
|
735
740
|
VariableDeclarator(node) {
|
|
736
741
|
if (node.init !== null && node.init.type === AST_NODE_TYPES.CallExpression && node.init.callee.type === AST_NODE_TYPES.Identifier && allHookNames.includes(node.init.callee.name) && helpers.isTanstackQueryImport(node.init.callee)) {
|
|
737
|
-
if (node.init.callee.name === "useQueries" && hasCombineProperty(node.init)) return;
|
|
742
|
+
if ((node.init.callee.name === "useQueries" || node.init.callee.name === "useSuspenseQueries") && hasCombineProperty(node.init)) return;
|
|
738
743
|
collectVariableNames(node.id, node.init.callee.name);
|
|
739
744
|
}
|
|
740
745
|
},
|
|
@@ -1096,7 +1101,7 @@ var rules = {
|
|
|
1096
1101
|
[name8]: rule8
|
|
1097
1102
|
};
|
|
1098
1103
|
//#endregion
|
|
1099
|
-
//#region ../../node_modules/.pnpm/@tanstack+eslint-plugin-query@5.100.
|
|
1104
|
+
//#region ../../node_modules/.pnpm/@tanstack+eslint-plugin-query@5.100.14_eslint@10.4.0_jiti@2.7.0__typescript@6.0.3/node_modules/@tanstack/eslint-plugin-query/build/modern/index.js
|
|
1100
1105
|
var recommendedRules = {
|
|
1101
1106
|
"@tanstack/query/exhaustive-deps": "error",
|
|
1102
1107
|
"@tanstack/query/no-rest-destructuring": "warn",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require("./chunk-BrWF7lJc.cjs");
|
|
2
2
|
let _typescript_eslint_utils = require("@typescript-eslint/utils");
|
|
3
|
-
//#region ../../node_modules/.pnpm/@tanstack+eslint-plugin-query@5.100.
|
|
3
|
+
//#region ../../node_modules/.pnpm/@tanstack+eslint-plugin-query@5.100.14_eslint@10.4.0_jiti@2.7.0__typescript@6.0.3/node_modules/@tanstack/eslint-plugin-query/build/modern/chunk-DL47ZJZ5.js
|
|
4
4
|
function uniqueBy(arr, fn) {
|
|
5
5
|
return arr.filter((x, i, a) => a.findIndex((y) => fn(x) === fn(y)) === i);
|
|
6
6
|
}
|
|
@@ -720,6 +720,11 @@ var rule4 = _typescript_eslint_utils.ESLintUtils.RuleCreator(getDocsUrl)({
|
|
|
720
720
|
}
|
|
721
721
|
function collectVariableNames(pattern, queryHook) {
|
|
722
722
|
if (pattern.type === _typescript_eslint_utils.AST_NODE_TYPES.Identifier) trackedVariables[pattern.name] = queryHook;
|
|
723
|
+
else if (pattern.type === _typescript_eslint_utils.AST_NODE_TYPES.ArrayPattern) for (const element of pattern.elements) {
|
|
724
|
+
if (element === null) continue;
|
|
725
|
+
if (element.type === _typescript_eslint_utils.AST_NODE_TYPES.Identifier) trackedVariables[element.name] = queryHook;
|
|
726
|
+
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
|
+
}
|
|
723
728
|
}
|
|
724
729
|
function hasCombineProperty(callExpression) {
|
|
725
730
|
if (callExpression.arguments.length === 0) return false;
|
|
@@ -735,7 +740,7 @@ var rule4 = _typescript_eslint_utils.ESLintUtils.RuleCreator(getDocsUrl)({
|
|
|
735
740
|
},
|
|
736
741
|
VariableDeclarator(node) {
|
|
737
742
|
if (node.init !== null && node.init.type === _typescript_eslint_utils.AST_NODE_TYPES.CallExpression && node.init.callee.type === _typescript_eslint_utils.AST_NODE_TYPES.Identifier && allHookNames.includes(node.init.callee.name) && helpers.isTanstackQueryImport(node.init.callee)) {
|
|
738
|
-
if (node.init.callee.name === "useQueries" && hasCombineProperty(node.init)) return;
|
|
743
|
+
if ((node.init.callee.name === "useQueries" || node.init.callee.name === "useSuspenseQueries") && hasCombineProperty(node.init)) return;
|
|
739
744
|
collectVariableNames(node.id, node.init.callee.name);
|
|
740
745
|
}
|
|
741
746
|
},
|
|
@@ -1097,7 +1102,7 @@ var rules = {
|
|
|
1097
1102
|
[name8]: rule8
|
|
1098
1103
|
};
|
|
1099
1104
|
//#endregion
|
|
1100
|
-
//#region ../../node_modules/.pnpm/@tanstack+eslint-plugin-query@5.100.
|
|
1105
|
+
//#region ../../node_modules/.pnpm/@tanstack+eslint-plugin-query@5.100.14_eslint@10.4.0_jiti@2.7.0__typescript@6.0.3/node_modules/@tanstack/eslint-plugin-query/build/modern/index.js
|
|
1101
1106
|
var recommendedRules = {
|
|
1102
1107
|
"@tanstack/query/exhaustive-deps": "error",
|
|
1103
1108
|
"@tanstack/query/no-rest-destructuring": "warn",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.2",
|
|
5
5
|
"description": "ESLint preset from Icebreaker's dev-configs",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@antfu/eslint-config": "9.0.0",
|
|
54
|
-
"@eslint-react/eslint-plugin": "^5.
|
|
55
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
56
|
-
"@typescript-eslint/typescript-estree": "^8.
|
|
57
|
-
"@typescript-eslint/utils": "^8.
|
|
54
|
+
"@eslint-react/eslint-plugin": "^5.8.5",
|
|
55
|
+
"@typescript-eslint/rule-tester": "^8.60.0",
|
|
56
|
+
"@typescript-eslint/typescript-estree": "^8.60.0",
|
|
57
|
+
"@typescript-eslint/utils": "^8.60.0",
|
|
58
58
|
"@vue/compiler-sfc": "^3.5.34",
|
|
59
59
|
"eslint-flat-config-utils": "3.2.0",
|
|
60
60
|
"eslint-plugin-better-tailwindcss": "^4.5.0",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
63
63
|
"eslint-plugin-react-refresh": "^0.5.2",
|
|
64
64
|
"eslint-plugin-tailwindcss": "3.18.3",
|
|
65
|
-
"@icebreakers/stylelint-config": "4.0.
|
|
66
|
-
"eslint-plugin-better-stylelint": "1.0.
|
|
65
|
+
"@icebreakers/stylelint-config": "4.0.2",
|
|
66
|
+
"eslint-plugin-better-stylelint": "1.0.5"
|
|
67
67
|
},
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public",
|