@pdg/react-hook 2.0.14 → 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.
@@ -1,2 +1,158 @@
1
- declare const plugin: any;
1
+ declare const plugin: {
2
+ rules: {
3
+ 'exhaustive-deps': {
4
+ create(context: any): {
5
+ CallExpression(node: any): void;
6
+ };
7
+ meta: {
8
+ type: "suggestion";
9
+ docs: {
10
+ description: string;
11
+ recommended: true;
12
+ url: string;
13
+ };
14
+ fixable: "code";
15
+ hasSuggestions: true;
16
+ schema: {
17
+ type: "object";
18
+ additionalProperties: false;
19
+ enableDangerousAutofixThisMayCauseInfiniteLoops: boolean;
20
+ properties: {
21
+ additionalHooks: {
22
+ type: "string";
23
+ };
24
+ enableDangerousAutofixThisMayCauseInfiniteLoops: {
25
+ type: "boolean";
26
+ };
27
+ experimental_autoDependenciesHooks: {
28
+ type: "array";
29
+ items: {
30
+ type: "string";
31
+ };
32
+ };
33
+ requireExplicitEffectDeps: {
34
+ type: "boolean";
35
+ };
36
+ };
37
+ }[];
38
+ };
39
+ };
40
+ 'rules-of-hooks': {
41
+ meta: {
42
+ type: "problem";
43
+ docs: {
44
+ description: string;
45
+ recommended: true;
46
+ url: string;
47
+ };
48
+ schema: {
49
+ type: "object";
50
+ additionalProperties: false;
51
+ properties: {
52
+ additionalHooks: {
53
+ type: "string";
54
+ };
55
+ };
56
+ }[];
57
+ };
58
+ create(context: import("eslint").Rule.RuleContext): {
59
+ "*"(node: any): void;
60
+ "*:exit"(node: any): void;
61
+ CallExpression(node: import("estree").CallExpression & import("eslint").Rule.NodeParentExtension): void;
62
+ Identifier(node: import("estree").Identifier & import("eslint").Rule.NodeParentExtension): void;
63
+ "CallExpression:exit"(node: import("estree").CallExpression & import("eslint").Rule.NodeParentExtension): void;
64
+ FunctionDeclaration(node: import("estree").FunctionDeclaration & import("eslint").Rule.NodeParentExtension): void;
65
+ ArrowFunctionExpression(node: import("estree").ArrowFunctionExpression & import("eslint").Rule.NodeParentExtension): void;
66
+ };
67
+ };
68
+ };
69
+ configs: {
70
+ recommended: {
71
+ plugins: string[];
72
+ rules: {
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
+ };
154
+ };
155
+ };
156
+ };
157
+ };
2
158
  export default plugin;
@@ -1,6 +1,6 @@
1
1
  import reactHooksPlugin from 'eslint-plugin-react-hooks';
2
2
 
3
- const plugin = {
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);
@@ -39,7 +39,7 @@ const plugin = {
39
39
  'rules-of-hooks': reactHooksPlugin.rules['rules-of-hooks'],
40
40
  },
41
41
  };
42
- plugin.config = {
42
+ const plugConfig = {
43
43
  recommended: {
44
44
  plugins: ['@pdg/react-hooks'],
45
45
  rules: {
@@ -50,7 +50,7 @@ plugin.config = {
50
50
  flat: {
51
51
  recommended: {
52
52
  plugins: {
53
- '@pdg/react-hooks': plugin,
53
+ '@pdg/react-hooks': pluginRules,
54
54
  },
55
55
  rules: {
56
56
  '@pdg/react-hooks/rules-of-hooks': 'error',
@@ -59,5 +59,9 @@ plugin.config = {
59
59
  },
60
60
  },
61
61
  };
62
+ const plugin = {
63
+ rules: pluginRules.rules,
64
+ configs: plugConfig,
65
+ };
62
66
 
63
67
  export { plugin as default };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@pdg/react-hook",
3
3
  "title": "Typescript React Hook Module",
4
4
  "description": "Typescript React Hook Module",
5
- "version": "2.0.14",
5
+ "version": "2.0.15",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
8
8
  "module": "./dist/index.esm.js",