@pobammer-ts/eslint-cease-nonsense-rules 1.0.0 → 1.0.1
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/configure-utilities.d.ts +68 -0
- package/dist/configure-utilities.js +116 -0
- package/dist/configure-utilities.js.map +1 -0
- package/dist/rules/prefer-udim2-shorthand.js +44 -70
- package/dist/rules/prefer-udim2-shorthand.js.map +1 -1
- package/dist/rules/require-paired-calls.d.ts +41 -0
- package/dist/rules/require-paired-calls.js +706 -0
- package/dist/rules/require-paired-calls.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { ComplexityConfiguration } from "./rules/enforce-ianitor-check-type";
|
|
2
|
+
import type { NoInstanceMethodsOptions } from "./rules/no-instance-methods-without-this";
|
|
3
|
+
import type { NoShorthandOptions } from "./rules/no-shorthand-names";
|
|
4
|
+
import type { EffectFunctionOptions, HookConfiguration } from "./rules/require-named-effect-functions";
|
|
5
|
+
import type { PairConfiguration, RequirePairedCallsOptions } from "./rules/require-paired-calls";
|
|
6
|
+
import type { ReactKeysOptions } from "./rules/require-react-component-keys";
|
|
7
|
+
import type { UseExhaustiveDependenciesOptions } from "./rules/use-exhaustive-dependencies";
|
|
8
|
+
/**
|
|
9
|
+
* Creates a pair configuration for require-paired-calls rule
|
|
10
|
+
* @param opener - The opener function name
|
|
11
|
+
* @param closer - The closer function name(s)
|
|
12
|
+
* @param options - Additional options
|
|
13
|
+
* @returns The pair configuration
|
|
14
|
+
*/
|
|
15
|
+
export declare function createPairConfiguration(opener: string, closer: string | ReadonlyArray<string>, options?: Partial<Omit<PairConfiguration, "opener" | "closer">>): PairConfiguration;
|
|
16
|
+
/**
|
|
17
|
+
* Default Roblox profiling pair configuration
|
|
18
|
+
*/
|
|
19
|
+
export declare const defaultRobloxProfilePair: PairConfiguration;
|
|
20
|
+
/**
|
|
21
|
+
* Creates a complexity configuration for enforce-ianitor-check-type rule
|
|
22
|
+
* @param options - Partial configuration options
|
|
23
|
+
* @returns The full complexity configuration
|
|
24
|
+
*/
|
|
25
|
+
export declare function createComplexityConfiguration(options?: Partial<ComplexityConfiguration>): ComplexityConfiguration;
|
|
26
|
+
/**
|
|
27
|
+
* Creates a no-instance-methods options for no-instance-methods-without-this rule
|
|
28
|
+
* @param options - Partial configuration options
|
|
29
|
+
* @returns The full options
|
|
30
|
+
*/
|
|
31
|
+
export declare function createNoInstanceMethodsOptions(options?: Partial<NoInstanceMethodsOptions>): NoInstanceMethodsOptions;
|
|
32
|
+
/**
|
|
33
|
+
* Creates a no-shorthand options for no-shorthand-names rule
|
|
34
|
+
* @param options - Partial configuration options
|
|
35
|
+
* @returns The full options
|
|
36
|
+
*/
|
|
37
|
+
export declare function createNoShorthandOptions(options?: Partial<NoShorthandOptions>): NoShorthandOptions;
|
|
38
|
+
/**
|
|
39
|
+
* Creates an effect function options for require-named-effect-functions rule
|
|
40
|
+
* @param options - Partial configuration options
|
|
41
|
+
* @returns The full options
|
|
42
|
+
*/
|
|
43
|
+
export declare function createEffectFunctionOptions(options?: Partial<EffectFunctionOptions>): EffectFunctionOptions;
|
|
44
|
+
/**
|
|
45
|
+
* Creates a hook configuration for require-named-effect-functions rule
|
|
46
|
+
* @param name - The hook name
|
|
47
|
+
* @param options - Partial configuration options
|
|
48
|
+
* @returns The full hook configuration
|
|
49
|
+
*/
|
|
50
|
+
export declare function createHookConfiguration(name: string, options?: Partial<Omit<HookConfiguration, "name">>): HookConfiguration;
|
|
51
|
+
/**
|
|
52
|
+
* Creates a require-paired-calls options for require-paired-calls rule
|
|
53
|
+
* @param options - Partial configuration options
|
|
54
|
+
* @returns The full options
|
|
55
|
+
*/
|
|
56
|
+
export declare function createRequirePairedCallsOptions(options?: Partial<RequirePairedCallsOptions>): RequirePairedCallsOptions;
|
|
57
|
+
/**
|
|
58
|
+
* Creates a react keys options for require-react-component-keys rule
|
|
59
|
+
* @param options - Partial configuration options
|
|
60
|
+
* @returns The full options
|
|
61
|
+
*/
|
|
62
|
+
export declare function createReactKeysOptions(options?: Partial<ReactKeysOptions>): ReactKeysOptions;
|
|
63
|
+
/**
|
|
64
|
+
* Creates a use-exhaustive-dependencies options for use-exhaustive-dependencies rule
|
|
65
|
+
* @param options - Partial configuration options
|
|
66
|
+
* @returns The full options
|
|
67
|
+
*/
|
|
68
|
+
export declare function createUseExhaustiveDependenciesOptions(options?: Partial<UseExhaustiveDependenciesOptions>): UseExhaustiveDependenciesOptions;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a pair configuration for require-paired-calls rule
|
|
3
|
+
* @param opener - The opener function name
|
|
4
|
+
* @param closer - The closer function name(s)
|
|
5
|
+
* @param options - Additional options
|
|
6
|
+
* @returns The pair configuration
|
|
7
|
+
*/
|
|
8
|
+
export function createPairConfiguration(opener, closer, options = {}) {
|
|
9
|
+
return { closer, opener, ...options };
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Default Roblox profiling pair configuration
|
|
13
|
+
*/
|
|
14
|
+
export const defaultRobloxProfilePair = {
|
|
15
|
+
closer: "debug.profileend",
|
|
16
|
+
opener: "debug.profilebegin",
|
|
17
|
+
platform: "roblox",
|
|
18
|
+
requireSync: true,
|
|
19
|
+
yieldingFunctions: ["task.wait", "wait", "*.WaitForChild"],
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Creates a complexity configuration for enforce-ianitor-check-type rule
|
|
23
|
+
* @param options - Partial configuration options
|
|
24
|
+
* @returns The full complexity configuration
|
|
25
|
+
*/
|
|
26
|
+
export function createComplexityConfiguration(options = {}) {
|
|
27
|
+
return {
|
|
28
|
+
baseThreshold: 10,
|
|
29
|
+
errorThreshold: 25,
|
|
30
|
+
interfacePenalty: 20,
|
|
31
|
+
performanceMode: true,
|
|
32
|
+
warnThreshold: 15,
|
|
33
|
+
...options,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Creates a no-instance-methods options for no-instance-methods-without-this rule
|
|
38
|
+
* @param options - Partial configuration options
|
|
39
|
+
* @returns The full options
|
|
40
|
+
*/
|
|
41
|
+
export function createNoInstanceMethodsOptions(options = {}) {
|
|
42
|
+
return {
|
|
43
|
+
checkPrivate: false,
|
|
44
|
+
checkProtected: false,
|
|
45
|
+
checkPublic: false,
|
|
46
|
+
...options,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Creates a no-shorthand options for no-shorthand-names rule
|
|
51
|
+
* @param options - Partial configuration options
|
|
52
|
+
* @returns The full options
|
|
53
|
+
*/
|
|
54
|
+
export function createNoShorthandOptions(options = {}) {
|
|
55
|
+
return { allowPropertyAccess: [], shorthands: {}, ...options };
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Creates an effect function options for require-named-effect-functions rule
|
|
59
|
+
* @param options - Partial configuration options
|
|
60
|
+
* @returns The full options
|
|
61
|
+
*/
|
|
62
|
+
export function createEffectFunctionOptions(options = {}) {
|
|
63
|
+
return { environment: "standard", hooks: [], ...options };
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Creates a hook configuration for require-named-effect-functions rule
|
|
67
|
+
* @param name - The hook name
|
|
68
|
+
* @param options - Partial configuration options
|
|
69
|
+
* @returns The full hook configuration
|
|
70
|
+
*/
|
|
71
|
+
export function createHookConfiguration(name, options = {}) {
|
|
72
|
+
return { allowAsync: false, name, ...options };
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Creates a require-paired-calls options for require-paired-calls rule
|
|
76
|
+
* @param options - Partial configuration options
|
|
77
|
+
* @returns The full options
|
|
78
|
+
*/
|
|
79
|
+
export function createRequirePairedCallsOptions(options = {}) {
|
|
80
|
+
return {
|
|
81
|
+
allowConditionalClosers: false,
|
|
82
|
+
allowMultipleOpeners: true,
|
|
83
|
+
maxNestingDepth: 0,
|
|
84
|
+
pairs: [],
|
|
85
|
+
scope: "function",
|
|
86
|
+
...options,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Creates a react keys options for require-react-component-keys rule
|
|
91
|
+
* @param options - Partial configuration options
|
|
92
|
+
* @returns The full options
|
|
93
|
+
*/
|
|
94
|
+
export function createReactKeysOptions(options = {}) {
|
|
95
|
+
return {
|
|
96
|
+
allowRootKeys: false,
|
|
97
|
+
ignoreCallExpressions: [],
|
|
98
|
+
iterationMethods: ["map", "forEach", "filter"],
|
|
99
|
+
memoizationHooks: ["useMemo", "useCallback"],
|
|
100
|
+
...options,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Creates a use-exhaustive-dependencies options for use-exhaustive-dependencies rule
|
|
105
|
+
* @param options - Partial configuration options
|
|
106
|
+
* @returns The full options
|
|
107
|
+
*/
|
|
108
|
+
export function createUseExhaustiveDependenciesOptions(options = {}) {
|
|
109
|
+
return {
|
|
110
|
+
hooks: [],
|
|
111
|
+
reportMissingDependenciesArray: false,
|
|
112
|
+
reportUnnecessaryDependencies: false,
|
|
113
|
+
...options,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=configure-utilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configure-utilities.js","sourceRoot":"","sources":["../src/configure-utilities.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACtC,MAAc,EACd,MAAsC,EACtC,OAAO,GAA0D,EAAE,EAC/C;IACpB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC;AAAA,CACtC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAsB;IAC1D,MAAM,EAAE,kBAAkB;IAC1B,MAAM,EAAE,oBAAoB;IAC5B,QAAQ,EAAE,QAAQ;IAClB,WAAW,EAAE,IAAI;IACjB,iBAAiB,EAAE,CAAC,WAAW,EAAE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AG,OAAO;KACV,CAAC;AAAA,CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAO,GAA8B,EAAE,EAAoB;IACjG,OAAO;QACN,aAAa,EAAE,KAAK;QACpB,qBAAqB,EAAE,EAAE;QACzB,gBAAgB,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC;QAC9C,gBAAgB,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC;QAC5C,GAAG,OAAO;KACV,CAAC;AAAA,CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,sCAAsC,CACrD,OAAO,GAA8C,EAAE,EACpB;IACnC,OAAO;QACN,KAAK,EAAE,EAAE;QACT,8BAA8B,EAAE,KAAK;QACrC,6BAA6B,EAAE,KAAK;QACpC,GAAG,OAAO;KACV,CAAC;AAAA,CACF"}
|
|
@@ -5,43 +5,40 @@ function isNumber(value) {
|
|
|
5
5
|
function isRecord(node) {
|
|
6
6
|
return typeof node === "object" && node !== null;
|
|
7
7
|
}
|
|
8
|
-
function hasTypeProperty(
|
|
9
|
-
return "type" in
|
|
8
|
+
function hasTypeProperty(object) {
|
|
9
|
+
return "type" in object;
|
|
10
10
|
}
|
|
11
|
+
const OPERATORS = new Set(["+", "-", "*", "/", "%"]);
|
|
11
12
|
function reconstructText(node) {
|
|
12
13
|
const nodeType = node.type;
|
|
13
14
|
if (nodeType === TSESTree.AST_NODE_TYPES.Literal) {
|
|
14
|
-
const value = node
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const { value } = node;
|
|
16
|
+
return isNumber(value) ? String(value) : undefined;
|
|
17
|
+
}
|
|
18
|
+
if (nodeType === TSESTree.AST_NODE_TYPES.Identifier) {
|
|
19
|
+
const { name } = node;
|
|
20
|
+
return typeof name === "string" ? name : undefined;
|
|
19
21
|
}
|
|
20
22
|
if (nodeType === TSESTree.AST_NODE_TYPES.UnaryExpression) {
|
|
21
|
-
const operator = node
|
|
23
|
+
const { operator } = node;
|
|
22
24
|
if (typeof operator !== "string")
|
|
23
25
|
return undefined;
|
|
24
|
-
const argument = node
|
|
26
|
+
const { argument } = node;
|
|
25
27
|
if (!isRecord(argument))
|
|
26
28
|
return undefined;
|
|
27
|
-
const
|
|
28
|
-
return
|
|
29
|
+
const text = reconstructText(argument);
|
|
30
|
+
return text === undefined ? undefined : `${operator}${text}`;
|
|
29
31
|
}
|
|
30
32
|
if (nodeType === TSESTree.AST_NODE_TYPES.BinaryExpression) {
|
|
31
|
-
const operator = node
|
|
32
|
-
if (typeof operator !== "string")
|
|
33
|
+
const { operator } = node;
|
|
34
|
+
if (typeof operator !== "string" || !OPERATORS.has(operator))
|
|
33
35
|
return undefined;
|
|
34
|
-
const left = node
|
|
35
|
-
|
|
36
|
-
if (!isRecord(left) || !isRecord(right)) {
|
|
36
|
+
const { left, right } = node;
|
|
37
|
+
if (!isRecord(left) || !isRecord(right))
|
|
37
38
|
return undefined;
|
|
38
|
-
}
|
|
39
39
|
const leftText = reconstructText(left);
|
|
40
40
|
const rightText = reconstructText(right);
|
|
41
|
-
|
|
42
|
-
return undefined;
|
|
43
|
-
}
|
|
44
|
-
return `${leftText} ${operator} ${rightText}`;
|
|
41
|
+
return leftText === undefined || rightText === undefined ? undefined : `${leftText} ${operator} ${rightText}`;
|
|
45
42
|
}
|
|
46
43
|
return undefined;
|
|
47
44
|
}
|
|
@@ -50,29 +47,24 @@ function evaluateExpression(node) {
|
|
|
50
47
|
return undefined;
|
|
51
48
|
const nodeType = node.type;
|
|
52
49
|
if (nodeType === TSESTree.AST_NODE_TYPES.Literal) {
|
|
53
|
-
const value = node
|
|
54
|
-
|
|
55
|
-
return value;
|
|
56
|
-
return undefined;
|
|
50
|
+
const { value } = node;
|
|
51
|
+
return isNumber(value) ? value : undefined;
|
|
57
52
|
}
|
|
58
53
|
if (nodeType === TSESTree.AST_NODE_TYPES.UnaryExpression) {
|
|
59
|
-
const operator = node
|
|
60
|
-
const argument = node.argument;
|
|
54
|
+
const { argument, operator } = node;
|
|
61
55
|
if (typeof argument === "object" && argument !== null) {
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
56
|
+
const value = evaluateExpression(argument);
|
|
57
|
+
if (value === undefined)
|
|
64
58
|
return undefined;
|
|
65
59
|
if (operator === "-")
|
|
66
|
-
return -
|
|
60
|
+
return -value;
|
|
67
61
|
if (operator === "+")
|
|
68
|
-
return
|
|
62
|
+
return value;
|
|
69
63
|
}
|
|
70
64
|
return undefined;
|
|
71
65
|
}
|
|
72
66
|
if (nodeType === TSESTree.AST_NODE_TYPES.BinaryExpression) {
|
|
73
|
-
const left = node
|
|
74
|
-
const right = node.right;
|
|
75
|
-
const operator = node.operator;
|
|
67
|
+
const { right, left, operator } = node;
|
|
76
68
|
if (typeof left === "object" && left !== null && typeof right === "object" && right !== null) {
|
|
77
69
|
const leftValue = evaluateExpression(left);
|
|
78
70
|
const rightValue = evaluateExpression(right);
|
|
@@ -85,16 +77,10 @@ function evaluateExpression(node) {
|
|
|
85
77
|
return leftValue - rightValue;
|
|
86
78
|
case "*":
|
|
87
79
|
return leftValue * rightValue;
|
|
88
|
-
case "/":
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return leftValue
|
|
92
|
-
}
|
|
93
|
-
case "%": {
|
|
94
|
-
if (rightValue === 0)
|
|
95
|
-
return undefined;
|
|
96
|
-
return leftValue % rightValue;
|
|
97
|
-
}
|
|
80
|
+
case "/":
|
|
81
|
+
return rightValue === 0 ? undefined : leftValue / rightValue;
|
|
82
|
+
case "%":
|
|
83
|
+
return rightValue === 0 ? undefined : leftValue % rightValue;
|
|
98
84
|
default:
|
|
99
85
|
return undefined;
|
|
100
86
|
}
|
|
@@ -103,41 +89,25 @@ function evaluateExpression(node) {
|
|
|
103
89
|
}
|
|
104
90
|
return undefined;
|
|
105
91
|
}
|
|
106
|
-
function
|
|
92
|
+
function collectArguments(_context, parameters) {
|
|
107
93
|
if (parameters.length !== 4)
|
|
108
94
|
return undefined;
|
|
109
|
-
const values = [undefined, undefined, undefined, undefined];
|
|
110
95
|
const texts = [undefined, undefined, undefined, undefined];
|
|
111
|
-
for (let
|
|
112
|
-
const parameter = parameters[
|
|
113
|
-
if (!isRecord(parameter))
|
|
96
|
+
for (let index = 0; index < 4; index++) {
|
|
97
|
+
const parameter = parameters[index];
|
|
98
|
+
if (!isRecord(parameter) || !hasTypeProperty(parameter))
|
|
114
99
|
return undefined;
|
|
115
|
-
if (
|
|
100
|
+
if (parameter.type === TSESTree.AST_NODE_TYPES.SpreadElement)
|
|
116
101
|
return undefined;
|
|
117
|
-
if (parameter.type === "SpreadElement")
|
|
118
|
-
return undefined;
|
|
119
|
-
const value = evaluateExpression(parameter);
|
|
120
|
-
if (value === undefined)
|
|
121
|
-
return undefined;
|
|
122
|
-
values[i] = value;
|
|
123
102
|
const text = reconstructText(parameter);
|
|
124
103
|
if (text === undefined)
|
|
125
104
|
return undefined;
|
|
126
|
-
texts[
|
|
105
|
+
texts[index] = text;
|
|
127
106
|
}
|
|
128
|
-
const [scaleX, offsetX, scaleY, offsetY] = values;
|
|
129
107
|
const [scaleXText, offsetXText, scaleYText, offsetYText] = texts;
|
|
130
|
-
if (
|
|
131
|
-
offsetX === undefined ||
|
|
132
|
-
scaleY === undefined ||
|
|
133
|
-
offsetY === undefined ||
|
|
134
|
-
scaleXText === undefined ||
|
|
135
|
-
offsetXText === undefined ||
|
|
136
|
-
scaleYText === undefined ||
|
|
137
|
-
offsetYText === undefined) {
|
|
108
|
+
if (scaleXText === undefined || offsetXText === undefined || scaleYText === undefined || offsetYText === undefined)
|
|
138
109
|
return undefined;
|
|
139
|
-
}
|
|
140
|
-
return { offsetX, offsetXText, offsetY, offsetYText, scaleX, scaleXText, scaleY, scaleYText };
|
|
110
|
+
return { offsetXText, offsetYText, scaleXText, scaleYText };
|
|
141
111
|
}
|
|
142
112
|
const preferUDim2Shorthand = {
|
|
143
113
|
create(context) {
|
|
@@ -145,10 +115,14 @@ const preferUDim2Shorthand = {
|
|
|
145
115
|
NewExpression(node) {
|
|
146
116
|
if (node.callee.type !== TSESTree.AST_NODE_TYPES.Identifier || node.callee.name !== "UDim2")
|
|
147
117
|
return;
|
|
148
|
-
const collected =
|
|
118
|
+
const collected = collectArguments(context, node.arguments);
|
|
149
119
|
if (!collected)
|
|
150
120
|
return;
|
|
151
|
-
const {
|
|
121
|
+
const { offsetXText, offsetYText, scaleXText, scaleYText } = collected;
|
|
122
|
+
const scaleX = evaluateExpression(node.arguments[0]);
|
|
123
|
+
const offsetX = evaluateExpression(node.arguments[1]);
|
|
124
|
+
const scaleY = evaluateExpression(node.arguments[2]);
|
|
125
|
+
const offsetY = evaluateExpression(node.arguments[3]);
|
|
152
126
|
if (scaleX === 0 && offsetX === 0 && scaleY === 0 && offsetY === 0)
|
|
153
127
|
return;
|
|
154
128
|
if (offsetX === 0 && offsetY === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-udim2-shorthand.js","sourceRoot":"","sources":["../../src/rules/prefer-udim2-shorthand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"prefer-udim2-shorthand.js","sourceRoot":"","sources":["../../src/rules/prefer-udim2-shorthand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAYpD,SAAS,QAAQ,CAAC,KAAc;IAC/B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,QAAQ,CAAC,IAAa;IAC9B,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,CAAC;AAClD,CAAC;AACD,SAAS,eAAe,CACvB,MAAoC;IAEpC,OAAO,MAAM,IAAI,MAAM,CAAC;AACzB,CAAC;AAED,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC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E,kBAAkB;wBAC7B,IAAI;qBACJ,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC;SACD,CAAC;IACH,CAAC;IACD,IAAI,EAAE;QACL,IAAI,EAAE;YACL,WAAW,EACV,0GAA0G;YAC3G,WAAW,EAAE,IAAI;SACjB;QACD,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE;YACT,gBAAgB,EACf,8GAA8G;YAC/G,eAAe,EACd,6GAA6G;SAC9G;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,YAAY;KAClB;CACD,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Rule } from "eslint";
|
|
2
|
+
import Type from "typebox";
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for a single opener/closer pair
|
|
5
|
+
*/
|
|
6
|
+
export interface PairConfiguration {
|
|
7
|
+
/** Opener function name (e.g., "debug.profilebegin") */
|
|
8
|
+
readonly opener: string;
|
|
9
|
+
/** Closer function name(s) - single or alternatives */
|
|
10
|
+
readonly closer: string | ReadonlyArray<string>;
|
|
11
|
+
/** Alternative closers (any one satisfies) */
|
|
12
|
+
readonly alternatives?: ReadonlyArray<string>;
|
|
13
|
+
/** All listed closers must be called */
|
|
14
|
+
readonly requireAll?: ReadonlyArray<string>;
|
|
15
|
+
/** Disallow await/yield between opener and closer */
|
|
16
|
+
readonly requireSync?: boolean;
|
|
17
|
+
/** Platform-specific behavior */
|
|
18
|
+
readonly platform?: "roblox";
|
|
19
|
+
/** Custom yielding function patterns (for Roblox) */
|
|
20
|
+
readonly yieldingFunctions?: ReadonlyArray<string>;
|
|
21
|
+
}
|
|
22
|
+
declare const isScope: import("typebox/compile").Validator<{}, Type.TUnion<[Type.TLiteral<"function">, Type.TLiteral<"block">, Type.TLiteral<"file">]>>;
|
|
23
|
+
export type Scope = Type.Static<typeof isScope>;
|
|
24
|
+
/**
|
|
25
|
+
* Rule options schema
|
|
26
|
+
*/
|
|
27
|
+
export interface RequirePairedCallsOptions {
|
|
28
|
+
/** Array of paired function configurations */
|
|
29
|
+
readonly pairs: ReadonlyArray<PairConfiguration>;
|
|
30
|
+
/** Scope for balance checking */
|
|
31
|
+
readonly scope?: Scope;
|
|
32
|
+
/** Allow conditional closers */
|
|
33
|
+
readonly allowConditionalClosers?: boolean;
|
|
34
|
+
/** Allow multiple consecutive openers */
|
|
35
|
+
readonly allowMultipleOpeners?: boolean;
|
|
36
|
+
/** Maximum nesting depth (0 = unlimited) */
|
|
37
|
+
readonly maxNestingDepth?: number;
|
|
38
|
+
}
|
|
39
|
+
export declare const DEFAULT_ROBLOX_YIELDING_FUNCTIONS: readonly ["task.wait", "wait", "*.WaitForChild"];
|
|
40
|
+
declare const rule: Rule.RuleModule;
|
|
41
|
+
export default rule;
|
|
@@ -0,0 +1,706 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from "@typescript-eslint/types";
|
|
2
|
+
import Type from "typebox";
|
|
3
|
+
import { Compile } from "typebox/compile";
|
|
4
|
+
const isStringArray = Compile(Type.Readonly(Type.Array(Type.String())));
|
|
5
|
+
const isPairConfiguration = Compile(Type.Readonly(Type.Object({
|
|
6
|
+
alternatives: Type.Optional(isStringArray),
|
|
7
|
+
closer: Type.Union([Type.String(), isStringArray]),
|
|
8
|
+
opener: Type.String(),
|
|
9
|
+
platform: Type.Optional(Type.Literal("roblox")),
|
|
10
|
+
requireAll: Type.Optional(isStringArray),
|
|
11
|
+
requireSync: Type.Optional(Type.Boolean()),
|
|
12
|
+
yieldingFunctions: Type.Optional(isStringArray),
|
|
13
|
+
})));
|
|
14
|
+
const isScope = Compile(Type.Union([Type.Literal("function"), Type.Literal("block"), Type.Literal("file")]));
|
|
15
|
+
const isRuleOptions = Compile(Type.Partial(Type.Readonly(Type.Object({
|
|
16
|
+
allowConditionalClosers: Type.Optional(Type.Boolean()),
|
|
17
|
+
allowMultipleOpeners: Type.Optional(Type.Boolean()),
|
|
18
|
+
maxNestingDepth: Type.Optional(Type.Number()),
|
|
19
|
+
pairs: Type.Readonly(Type.Array(isPairConfiguration)),
|
|
20
|
+
scope: Type.Optional(isScope),
|
|
21
|
+
}))));
|
|
22
|
+
export const DEFAULT_ROBLOX_YIELDING_FUNCTIONS = ["task.wait", "wait", "*.WaitForChild"];
|
|
23
|
+
function getCallName(node) {
|
|
24
|
+
const { callee } = node;
|
|
25
|
+
if (callee.type === AST_NODE_TYPES.Identifier)
|
|
26
|
+
return callee.name;
|
|
27
|
+
if (callee.type === AST_NODE_TYPES.MemberExpression) {
|
|
28
|
+
const object = callee.object.type === AST_NODE_TYPES.Identifier ? callee.object.name : undefined;
|
|
29
|
+
const property = callee.property.type === AST_NODE_TYPES.Identifier ? callee.property.name : undefined;
|
|
30
|
+
if (object !== undefined && property !== undefined)
|
|
31
|
+
return `${object}.${property}`;
|
|
32
|
+
}
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
function getValidClosers(configuration) {
|
|
36
|
+
const result = new Array();
|
|
37
|
+
if (isStringArray.Check(configuration.closer))
|
|
38
|
+
result.push(...configuration.closer);
|
|
39
|
+
else if (typeof configuration.closer === "string")
|
|
40
|
+
result.push(configuration.closer);
|
|
41
|
+
if (configuration.alternatives)
|
|
42
|
+
for (const alternative of configuration.alternatives)
|
|
43
|
+
result.push(alternative);
|
|
44
|
+
if (configuration.requireAll)
|
|
45
|
+
for (const requirement of configuration.requireAll)
|
|
46
|
+
result.push(requirement);
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
function cloneEntry(value) {
|
|
50
|
+
return { ...value };
|
|
51
|
+
}
|
|
52
|
+
const rule = {
|
|
53
|
+
create(context) {
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- ESLint context.options is typed as any[]
|
|
55
|
+
const rawOptions = context.options[0];
|
|
56
|
+
const baseOptions = isRuleOptions.Check(rawOptions) ? rawOptions : {};
|
|
57
|
+
const options = {
|
|
58
|
+
allowConditionalClosers: baseOptions.allowConditionalClosers ?? false,
|
|
59
|
+
allowMultipleOpeners: baseOptions.allowMultipleOpeners ?? true,
|
|
60
|
+
maxNestingDepth: baseOptions.maxNestingDepth ?? 0,
|
|
61
|
+
pairs: baseOptions.pairs ?? [],
|
|
62
|
+
scope: baseOptions.scope ?? "function",
|
|
63
|
+
};
|
|
64
|
+
if (options.pairs.length === 0) {
|
|
65
|
+
options.pairs = [
|
|
66
|
+
{
|
|
67
|
+
closer: "debug.profileend",
|
|
68
|
+
opener: "debug.profilebegin",
|
|
69
|
+
platform: "roblox",
|
|
70
|
+
requireSync: true,
|
|
71
|
+
yieldingFunctions: [...DEFAULT_ROBLOX_YIELDING_FUNCTIONS],
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
}
|
|
75
|
+
const openerStack = new Array();
|
|
76
|
+
let stackIndexCounter = 0;
|
|
77
|
+
const functionStacks = new Array();
|
|
78
|
+
let yieldingAutoClosed = false;
|
|
79
|
+
let yieldingReportedFirst = false;
|
|
80
|
+
const contextStack = new Array();
|
|
81
|
+
const stackSnapshots = new Map();
|
|
82
|
+
const branchStacks = new Map();
|
|
83
|
+
function getCurrentContext() {
|
|
84
|
+
return contextStack.length > 0
|
|
85
|
+
? contextStack.at(-1)
|
|
86
|
+
: {
|
|
87
|
+
asyncContext: false,
|
|
88
|
+
currentFunction: undefined,
|
|
89
|
+
hasEarlyExit: false,
|
|
90
|
+
inCatch: false,
|
|
91
|
+
inConditional: false,
|
|
92
|
+
inFinally: false,
|
|
93
|
+
inLoop: false,
|
|
94
|
+
inTry: false,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function pushContext(newContext) {
|
|
98
|
+
const currentContext = getCurrentContext();
|
|
99
|
+
contextStack.push({ ...currentContext, ...newContext });
|
|
100
|
+
}
|
|
101
|
+
function popContext() {
|
|
102
|
+
contextStack.pop();
|
|
103
|
+
}
|
|
104
|
+
function updateContext(updates) {
|
|
105
|
+
const last = contextStack.at(-1);
|
|
106
|
+
if (!last)
|
|
107
|
+
return;
|
|
108
|
+
contextStack[contextStack.length - 1] = { ...last, ...updates };
|
|
109
|
+
}
|
|
110
|
+
function cloneStack() {
|
|
111
|
+
// oxlint-disable-next-line no-array-callback-reference -- this is fine. leave it alone.
|
|
112
|
+
return openerStack.map(cloneEntry);
|
|
113
|
+
}
|
|
114
|
+
function saveSnapshot(node) {
|
|
115
|
+
stackSnapshots.set(node, cloneStack());
|
|
116
|
+
}
|
|
117
|
+
function findPairConfig(functionName, isOpener) {
|
|
118
|
+
return options.pairs.find((pair) => {
|
|
119
|
+
if (isOpener)
|
|
120
|
+
return pair.opener === functionName;
|
|
121
|
+
// Check if it matches closer or alternatives
|
|
122
|
+
const validClosers = getValidClosers(pair);
|
|
123
|
+
return validClosers.includes(functionName);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function isRobloxYieldingFunction(functionName, configuration) {
|
|
127
|
+
if (configuration.platform !== "roblox")
|
|
128
|
+
return false;
|
|
129
|
+
const yieldingFunctions = configuration.yieldingFunctions ?? DEFAULT_ROBLOX_YIELDING_FUNCTIONS;
|
|
130
|
+
return yieldingFunctions.some((pattern) => {
|
|
131
|
+
if (pattern.startsWith("*.")) {
|
|
132
|
+
// Match any method call with this name
|
|
133
|
+
const methodName = pattern.slice(2);
|
|
134
|
+
return functionName.endsWith(`.${methodName}`);
|
|
135
|
+
}
|
|
136
|
+
return functionName === pattern;
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function onFunctionEnter(node) {
|
|
140
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- ESLint visitor functions receive unknown, we know the type from selector
|
|
141
|
+
const functionNode = node;
|
|
142
|
+
functionStacks.push([...openerStack]);
|
|
143
|
+
openerStack.length = 0;
|
|
144
|
+
yieldingAutoClosed = false;
|
|
145
|
+
yieldingReportedFirst = false;
|
|
146
|
+
pushContext({
|
|
147
|
+
asyncContext: functionNode.async ?? false,
|
|
148
|
+
currentFunction: functionNode,
|
|
149
|
+
hasEarlyExit: false,
|
|
150
|
+
inCatch: false,
|
|
151
|
+
inConditional: false,
|
|
152
|
+
inFinally: false,
|
|
153
|
+
inLoop: false,
|
|
154
|
+
inTry: false,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function onFunctionExit() {
|
|
158
|
+
if (options.scope === "function" && openerStack.length > 0) {
|
|
159
|
+
for (const entry of openerStack) {
|
|
160
|
+
const validClosers = getValidClosers(entry.config);
|
|
161
|
+
const closer = validClosers.length === 1 ? (validClosers[0] ?? "closer") : validClosers.join("' or '");
|
|
162
|
+
context.report({
|
|
163
|
+
data: {
|
|
164
|
+
closer,
|
|
165
|
+
opener: entry.opener,
|
|
166
|
+
paths: "function exit",
|
|
167
|
+
},
|
|
168
|
+
messageId: "unpairedOpener",
|
|
169
|
+
node: entry.node,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
const parentStack = functionStacks.pop();
|
|
174
|
+
if (parentStack) {
|
|
175
|
+
openerStack.length = 0;
|
|
176
|
+
openerStack.push(...parentStack);
|
|
177
|
+
}
|
|
178
|
+
else
|
|
179
|
+
openerStack.length = 0;
|
|
180
|
+
popContext();
|
|
181
|
+
}
|
|
182
|
+
function onIfStatementEnter(node) {
|
|
183
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- ESLint visitor type from selector
|
|
184
|
+
const ifNode = node;
|
|
185
|
+
pushContext({ inConditional: true });
|
|
186
|
+
saveSnapshot(ifNode);
|
|
187
|
+
}
|
|
188
|
+
function onIfStatementExit(node) {
|
|
189
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- ESLint visitor type from selector
|
|
190
|
+
const ifNode = node;
|
|
191
|
+
popContext();
|
|
192
|
+
const originalStack = stackSnapshots.get(ifNode);
|
|
193
|
+
const branches = branchStacks.get(ifNode);
|
|
194
|
+
if (originalStack && branches && branches.length > 0) {
|
|
195
|
+
const hasCompleteElse = ifNode.alternate !== undefined && ifNode.alternate !== null;
|
|
196
|
+
if (hasCompleteElse) {
|
|
197
|
+
for (const { index, config, opener, node } of originalStack) {
|
|
198
|
+
const branchesWithOpener = branches.filter((branchStack) => branchStack.some((branch) => branch.index === index));
|
|
199
|
+
if (branchesWithOpener.length <= 0 || branchesWithOpener.length >= branches.length)
|
|
200
|
+
continue;
|
|
201
|
+
if (options.allowConditionalClosers !== false)
|
|
202
|
+
continue;
|
|
203
|
+
const validClosers = getValidClosers(config);
|
|
204
|
+
const closer = validClosers.length === 1 ? (validClosers[0] ?? "closer") : validClosers.join("' or '");
|
|
205
|
+
context.report({
|
|
206
|
+
data: {
|
|
207
|
+
closer,
|
|
208
|
+
opener,
|
|
209
|
+
paths: "not all execution paths",
|
|
210
|
+
},
|
|
211
|
+
messageId: "unpairedOpener",
|
|
212
|
+
node,
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
const commonOpeners = originalStack.filter((opener) => branches.every((branchStack) => branchStack.some(({ index }) => index === opener.index)));
|
|
216
|
+
openerStack.length = 0;
|
|
217
|
+
openerStack.push(...commonOpeners);
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
openerStack.length = 0;
|
|
221
|
+
for (const entry of originalStack)
|
|
222
|
+
openerStack.push({ ...entry });
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
stackSnapshots.delete(ifNode);
|
|
226
|
+
branchStacks.delete(ifNode);
|
|
227
|
+
}
|
|
228
|
+
function onIfConsequentExit(node) {
|
|
229
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- ESLint visitor type from selector
|
|
230
|
+
const consequentNode = node;
|
|
231
|
+
const parent = consequentNode.parent;
|
|
232
|
+
if (parent?.type === AST_NODE_TYPES.IfStatement) {
|
|
233
|
+
const branches = branchStacks.get(parent) ?? [];
|
|
234
|
+
branches.push(cloneStack());
|
|
235
|
+
branchStacks.set(parent, branches);
|
|
236
|
+
const originalStack = stackSnapshots.get(parent);
|
|
237
|
+
if (!originalStack)
|
|
238
|
+
return;
|
|
239
|
+
openerStack.length = 0;
|
|
240
|
+
for (const entry of originalStack)
|
|
241
|
+
openerStack.push({ ...entry });
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
function onIfAlternateExit(node) {
|
|
245
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- ESLint visitor type from selector
|
|
246
|
+
const alternateNode = node;
|
|
247
|
+
const parent = alternateNode.parent;
|
|
248
|
+
if (parent?.type === AST_NODE_TYPES.IfStatement) {
|
|
249
|
+
const branches = branchStacks.get(parent) ?? [];
|
|
250
|
+
branches.push(cloneStack());
|
|
251
|
+
branchStacks.set(parent, branches);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
function onTryStatementEnter(node) {
|
|
255
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- ESLint visitor type from selector
|
|
256
|
+
const tryNode = node;
|
|
257
|
+
saveSnapshot(tryNode);
|
|
258
|
+
}
|
|
259
|
+
function onTryStatementExit(node) {
|
|
260
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- ESLint visitor type from selector
|
|
261
|
+
const tryNode = node;
|
|
262
|
+
const originalStack = stackSnapshots.get(tryNode);
|
|
263
|
+
const branches = branchStacks.get(tryNode);
|
|
264
|
+
if (tryNode.finalizer) {
|
|
265
|
+
stackSnapshots.delete(tryNode);
|
|
266
|
+
branchStacks.delete(tryNode);
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
if (originalStack && branches && branches.length > 0) {
|
|
270
|
+
for (const opener of originalStack) {
|
|
271
|
+
const branchesWithOpener = branches.filter((branchStack) => branchStack.some((entry) => entry.index === opener.index));
|
|
272
|
+
if (branchesWithOpener.length > 0 &&
|
|
273
|
+
branchesWithOpener.length < branches.length &&
|
|
274
|
+
options.allowConditionalClosers === false) {
|
|
275
|
+
const validClosers = getValidClosers(opener.config);
|
|
276
|
+
const closer = validClosers.length === 1 ? (validClosers[0] ?? "closer") : validClosers.join("' or '");
|
|
277
|
+
context.report({
|
|
278
|
+
data: {
|
|
279
|
+
closer,
|
|
280
|
+
opener: opener.opener,
|
|
281
|
+
paths: "not all execution paths",
|
|
282
|
+
},
|
|
283
|
+
messageId: "unpairedOpener",
|
|
284
|
+
node: opener.node,
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
const commonOpeners = originalStack.filter((opener) => branches.every((branchStack) => branchStack.some((entry) => entry.index === opener.index)));
|
|
289
|
+
openerStack.length = 0;
|
|
290
|
+
openerStack.push(...commonOpeners);
|
|
291
|
+
}
|
|
292
|
+
stackSnapshots.delete(tryNode);
|
|
293
|
+
branchStacks.delete(tryNode);
|
|
294
|
+
}
|
|
295
|
+
function onTryBlockEnter() {
|
|
296
|
+
pushContext({ inTry: true });
|
|
297
|
+
}
|
|
298
|
+
function onTryBlockExit(node) {
|
|
299
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- ESLint visitor type from selector
|
|
300
|
+
const blockNode = node;
|
|
301
|
+
const { parent } = blockNode;
|
|
302
|
+
if (parent?.type === AST_NODE_TYPES.TryStatement) {
|
|
303
|
+
const branches = branchStacks.get(parent) ?? [];
|
|
304
|
+
branches.push(cloneStack());
|
|
305
|
+
branchStacks.set(parent, branches);
|
|
306
|
+
const originalStack = stackSnapshots.get(parent);
|
|
307
|
+
if (originalStack) {
|
|
308
|
+
openerStack.length = 0;
|
|
309
|
+
for (const entry of originalStack)
|
|
310
|
+
openerStack.push({ ...entry });
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
popContext();
|
|
314
|
+
}
|
|
315
|
+
function onCatchClauseEnter() {
|
|
316
|
+
pushContext({ inCatch: true });
|
|
317
|
+
}
|
|
318
|
+
function onCatchClauseExit(node) {
|
|
319
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- ESLint visitor type from selector
|
|
320
|
+
const catchNode = node;
|
|
321
|
+
const { parent } = catchNode;
|
|
322
|
+
if (parent?.type === AST_NODE_TYPES.TryStatement) {
|
|
323
|
+
const branches = branchStacks.get(parent) ?? [];
|
|
324
|
+
branches.push(cloneStack());
|
|
325
|
+
branchStacks.set(parent, branches);
|
|
326
|
+
const originalStack = stackSnapshots.get(parent);
|
|
327
|
+
if (originalStack) {
|
|
328
|
+
openerStack.length = 0;
|
|
329
|
+
for (const entry of originalStack)
|
|
330
|
+
openerStack.push({ ...entry });
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
popContext();
|
|
334
|
+
}
|
|
335
|
+
function onFinallyBlockEnter() {
|
|
336
|
+
pushContext({ inFinally: true });
|
|
337
|
+
}
|
|
338
|
+
function onFinallyBlockExit() {
|
|
339
|
+
popContext();
|
|
340
|
+
}
|
|
341
|
+
function onSwitchStatementEnter(node) {
|
|
342
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- ESLint visitor type from selector
|
|
343
|
+
const switchNode = node;
|
|
344
|
+
pushContext({ inConditional: true });
|
|
345
|
+
saveSnapshot(switchNode);
|
|
346
|
+
}
|
|
347
|
+
function onSwitchStatementExit(node) {
|
|
348
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- ESLint visitor type from selector
|
|
349
|
+
const switchNode = node;
|
|
350
|
+
popContext();
|
|
351
|
+
const originalStack = stackSnapshots.get(switchNode);
|
|
352
|
+
const branches = branchStacks.get(switchNode);
|
|
353
|
+
if (originalStack && branches && branches.length > 0) {
|
|
354
|
+
const hasDefault = switchNode.cases.some((caseNode) => caseNode.test === null);
|
|
355
|
+
if (hasDefault && branches.length === switchNode.cases.length) {
|
|
356
|
+
for (const opener of originalStack) {
|
|
357
|
+
const branchesWithOpener = branches.filter((branchStack) => branchStack.some((entry) => entry.index === opener.index));
|
|
358
|
+
if (branchesWithOpener.length > 0 &&
|
|
359
|
+
branchesWithOpener.length < branches.length &&
|
|
360
|
+
options.allowConditionalClosers === false) {
|
|
361
|
+
const validClosers = getValidClosers(opener.config);
|
|
362
|
+
const closer = validClosers.length === 1 ? (validClosers[0] ?? "closer") : validClosers.join("' or '");
|
|
363
|
+
context.report({
|
|
364
|
+
data: {
|
|
365
|
+
closer,
|
|
366
|
+
opener: opener.opener,
|
|
367
|
+
paths: "not all execution paths",
|
|
368
|
+
},
|
|
369
|
+
messageId: "unpairedOpener",
|
|
370
|
+
node: opener.node,
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
const commonOpeners = originalStack.filter((opener) => branches.every((branchStack) => branchStack.some((entry) => entry.index === opener.index)));
|
|
375
|
+
openerStack.length = 0;
|
|
376
|
+
openerStack.push(...commonOpeners);
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
openerStack.length = 0;
|
|
380
|
+
for (const entry of originalStack)
|
|
381
|
+
openerStack.push({ ...entry });
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
stackSnapshots.delete(switchNode);
|
|
385
|
+
branchStacks.delete(switchNode);
|
|
386
|
+
}
|
|
387
|
+
function onSwitchCaseExit(node) {
|
|
388
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- ESLint visitor type from selector
|
|
389
|
+
const caseNode = node;
|
|
390
|
+
const { parent } = caseNode;
|
|
391
|
+
if (parent?.type === AST_NODE_TYPES.SwitchStatement) {
|
|
392
|
+
const branches = branchStacks.get(parent) ?? [];
|
|
393
|
+
branches.push(cloneStack());
|
|
394
|
+
branchStacks.set(parent, branches);
|
|
395
|
+
const originalStack = stackSnapshots.get(parent);
|
|
396
|
+
if (!originalStack)
|
|
397
|
+
return;
|
|
398
|
+
openerStack.length = 0;
|
|
399
|
+
for (const entry of originalStack)
|
|
400
|
+
openerStack.push({ ...entry });
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
function onLoopEnter() {
|
|
404
|
+
pushContext({ inLoop: true });
|
|
405
|
+
}
|
|
406
|
+
function onLoopExit() {
|
|
407
|
+
popContext();
|
|
408
|
+
}
|
|
409
|
+
function onEarlyExit(node) {
|
|
410
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- ESLint visitor type from selector
|
|
411
|
+
const statementNode = node;
|
|
412
|
+
updateContext({ hasEarlyExit: true });
|
|
413
|
+
const currentContext = getCurrentContext();
|
|
414
|
+
if (currentContext.inFinally || openerStack.length === 0)
|
|
415
|
+
return;
|
|
416
|
+
for (const { opener, config, node } of openerStack) {
|
|
417
|
+
const validClosers = getValidClosers(config);
|
|
418
|
+
const closer = validClosers.length === 1 ? (validClosers[0] ?? "closer") : validClosers.join("' or '");
|
|
419
|
+
const statementType = statementNode.type === AST_NODE_TYPES.ReturnStatement ? "return" : "throw";
|
|
420
|
+
const lineNumber = statementNode.loc?.start.line ?? 0;
|
|
421
|
+
context.report({
|
|
422
|
+
data: {
|
|
423
|
+
closer,
|
|
424
|
+
opener,
|
|
425
|
+
paths: `${statementType} at line ${lineNumber}`,
|
|
426
|
+
},
|
|
427
|
+
messageId: "unpairedOpener",
|
|
428
|
+
node: node,
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
function onBreakContinue(node) {
|
|
433
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- ESLint visitor type from selector
|
|
434
|
+
const statementNode = node;
|
|
435
|
+
const currentContext = getCurrentContext();
|
|
436
|
+
if (!currentContext.inLoop || openerStack.length <= 0)
|
|
437
|
+
return;
|
|
438
|
+
for (const { node, config, opener } of openerStack) {
|
|
439
|
+
const validClosers = getValidClosers(config);
|
|
440
|
+
const closer = validClosers.length === 1 ? (validClosers[0] ?? "closer") : validClosers.join("' or '");
|
|
441
|
+
const statementType = statementNode.type === AST_NODE_TYPES.BreakStatement ? "break" : "continue";
|
|
442
|
+
const lineNumber = statementNode.loc?.start.line ?? 0;
|
|
443
|
+
context.report({
|
|
444
|
+
data: {
|
|
445
|
+
closer,
|
|
446
|
+
opener,
|
|
447
|
+
paths: `${statementType} at line ${lineNumber}`,
|
|
448
|
+
},
|
|
449
|
+
messageId: "unpairedOpener",
|
|
450
|
+
node,
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
function onCallExpression(node) {
|
|
455
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- ESLint visitor type from selector
|
|
456
|
+
const callNode = node;
|
|
457
|
+
const callName = getCallName(callNode);
|
|
458
|
+
if (callName === undefined || callName === "")
|
|
459
|
+
return;
|
|
460
|
+
const openerConfig = findPairConfig(callName, true);
|
|
461
|
+
if (openerConfig) {
|
|
462
|
+
handleOpener(callNode, callName, openerConfig);
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
const closerConfiguration = findPairConfig(callName, false);
|
|
466
|
+
if (closerConfiguration) {
|
|
467
|
+
handleCloser(callNode, callName, closerConfiguration);
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
for (const entry of openerStack) {
|
|
471
|
+
if (!isRobloxYieldingFunction(callName, entry.config))
|
|
472
|
+
continue;
|
|
473
|
+
handleRobloxYield(callNode, callName, entry);
|
|
474
|
+
// Roblox auto-closes ALL profiles
|
|
475
|
+
openerStack.length = 0;
|
|
476
|
+
yieldingAutoClosed = true;
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
function handleOpener(node, opener, config) {
|
|
481
|
+
const maxDepth = options.maxNestingDepth ?? 0;
|
|
482
|
+
if (maxDepth > 0 && openerStack.length >= maxDepth) {
|
|
483
|
+
context.report({
|
|
484
|
+
data: { max: String(maxDepth) },
|
|
485
|
+
messageId: "maxNestingExceeded",
|
|
486
|
+
node,
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
if (options.allowMultipleOpeners === false &&
|
|
490
|
+
openerStack.length > 0 &&
|
|
491
|
+
openerStack.at(-1)?.opener === opener) {
|
|
492
|
+
context.report({
|
|
493
|
+
data: { opener },
|
|
494
|
+
messageId: "multipleOpeners",
|
|
495
|
+
node,
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
const entry = {
|
|
499
|
+
config,
|
|
500
|
+
index: stackIndexCounter++,
|
|
501
|
+
location: node.loc,
|
|
502
|
+
node,
|
|
503
|
+
opener,
|
|
504
|
+
};
|
|
505
|
+
openerStack.push(entry);
|
|
506
|
+
}
|
|
507
|
+
function handleCloser(node, closer, configuration) {
|
|
508
|
+
const matchingIndex = openerStack.findLastIndex((entry) => getValidClosers(entry.config).includes(closer) && entry.config === configuration);
|
|
509
|
+
if (matchingIndex === -1) {
|
|
510
|
+
if (yieldingAutoClosed && !yieldingReportedFirst) {
|
|
511
|
+
yieldingReportedFirst = true;
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
context.report({
|
|
515
|
+
data: {
|
|
516
|
+
closer,
|
|
517
|
+
opener: configuration.opener,
|
|
518
|
+
},
|
|
519
|
+
messageId: "unpairedCloser",
|
|
520
|
+
node,
|
|
521
|
+
});
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
const matchingEntry = openerStack[matchingIndex];
|
|
525
|
+
if (!matchingEntry)
|
|
526
|
+
return;
|
|
527
|
+
if (matchingIndex !== openerStack.length - 1) {
|
|
528
|
+
const topEntry = openerStack.at(-1);
|
|
529
|
+
if (topEntry) {
|
|
530
|
+
context.report({
|
|
531
|
+
data: {
|
|
532
|
+
actual: topEntry.opener,
|
|
533
|
+
closer,
|
|
534
|
+
expected: matchingEntry.opener,
|
|
535
|
+
},
|
|
536
|
+
messageId: "wrongOrder",
|
|
537
|
+
node,
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
openerStack.splice(matchingIndex, 1);
|
|
542
|
+
}
|
|
543
|
+
function handleRobloxYield(node, yieldingFunction, openerEntry) {
|
|
544
|
+
const validClosers = getValidClosers(openerEntry.config);
|
|
545
|
+
const closer = validClosers.length === 1 ? (validClosers[0] ?? "closer") : validClosers.join("' or '");
|
|
546
|
+
context.report({
|
|
547
|
+
data: { closer, yieldingFunction },
|
|
548
|
+
messageId: "robloxYieldViolation",
|
|
549
|
+
node,
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
function onAsyncYield(node) {
|
|
553
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- ESLint visitor type from selector
|
|
554
|
+
const asyncNode = node;
|
|
555
|
+
for (const { opener, config } of openerStack) {
|
|
556
|
+
if (config.requireSync !== true)
|
|
557
|
+
continue;
|
|
558
|
+
const validClosers = getValidClosers(config);
|
|
559
|
+
const closer = validClosers.length === 1 ? (validClosers[0] ?? "closer") : validClosers.join("' or '");
|
|
560
|
+
const asyncType = asyncNode.type === AST_NODE_TYPES.AwaitExpression ? "await" : "yield";
|
|
561
|
+
context.report({
|
|
562
|
+
data: { asyncType, closer, opener },
|
|
563
|
+
messageId: "asyncViolation",
|
|
564
|
+
node: asyncNode,
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
return {
|
|
569
|
+
ArrowFunctionExpression: onFunctionEnter,
|
|
570
|
+
"ArrowFunctionExpression:exit": onFunctionExit,
|
|
571
|
+
AwaitExpression: onAsyncYield,
|
|
572
|
+
BreakStatement: onBreakContinue,
|
|
573
|
+
CallExpression: onCallExpression,
|
|
574
|
+
CatchClause: onCatchClauseEnter,
|
|
575
|
+
"CatchClause:exit": onCatchClauseExit,
|
|
576
|
+
ContinueStatement: onBreakContinue,
|
|
577
|
+
DoWhileStatement: onLoopEnter,
|
|
578
|
+
"DoWhileStatement:exit": onLoopExit,
|
|
579
|
+
ForInStatement: onLoopEnter,
|
|
580
|
+
"ForInStatement:exit": onLoopExit,
|
|
581
|
+
ForOfStatement: (node) => {
|
|
582
|
+
if (node.await)
|
|
583
|
+
onAsyncYield(node);
|
|
584
|
+
onLoopEnter();
|
|
585
|
+
},
|
|
586
|
+
"ForOfStatement:exit": onLoopExit,
|
|
587
|
+
ForStatement: onLoopEnter,
|
|
588
|
+
"ForStatement:exit": onLoopExit,
|
|
589
|
+
FunctionDeclaration: onFunctionEnter,
|
|
590
|
+
"FunctionDeclaration:exit": onFunctionExit,
|
|
591
|
+
FunctionExpression: onFunctionEnter,
|
|
592
|
+
"FunctionExpression:exit": onFunctionExit,
|
|
593
|
+
IfStatement: onIfStatementEnter,
|
|
594
|
+
"IfStatement > .alternate:exit": onIfAlternateExit,
|
|
595
|
+
"IfStatement > .consequent:exit": onIfConsequentExit,
|
|
596
|
+
"IfStatement:exit": onIfStatementExit,
|
|
597
|
+
ReturnStatement: onEarlyExit,
|
|
598
|
+
"SwitchCase:exit": onSwitchCaseExit,
|
|
599
|
+
SwitchStatement: onSwitchStatementEnter,
|
|
600
|
+
"SwitchStatement:exit": onSwitchStatementExit,
|
|
601
|
+
ThrowStatement: onEarlyExit,
|
|
602
|
+
TryStatement: onTryStatementEnter,
|
|
603
|
+
"TryStatement > .block": onTryBlockEnter,
|
|
604
|
+
"TryStatement > .block:exit": onTryBlockExit,
|
|
605
|
+
"TryStatement > .finalizer": onFinallyBlockEnter,
|
|
606
|
+
"TryStatement > .finalizer:exit": onFinallyBlockExit,
|
|
607
|
+
"TryStatement:exit": onTryStatementExit,
|
|
608
|
+
WhileStatement: onLoopEnter,
|
|
609
|
+
"WhileStatement:exit": onLoopExit,
|
|
610
|
+
YieldExpression: onAsyncYield,
|
|
611
|
+
};
|
|
612
|
+
},
|
|
613
|
+
meta: {
|
|
614
|
+
docs: {
|
|
615
|
+
description: "Enforces balanced opener/closer function calls across all execution paths",
|
|
616
|
+
recommended: false,
|
|
617
|
+
url: "https://github.com/howmanysmall/eslint-idiot-lint/tree/main/docs/rules/require-paired-calls.md",
|
|
618
|
+
},
|
|
619
|
+
fixable: "code",
|
|
620
|
+
messages: {
|
|
621
|
+
asyncViolation: "Cannot use {{asyncType}} between '{{opener}}' and '{{closer}}' (requireSync: true)",
|
|
622
|
+
conditionalOpener: "Conditional opener '{{opener}}' at {{location}} may not have matching closer on all paths",
|
|
623
|
+
maxNestingExceeded: "Maximum nesting depth of {{max}} exceeded for paired calls",
|
|
624
|
+
multipleOpeners: "Multiple consecutive calls to '{{opener}}' without matching closers (allowMultipleOpeners: false)",
|
|
625
|
+
robloxYieldViolation: "Yielding function '{{yieldingFunction}}' auto-closes all profiles - subsequent '{{closer}}' will error",
|
|
626
|
+
unpairedCloser: "Unexpected call to '{{closer}}' - no matching '{{opener}}'",
|
|
627
|
+
unpairedOpener: "Unpaired call to '{{opener}}' - missing '{{closer}}' on {{paths}}",
|
|
628
|
+
wrongOrder: "Closer '{{closer}}' called out of order - expected to close '{{expected}}' but '{{actual}}' is still open",
|
|
629
|
+
},
|
|
630
|
+
schema: [
|
|
631
|
+
{
|
|
632
|
+
additionalProperties: false,
|
|
633
|
+
properties: {
|
|
634
|
+
allowConditionalClosers: {
|
|
635
|
+
default: false,
|
|
636
|
+
type: "boolean",
|
|
637
|
+
},
|
|
638
|
+
allowMultipleOpeners: {
|
|
639
|
+
default: true,
|
|
640
|
+
type: "boolean",
|
|
641
|
+
},
|
|
642
|
+
maxNestingDepth: {
|
|
643
|
+
default: 0,
|
|
644
|
+
minimum: 0,
|
|
645
|
+
type: "number",
|
|
646
|
+
},
|
|
647
|
+
pairs: {
|
|
648
|
+
items: {
|
|
649
|
+
additionalProperties: false,
|
|
650
|
+
properties: {
|
|
651
|
+
alternatives: {
|
|
652
|
+
items: { minLength: 1, type: "string" },
|
|
653
|
+
type: "array",
|
|
654
|
+
},
|
|
655
|
+
closer: {
|
|
656
|
+
oneOf: [
|
|
657
|
+
{ minLength: 1, type: "string" },
|
|
658
|
+
{
|
|
659
|
+
items: { minLength: 1, type: "string" },
|
|
660
|
+
minItems: 1,
|
|
661
|
+
type: "array",
|
|
662
|
+
},
|
|
663
|
+
],
|
|
664
|
+
},
|
|
665
|
+
opener: {
|
|
666
|
+
minLength: 1,
|
|
667
|
+
type: "string",
|
|
668
|
+
},
|
|
669
|
+
platform: {
|
|
670
|
+
enum: ["roblox"],
|
|
671
|
+
type: "string",
|
|
672
|
+
},
|
|
673
|
+
requireAll: {
|
|
674
|
+
items: { minLength: 1, type: "string" },
|
|
675
|
+
type: "array",
|
|
676
|
+
},
|
|
677
|
+
requireSync: {
|
|
678
|
+
default: false,
|
|
679
|
+
type: "boolean",
|
|
680
|
+
},
|
|
681
|
+
yieldingFunctions: {
|
|
682
|
+
items: { minLength: 1, type: "string" },
|
|
683
|
+
type: "array",
|
|
684
|
+
},
|
|
685
|
+
},
|
|
686
|
+
required: ["opener", "closer"],
|
|
687
|
+
type: "object",
|
|
688
|
+
},
|
|
689
|
+
minItems: 1,
|
|
690
|
+
type: "array",
|
|
691
|
+
},
|
|
692
|
+
scope: {
|
|
693
|
+
default: "function",
|
|
694
|
+
enum: ["function", "block", "file"],
|
|
695
|
+
type: "string",
|
|
696
|
+
},
|
|
697
|
+
},
|
|
698
|
+
required: ["pairs"],
|
|
699
|
+
type: "object",
|
|
700
|
+
},
|
|
701
|
+
],
|
|
702
|
+
type: "problem",
|
|
703
|
+
},
|
|
704
|
+
};
|
|
705
|
+
export default rule;
|
|
706
|
+
//# sourceMappingURL=require-paired-calls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-paired-calls.js","sourceRoot":"","sources":["../../src/rules/require-paired-calls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,0BAA0B,CAAC;AAGzE,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;AAqBxE,MAAM,mBAAmB,GAAG,OAAO,CAClC,IAAI,CAAC,QAAQ,CACZ,IAAI,CAAC,MAAM,CAAC;IACX,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC;IAC1C,MA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