@pdg/react-hook 2.0.13 → 2.0.15
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/eslint-plugin.d.ts +82 -3
- package/dist/eslint-plugin.js +18 -3
- package/package.json +1 -1
package/dist/eslint-plugin.d.ts
CHANGED
|
@@ -68,10 +68,89 @@ declare const plugin: {
|
|
|
68
68
|
};
|
|
69
69
|
configs: {
|
|
70
70
|
recommended: {
|
|
71
|
-
plugins:
|
|
71
|
+
plugins: string[];
|
|
72
72
|
rules: {
|
|
73
|
-
'@pdg/react-hooks/rules-of-hooks':
|
|
74
|
-
'@pdg/react-hooks/exhaustive-deps':
|
|
73
|
+
'@pdg/react-hooks/rules-of-hooks': string;
|
|
74
|
+
'@pdg/react-hooks/exhaustive-deps': string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
flat: {
|
|
78
|
+
recommended: {
|
|
79
|
+
plugins: {
|
|
80
|
+
'@pdg/react-hooks': {
|
|
81
|
+
rules: {
|
|
82
|
+
'exhaustive-deps': {
|
|
83
|
+
create(context: any): {
|
|
84
|
+
CallExpression(node: any): void;
|
|
85
|
+
};
|
|
86
|
+
meta: {
|
|
87
|
+
type: "suggestion";
|
|
88
|
+
docs: {
|
|
89
|
+
description: string;
|
|
90
|
+
recommended: true;
|
|
91
|
+
url: string;
|
|
92
|
+
};
|
|
93
|
+
fixable: "code";
|
|
94
|
+
hasSuggestions: true;
|
|
95
|
+
schema: {
|
|
96
|
+
type: "object";
|
|
97
|
+
additionalProperties: false;
|
|
98
|
+
enableDangerousAutofixThisMayCauseInfiniteLoops: boolean;
|
|
99
|
+
properties: {
|
|
100
|
+
additionalHooks: {
|
|
101
|
+
type: "string";
|
|
102
|
+
};
|
|
103
|
+
enableDangerousAutofixThisMayCauseInfiniteLoops: {
|
|
104
|
+
type: "boolean";
|
|
105
|
+
};
|
|
106
|
+
experimental_autoDependenciesHooks: {
|
|
107
|
+
type: "array";
|
|
108
|
+
items: {
|
|
109
|
+
type: "string";
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
requireExplicitEffectDeps: {
|
|
113
|
+
type: "boolean";
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
}[];
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
'rules-of-hooks': {
|
|
120
|
+
meta: {
|
|
121
|
+
type: "problem";
|
|
122
|
+
docs: {
|
|
123
|
+
description: string;
|
|
124
|
+
recommended: true;
|
|
125
|
+
url: string;
|
|
126
|
+
};
|
|
127
|
+
schema: {
|
|
128
|
+
type: "object";
|
|
129
|
+
additionalProperties: false;
|
|
130
|
+
properties: {
|
|
131
|
+
additionalHooks: {
|
|
132
|
+
type: "string";
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
}[];
|
|
136
|
+
};
|
|
137
|
+
create(context: import("eslint").Rule.RuleContext): {
|
|
138
|
+
"*"(node: any): void;
|
|
139
|
+
"*:exit"(node: any): void;
|
|
140
|
+
CallExpression(node: import("estree").CallExpression & import("eslint").Rule.NodeParentExtension): void;
|
|
141
|
+
Identifier(node: import("estree").Identifier & import("eslint").Rule.NodeParentExtension): void;
|
|
142
|
+
"CallExpression:exit"(node: import("estree").CallExpression & import("eslint").Rule.NodeParentExtension): void;
|
|
143
|
+
FunctionDeclaration(node: import("estree").FunctionDeclaration & import("eslint").Rule.NodeParentExtension): void;
|
|
144
|
+
ArrowFunctionExpression(node: import("estree").ArrowFunctionExpression & import("eslint").Rule.NodeParentExtension): void;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
rules: {
|
|
151
|
+
'@pdg/react-hooks/rules-of-hooks': string;
|
|
152
|
+
'@pdg/react-hooks/exhaustive-deps': string;
|
|
153
|
+
};
|
|
75
154
|
};
|
|
76
155
|
};
|
|
77
156
|
};
|
package/dist/eslint-plugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import reactHooksPlugin from 'eslint-plugin-react-hooks';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const pluginRules = {
|
|
4
4
|
rules: {
|
|
5
5
|
'exhaustive-deps': Object.assign(Object.assign({}, reactHooksPlugin.rules['exhaustive-deps']), { create(context) {
|
|
6
6
|
const originalRule = reactHooksPlugin.rules['exhaustive-deps'].create(context);
|
|
@@ -38,9 +38,20 @@ const plugin = {
|
|
|
38
38
|
} }),
|
|
39
39
|
'rules-of-hooks': reactHooksPlugin.rules['rules-of-hooks'],
|
|
40
40
|
},
|
|
41
|
-
|
|
41
|
+
};
|
|
42
|
+
const plugConfig = {
|
|
43
|
+
recommended: {
|
|
44
|
+
plugins: ['@pdg/react-hooks'],
|
|
45
|
+
rules: {
|
|
46
|
+
'@pdg/react-hooks/rules-of-hooks': 'error',
|
|
47
|
+
'@pdg/react-hooks/exhaustive-deps': 'error',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
flat: {
|
|
42
51
|
recommended: {
|
|
43
|
-
plugins:
|
|
52
|
+
plugins: {
|
|
53
|
+
'@pdg/react-hooks': pluginRules,
|
|
54
|
+
},
|
|
44
55
|
rules: {
|
|
45
56
|
'@pdg/react-hooks/rules-of-hooks': 'error',
|
|
46
57
|
'@pdg/react-hooks/exhaustive-deps': 'error',
|
|
@@ -48,5 +59,9 @@ const plugin = {
|
|
|
48
59
|
},
|
|
49
60
|
},
|
|
50
61
|
};
|
|
62
|
+
const plugin = {
|
|
63
|
+
rules: pluginRules.rules,
|
|
64
|
+
configs: plugConfig,
|
|
65
|
+
};
|
|
51
66
|
|
|
52
67
|
export { plugin as default };
|
package/package.json
CHANGED