eslint-plugin-builderbot 1.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 +11 -0
- package/dist/configs/recommended.d.ts +9 -0
- package/dist/configs/recommended.d.ts.map +1 -0
- package/dist/index.cjs +223 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/rules/index.d.ts +7 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/processDynamicFlowAwait.d.ts +6 -0
- package/dist/rules/processDynamicFlowAwait.d.ts.map +1 -0
- package/dist/rules/processEndFlowReturn.d.ts +6 -0
- package/dist/rules/processEndFlowReturn.d.ts.map +1 -0
- package/dist/rules/processEndFlowWithFlowDynamic.d.ts +6 -0
- package/dist/rules/processEndFlowWithFlowDynamic.d.ts.map +1 -0
- package/dist/rules/processFallBackReturn.d.ts +6 -0
- package/dist/rules/processFallBackReturn.d.ts.map +1 -0
- package/dist/rules/processGotoFlowReturn.d.ts +6 -0
- package/dist/rules/processGotoFlowReturn.d.ts.map +1 -0
- package/dist/rules/processStateUpdateAwait.d.ts +5 -0
- package/dist/rules/processStateUpdateAwait.d.ts.map +1 -0
- package/dist/types.d.ts +30 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/isInsideAddActionOrAddAnswer.d.ts +4 -0
- package/dist/utils/isInsideAddActionOrAddAnswer.d.ts.map +1 -0
- package/package.json +46 -0
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const rulesRecommended: {
|
|
2
|
+
'bot-whatsapp/func-prefix-goto-flow-return': number;
|
|
3
|
+
'bot-whatsapp/func-prefix-end-flow-return': number;
|
|
4
|
+
'bot-whatsapp/func-prefix-dynamic-flow-await': number;
|
|
5
|
+
'bot-whatsapp/func-prefix-state-update-await': number;
|
|
6
|
+
'bot-whatsapp/func-prefix-fall-back-return': number;
|
|
7
|
+
'bot-whatsapp/func-prefix-endflow-flowdynamic': number;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=recommended.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recommended.d.ts","sourceRoot":"","sources":["../../src/configs/recommended.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;;;;CAO5B,CAAA"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const rulesRecommended = {
|
|
4
|
+
'bot-whatsapp/func-prefix-goto-flow-return': 2,
|
|
5
|
+
'bot-whatsapp/func-prefix-end-flow-return': 2,
|
|
6
|
+
'bot-whatsapp/func-prefix-dynamic-flow-await': 2,
|
|
7
|
+
'bot-whatsapp/func-prefix-state-update-await': 2,
|
|
8
|
+
'bot-whatsapp/func-prefix-fall-back-return': 2,
|
|
9
|
+
'bot-whatsapp/func-prefix-endflow-flowdynamic': 2,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
function isInsideAddActionOrAddAnswer(node) {
|
|
13
|
+
let currentNode = node;
|
|
14
|
+
while (currentNode) {
|
|
15
|
+
if (currentNode.type === 'CallExpression' &&
|
|
16
|
+
currentNode.callee &&
|
|
17
|
+
currentNode.callee.property &&
|
|
18
|
+
(currentNode.callee.property.name === 'addAnswer' || currentNode.callee.property.name === 'addAction')) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
currentNode = currentNode.parent;
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const processDynamicFlowAwait = (context) => {
|
|
27
|
+
return {
|
|
28
|
+
'CallExpression[callee.name="flowDynamic"]'(node) {
|
|
29
|
+
const parentNode = node.parent;
|
|
30
|
+
// Verificar si estamos dentro de un 'addAction' o 'addAnswer'
|
|
31
|
+
if (!isInsideAddActionOrAddAnswer(node)) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
// Verificar si el nodo padre es 'AwaitExpression', de lo contrario se reporta
|
|
35
|
+
if (parentNode.type !== 'AwaitExpression') {
|
|
36
|
+
context.report({
|
|
37
|
+
node,
|
|
38
|
+
message: 'Please use "await" before "flowDynamic" function',
|
|
39
|
+
fix: function (fixer) {
|
|
40
|
+
return fixer.insertTextBefore(node, 'await ');
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const processEndFlowReturn = (context) => {
|
|
49
|
+
return {
|
|
50
|
+
'CallExpression[callee.name="endFlow"]'(node) {
|
|
51
|
+
const parentNode = node.parent;
|
|
52
|
+
// Verificar si estamos dentro de un 'addAction' o 'addAnswer'
|
|
53
|
+
if (!isInsideAddActionOrAddAnswer(node)) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
// Verificar si nodo padre es de tipo ReturnStatement, si no lo es, reportar
|
|
57
|
+
if (parentNode.type !== 'ReturnStatement') {
|
|
58
|
+
context.report({
|
|
59
|
+
node,
|
|
60
|
+
message: 'Please ensure "endFlow" function is returned',
|
|
61
|
+
fix: function (fixer) {
|
|
62
|
+
return fixer.insertTextBefore(node, 'return ');
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const processFallBackReturn = (context) => {
|
|
71
|
+
return {
|
|
72
|
+
'CallExpression[callee.name="fallBack"]'(node) {
|
|
73
|
+
const parentNode = node.parent;
|
|
74
|
+
// Verificar si estamos dentro de un 'addAction' o 'addAnswer'
|
|
75
|
+
if (!isInsideAddActionOrAddAnswer(node)) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
// Verificar si nodo padre es de tipo ReturnStatement, si no lo es, reportar
|
|
79
|
+
if (parentNode.type !== 'ReturnStatement') {
|
|
80
|
+
context.report({
|
|
81
|
+
node,
|
|
82
|
+
message: 'Please ensure "fallBack" function is returned',
|
|
83
|
+
fix: function (fixer) {
|
|
84
|
+
return fixer.insertTextBefore(node, 'return ');
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const processGotoFlowReturn = (context) => {
|
|
93
|
+
return {
|
|
94
|
+
'CallExpression[callee.name="gotoFlow"]'(node) {
|
|
95
|
+
const parentNode = node.parent;
|
|
96
|
+
// Verificar si estamos dentro de un 'addAction' o 'addAnswer'
|
|
97
|
+
if (!isInsideAddActionOrAddAnswer(node)) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
// Verificar si nodo padre es de tipo ReturnStatement, si no lo es, reportar
|
|
101
|
+
if (parentNode.type !== 'ReturnStatement') {
|
|
102
|
+
context.report({
|
|
103
|
+
node,
|
|
104
|
+
message: 'Please ensure "gotoFlow" function is returned',
|
|
105
|
+
fix: function (fixer) {
|
|
106
|
+
return fixer.insertTextBefore(node, 'return ');
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const processStateUpdateAwait = (context) => {
|
|
115
|
+
return {
|
|
116
|
+
'MemberExpression[property.name="update"]'(node) {
|
|
117
|
+
// Verificar si el objeto es 'state'
|
|
118
|
+
if (node.object.name !== 'state') {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (node.object.name === 'state') {
|
|
122
|
+
const sourceCode = context.getSourceCode();
|
|
123
|
+
const rangeStart = node.range[0] - 6; // Longitud de "await "
|
|
124
|
+
const rangeEnd = node.range[0];
|
|
125
|
+
const parentNodeText = sourceCode.getText().substring(rangeStart, rangeEnd);
|
|
126
|
+
if (parentNodeText.includes('await')) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const parentNode = node.parent;
|
|
131
|
+
// Verificar si estamos dentro de un 'addAction' o 'addAnswer'
|
|
132
|
+
if (!isInsideAddActionOrAddAnswer(node)) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
// Verificar si el nodo padre es 'AwaitExpression', de lo contrario se reporta
|
|
136
|
+
if (parentNode.type !== 'AwaitExpression') {
|
|
137
|
+
context.report({
|
|
138
|
+
node,
|
|
139
|
+
message: 'Please use "await" before "state.update"',
|
|
140
|
+
fix: function (fixer) {
|
|
141
|
+
// Comprueba si existe un await antes de state.update
|
|
142
|
+
const sourceCode = context.getSourceCode();
|
|
143
|
+
const rangeStart = node.range[0] - 7; // Longitud de "await "
|
|
144
|
+
const rangeEnd = node.range[0];
|
|
145
|
+
const parentNodeText = sourceCode.getText().substring(rangeStart, rangeEnd);
|
|
146
|
+
if (parentNodeText.trim() !== 'await') {
|
|
147
|
+
return fixer.insertTextBefore(node, 'await ');
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
const processEndFlowWithFlowDynamic = (context) => {
|
|
157
|
+
return {
|
|
158
|
+
'CallExpression[callee.name="endFlow"]'(node) {
|
|
159
|
+
if (!isInsideAddActionOrAddAnswer(node)) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const blockStatement = context
|
|
163
|
+
.getAncestors()
|
|
164
|
+
.find((ancestor) => ancestor.type === 'BlockStatement');
|
|
165
|
+
if (blockStatement) {
|
|
166
|
+
const calleInsideCtx = blockStatement.body.map((j) => j?.expression?.argument?.callee?.name);
|
|
167
|
+
if (calleInsideCtx.includes('flowDynamic')) {
|
|
168
|
+
context.report({
|
|
169
|
+
node,
|
|
170
|
+
message: 'Do not use endFlow in the same execution context as flowDynamic.',
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
const configs = {
|
|
179
|
+
recommended: {
|
|
180
|
+
rules: rulesRecommended,
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
const rules = {
|
|
184
|
+
'func-prefix-goto-flow-return': {
|
|
185
|
+
meta: {
|
|
186
|
+
fixable: 'code',
|
|
187
|
+
},
|
|
188
|
+
create: processGotoFlowReturn,
|
|
189
|
+
},
|
|
190
|
+
'func-prefix-fall-back-return': {
|
|
191
|
+
meta: {
|
|
192
|
+
fixable: 'code',
|
|
193
|
+
},
|
|
194
|
+
create: processFallBackReturn,
|
|
195
|
+
},
|
|
196
|
+
'func-prefix-end-flow-return': {
|
|
197
|
+
meta: {
|
|
198
|
+
fixable: 'code',
|
|
199
|
+
},
|
|
200
|
+
create: processEndFlowReturn,
|
|
201
|
+
},
|
|
202
|
+
'func-prefix-dynamic-flow-await': {
|
|
203
|
+
meta: {
|
|
204
|
+
fixable: 'code',
|
|
205
|
+
},
|
|
206
|
+
create: processDynamicFlowAwait,
|
|
207
|
+
},
|
|
208
|
+
'func-prefix-state-update-await': {
|
|
209
|
+
meta: {
|
|
210
|
+
fixable: 'code',
|
|
211
|
+
},
|
|
212
|
+
create: processStateUpdateAwait,
|
|
213
|
+
},
|
|
214
|
+
'func-prefix-endflow-flowdynamic': {
|
|
215
|
+
meta: {
|
|
216
|
+
fixable: 'code',
|
|
217
|
+
},
|
|
218
|
+
create: processEndFlowWithFlowDynamic,
|
|
219
|
+
},
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
exports.configs = configs;
|
|
223
|
+
exports.rules = rules;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
declare const configs: {
|
|
2
|
+
recommended: {
|
|
3
|
+
rules: {
|
|
4
|
+
'bot-whatsapp/func-prefix-goto-flow-return': number;
|
|
5
|
+
'bot-whatsapp/func-prefix-end-flow-return': number;
|
|
6
|
+
'bot-whatsapp/func-prefix-dynamic-flow-await': number;
|
|
7
|
+
'bot-whatsapp/func-prefix-state-update-await': number;
|
|
8
|
+
'bot-whatsapp/func-prefix-fall-back-return': number;
|
|
9
|
+
'bot-whatsapp/func-prefix-endflow-flowdynamic': number;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
declare const rules: {
|
|
14
|
+
'func-prefix-goto-flow-return': {
|
|
15
|
+
meta: {
|
|
16
|
+
fixable: string;
|
|
17
|
+
};
|
|
18
|
+
create: (context: import("./types").Context) => {
|
|
19
|
+
'CallExpression[callee.name="gotoFlow"]'(node: import("./types").INode): void;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
'func-prefix-fall-back-return': {
|
|
23
|
+
meta: {
|
|
24
|
+
fixable: string;
|
|
25
|
+
};
|
|
26
|
+
create: (context: import("./types").Context) => {
|
|
27
|
+
'CallExpression[callee.name="fallBack"]'(node: import("./types").INode): void;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
'func-prefix-end-flow-return': {
|
|
31
|
+
meta: {
|
|
32
|
+
fixable: string;
|
|
33
|
+
};
|
|
34
|
+
create: (context: import("./types").Context) => {
|
|
35
|
+
'CallExpression[callee.name="endFlow"]'(node: import("./types").INode): void;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
'func-prefix-dynamic-flow-await': {
|
|
39
|
+
meta: {
|
|
40
|
+
fixable: string;
|
|
41
|
+
};
|
|
42
|
+
create: (context: import("./types").Context) => {
|
|
43
|
+
'CallExpression[callee.name="flowDynamic"]'(node: import("./types").INode): void;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
'func-prefix-state-update-await': {
|
|
47
|
+
meta: {
|
|
48
|
+
fixable: string;
|
|
49
|
+
};
|
|
50
|
+
create: (context: any) => {
|
|
51
|
+
'MemberExpression[property.name="update"]'(node: any): void;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
'func-prefix-endflow-flowdynamic': {
|
|
55
|
+
meta: {
|
|
56
|
+
fixable: string;
|
|
57
|
+
};
|
|
58
|
+
create: (context: import("./types").Context) => {
|
|
59
|
+
'CallExpression[callee.name="endFlow"]'(node: import("./types").INode): void;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export { rules, configs };
|
|
64
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,QAAA,MAAM,OAAO;;;;;;;;;;;CAIZ,CAAA;AACD,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCV,CAAA;AAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { processDynamicFlowAwait } from './processDynamicFlowAwait';
|
|
2
|
+
export { processEndFlowReturn } from './processEndFlowReturn';
|
|
3
|
+
export { processFallBackReturn } from './processFallBackReturn';
|
|
4
|
+
export { processGotoFlowReturn } from './processGotoFlowReturn';
|
|
5
|
+
export { processStateUpdateAwait } from './processStateUpdateAwait';
|
|
6
|
+
export { processEndFlowWithFlowDynamic } from './processEndFlowWithFlowDynamic';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Context, INode } from '../types';
|
|
2
|
+
declare const processDynamicFlowAwait: (context: Context) => {
|
|
3
|
+
'CallExpression[callee.name="flowDynamic"]'(node: INode): void;
|
|
4
|
+
};
|
|
5
|
+
export { processDynamicFlowAwait };
|
|
6
|
+
//# sourceMappingURL=processDynamicFlowAwait.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processDynamicFlowAwait.d.ts","sourceRoot":"","sources":["../../src/rules/processDynamicFlowAwait.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAGzC,QAAA,MAAM,uBAAuB,YAAa,OAAO;sDAES,KAAK;CAoB9D,CAAA;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processEndFlowReturn.d.ts","sourceRoot":"","sources":["../../src/rules/processEndFlowReturn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAGzC,QAAA,MAAM,oBAAoB,YAAa,OAAO;kDAEQ,KAAK;CAoB1D,CAAA;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { INode, Context } from '../types';
|
|
2
|
+
declare const processEndFlowWithFlowDynamic: (context: Context) => {
|
|
3
|
+
'CallExpression[callee.name="endFlow"]'(node: INode): void;
|
|
4
|
+
};
|
|
5
|
+
export { processEndFlowWithFlowDynamic };
|
|
6
|
+
//# sourceMappingURL=processEndFlowWithFlowDynamic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processEndFlowWithFlowDynamic.d.ts","sourceRoot":"","sources":["../../src/rules/processEndFlowWithFlowDynamic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAGzC,QAAA,MAAM,6BAA6B,YAAa,OAAO;kDAED,KAAK;CAsB1D,CAAA;AAED,OAAO,EAAE,6BAA6B,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processFallBackReturn.d.ts","sourceRoot":"","sources":["../../src/rules/processFallBackReturn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAGzC,QAAA,MAAM,qBAAqB,YAAa,OAAO;mDAEQ,KAAK;CAoB3D,CAAA;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processGotoFlowReturn.d.ts","sourceRoot":"","sources":["../../src/rules/processGotoFlowReturn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAGzC,QAAA,MAAM,qBAAqB,YAAa,OAAO;mDAEQ,KAAK;CAoB3D,CAAA;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processStateUpdateAwait.d.ts","sourceRoot":"","sources":["../../src/rules/processStateUpdateAwait.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,uBAAuB,YAAa,GAAG;qDAEY,GAAG;CAyC3D,CAAA;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAA"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface INode {
|
|
2
|
+
type: string;
|
|
3
|
+
callee?: {
|
|
4
|
+
name: string;
|
|
5
|
+
property?: {
|
|
6
|
+
name?: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
arguments?: any;
|
|
10
|
+
parent?: Parent;
|
|
11
|
+
}
|
|
12
|
+
export interface Parent {
|
|
13
|
+
arguments: any;
|
|
14
|
+
type: string;
|
|
15
|
+
callee?: {
|
|
16
|
+
property?: {
|
|
17
|
+
name?: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export interface ReportOptions {
|
|
22
|
+
node: INode;
|
|
23
|
+
message: string;
|
|
24
|
+
fix?: (fixer: any) => void;
|
|
25
|
+
}
|
|
26
|
+
export interface Context {
|
|
27
|
+
getAncestors?: () => any;
|
|
28
|
+
report: (options: ReportOptions) => void;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,KAAK;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE;QACL,IAAI,EAAE,MAAM,CAAA;QACZ,QAAQ,CAAC,EAAE;YACP,IAAI,CAAC,EAAE,MAAM,CAAA;SAChB,CAAA;KACJ,CAAA;IACD,SAAS,CAAC,EAAE,GAAG,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,MAAM;IACnB,SAAS,EAAE,GAAG,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE;QACL,QAAQ,CAAC,EAAE;YACP,IAAI,CAAC,EAAE,MAAM,CAAA;SAChB,CAAA;KACJ,CAAA;CACJ;AAED,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,KAAK,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;CAC7B;AAED,MAAM,WAAW,OAAO;IACpB,YAAY,CAAC,EAAE,MAAM,GAAG,CAAA;IACxB,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAA;CAC3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isInsideAddActionOrAddAnswer.d.ts","sourceRoot":"","sources":["../../src/utils/isInsideAddActionOrAddAnswer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAEhC,iBAAS,4BAA4B,CAAC,IAAI,EAAE,KAAK,WAchD;AAED,OAAO,EAAE,4BAA4B,EAAE,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "eslint-plugin-builderbot",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "> TODO: description",
|
|
5
|
+
"author": "vicente1992 <vic_ortiz20@hotmail.es>",
|
|
6
|
+
"homepage": "https://github.com/vicente1992/bot-whatsapp#readme",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"main": "dist/index.cjs",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"type": "module",
|
|
11
|
+
"directories": {
|
|
12
|
+
"src": "src",
|
|
13
|
+
"test": "__tests__"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"./dist/"
|
|
17
|
+
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/vicente1992/bot-whatsapp.git"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "rimraf dist && rollup --config",
|
|
24
|
+
"test": " npx uvu -r tsm ./__tests__ .test.ts",
|
|
25
|
+
"test:coverage": "npx c8 npm run test",
|
|
26
|
+
"test:debug": " npx tsm --inspect-brk ../../node_modules/uvu/bin.js ./__tests__ .test.ts"
|
|
27
|
+
},
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/vicente1992/bot-whatsapp/issues"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
33
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
34
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
35
|
+
"@types/eslint": "^8.56.2",
|
|
36
|
+
"@types/node": "^20.11.0",
|
|
37
|
+
"@types/sinon": "^17.0.3",
|
|
38
|
+
"kleur": "^4.1.5",
|
|
39
|
+
"rimraf": "^3.0.2",
|
|
40
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
41
|
+
"sinon": "^17.0.1",
|
|
42
|
+
"tslib": "^2.6.2",
|
|
43
|
+
"tsm": "^2.3.0"
|
|
44
|
+
},
|
|
45
|
+
"gitHead": "f21e49621dffad2a1226aecea535668016f07b14"
|
|
46
|
+
}
|