@tsrx/eslint-plugin 0.3.72 → 0.3.74
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 +3 -3
- package/dist/index.js +45 -26
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -133,9 +133,9 @@ This rule is auto-fixable with `--fix`.
|
|
|
133
133
|
|
|
134
134
|
### `ripple/control-flow-jsx` (error)
|
|
135
135
|
|
|
136
|
-
Checks
|
|
137
|
-
|
|
138
|
-
callbacks should not render JSX.
|
|
136
|
+
Checks template control flow inside functions that return native TSRX. `@for`
|
|
137
|
+
blocks should render template output, while ordinary `for...of` loops inside
|
|
138
|
+
`effect()` callbacks should not render JSX.
|
|
139
139
|
|
|
140
140
|
### `ripple/no-lazy-destructuring-in-modules` (error)
|
|
141
141
|
|
package/dist/index.js
CHANGED
|
@@ -63,9 +63,6 @@ const rule$4 = {
|
|
|
63
63
|
"JSXAttribute[name.name=\"onChange\"]"(node) {
|
|
64
64
|
report_onchange(node);
|
|
65
65
|
},
|
|
66
|
-
"Attribute[name.name=\"onChange\"]"(node) {
|
|
67
|
-
report_onchange(node);
|
|
68
|
-
},
|
|
69
66
|
"Property[key.name=\"onChange\"]"(node) {
|
|
70
67
|
if (context.sourceCode.getAncestors(node).some((ancestor) => ancestor.type === "ObjectExpression")) context.report({
|
|
71
68
|
node,
|
|
@@ -97,7 +94,7 @@ const rule$3 = {
|
|
|
97
94
|
};
|
|
98
95
|
//#endregion
|
|
99
96
|
//#region src/utils/tsrx.ts
|
|
100
|
-
const NESTED_BOUNDARY_TYPES = new Set([
|
|
97
|
+
const NESTED_BOUNDARY_TYPES$1 = new Set([
|
|
101
98
|
"FunctionDeclaration",
|
|
102
99
|
"FunctionExpression",
|
|
103
100
|
"ArrowFunctionExpression",
|
|
@@ -107,20 +104,22 @@ const NESTED_BOUNDARY_TYPES = new Set([
|
|
|
107
104
|
"PropertyDefinition",
|
|
108
105
|
"StaticBlock"
|
|
109
106
|
]);
|
|
110
|
-
function
|
|
111
|
-
|
|
107
|
+
function isNativeTsrxJsxNode(node) {
|
|
108
|
+
if (!node) return false;
|
|
109
|
+
if (node.type === "JSXCodeBlock" || node.type === "JSXIfExpression" || node.type === "JSXForExpression" || node.type === "JSXSwitchExpression" || node.type === "JSXTryExpression") return true;
|
|
110
|
+
return (node.type === "JSXElement" || node.type === "JSXFragment" || node.type === "JSXStyleElement") && !!node.metadata?.native_tsrx;
|
|
112
111
|
}
|
|
113
112
|
function functionReturnsNativeTsrx(node) {
|
|
114
113
|
const body = node.body;
|
|
115
114
|
if (!body) return false;
|
|
116
|
-
if (
|
|
115
|
+
if (isNativeTsrxJsxNode(body)) return true;
|
|
117
116
|
if (body.type !== "BlockStatement") return false;
|
|
118
117
|
return containsNativeTsrxReturn(body);
|
|
119
118
|
}
|
|
120
119
|
function containsNativeTsrxReturn(node) {
|
|
121
120
|
if (!node || typeof node !== "object") return false;
|
|
122
|
-
if (node.type === "ReturnStatement" &&
|
|
123
|
-
if (node.type !== "BlockStatement" && NESTED_BOUNDARY_TYPES.has(node.type)) return false;
|
|
121
|
+
if (node.type === "ReturnStatement" && isNativeTsrxJsxNode(node.argument)) return true;
|
|
122
|
+
if (node.type !== "BlockStatement" && NESTED_BOUNDARY_TYPES$1.has(node.type)) return false;
|
|
124
123
|
for (const key of Object.keys(node)) {
|
|
125
124
|
if (key === "parent" || key === "loc" || key === "range") continue;
|
|
126
125
|
const value = node[key];
|
|
@@ -132,15 +131,24 @@ function containsNativeTsrxReturn(node) {
|
|
|
132
131
|
}
|
|
133
132
|
//#endregion
|
|
134
133
|
//#region src/rules/control-flow-jsx.ts
|
|
134
|
+
const NESTED_BOUNDARY_TYPES = new Set([
|
|
135
|
+
"FunctionDeclaration",
|
|
136
|
+
"FunctionExpression",
|
|
137
|
+
"ArrowFunctionExpression",
|
|
138
|
+
"ClassDeclaration",
|
|
139
|
+
"ClassExpression",
|
|
140
|
+
"MethodDefinition",
|
|
141
|
+
"PropertyDefinition"
|
|
142
|
+
]);
|
|
135
143
|
const rule$2 = {
|
|
136
144
|
meta: {
|
|
137
145
|
type: "problem",
|
|
138
146
|
docs: {
|
|
139
|
-
description: "Require
|
|
147
|
+
description: "Require template output in @for blocks, but disallow JSX output in effect loops",
|
|
140
148
|
recommended: true
|
|
141
149
|
},
|
|
142
150
|
messages: {
|
|
143
|
-
requireJsxInLoop: "
|
|
151
|
+
requireJsxInLoop: "@for blocks in returned TSRX should contain template output. Render an element, fragment, or nested template directive.",
|
|
144
152
|
noJsxInEffectLoop: "For...of loops inside effect() should not contain JSX. Effects are for side effects, not rendering."
|
|
145
153
|
},
|
|
146
154
|
schema: []
|
|
@@ -150,19 +158,24 @@ const rule$2 = {
|
|
|
150
158
|
let insideEffect = 0;
|
|
151
159
|
let nonComponentFunctionDepth = 0;
|
|
152
160
|
const functionStack = [];
|
|
153
|
-
function
|
|
161
|
+
function containsTemplateOutput(node, visited = /* @__PURE__ */ new Set()) {
|
|
154
162
|
if (!node) return false;
|
|
155
163
|
if (visited.has(node)) return false;
|
|
156
164
|
visited.add(node);
|
|
157
|
-
if (
|
|
165
|
+
if (visited.size > 1 && NESTED_BOUNDARY_TYPES.has(node.type)) return false;
|
|
166
|
+
if (node.type === "JSXElement" || node.type === "JSXFragment" || node.type === "JSXStyleElement" || node.type === "JSXIfExpression" || node.type === "JSXForExpression" || node.type === "JSXSwitchExpression" || node.type === "JSXTryExpression") return true;
|
|
167
|
+
if (node.type === "JSXCodeBlock") {
|
|
168
|
+
const render = node.render;
|
|
169
|
+
return !!render && containsTemplateOutput(render, visited);
|
|
170
|
+
}
|
|
158
171
|
const keys = Object.keys(node);
|
|
159
172
|
for (const key of keys) {
|
|
160
173
|
if (key === "parent" || key === "loc" || key === "range") continue;
|
|
161
174
|
const value = node[key];
|
|
162
175
|
if (value && typeof value === "object") {
|
|
163
176
|
if (Array.isArray(value)) {
|
|
164
|
-
for (const item of value) if (item && typeof item === "object" &&
|
|
165
|
-
} else if (value.type &&
|
|
177
|
+
for (const item of value) if (item && typeof item === "object" && containsTemplateOutput(item, visited)) return true;
|
|
178
|
+
} else if (value.type && containsTemplateOutput(value, visited)) return true;
|
|
166
179
|
}
|
|
167
180
|
}
|
|
168
181
|
return false;
|
|
@@ -181,15 +194,17 @@ const rule$2 = {
|
|
|
181
194
|
insideEffect--;
|
|
182
195
|
},
|
|
183
196
|
ForOfStatement(node) {
|
|
184
|
-
if (insideComponent === 0) return;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
197
|
+
if (insideComponent === 0 || insideEffect === 0) return;
|
|
198
|
+
if (containsTemplateOutput(node.body)) context.report({
|
|
199
|
+
node,
|
|
200
|
+
messageId: "noJsxInEffectLoop"
|
|
201
|
+
});
|
|
202
|
+
},
|
|
203
|
+
JSXForExpression(node) {
|
|
204
|
+
if (insideComponent === 0 || nonComponentFunctionDepth > 0) return;
|
|
205
|
+
const body = node.body;
|
|
206
|
+
if (!body || containsTemplateOutput(body)) return;
|
|
207
|
+
context.report({
|
|
193
208
|
node,
|
|
194
209
|
messageId: "requireJsxInLoop"
|
|
195
210
|
});
|
|
@@ -251,7 +266,7 @@ const rule = {
|
|
|
251
266
|
schema: []
|
|
252
267
|
},
|
|
253
268
|
create(context) {
|
|
254
|
-
|
|
269
|
+
const checkForOfKey = (node) => {
|
|
255
270
|
if (!node.key) return;
|
|
256
271
|
const checkIdentifier = (identifier) => {
|
|
257
272
|
if (!findVariable(context.sourceCode.getScope(node), identifier.name)) context.report({
|
|
@@ -304,7 +319,11 @@ const rule = {
|
|
|
304
319
|
}
|
|
305
320
|
};
|
|
306
321
|
traverse(node.key);
|
|
307
|
-
}
|
|
322
|
+
};
|
|
323
|
+
return {
|
|
324
|
+
ForOfStatement: checkForOfKey,
|
|
325
|
+
JSXForExpression: checkForOfKey
|
|
326
|
+
};
|
|
308
327
|
}
|
|
309
328
|
};
|
|
310
329
|
function findVariable(scope, name) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["rule","rule","rule","functionNode","rule","rule","noModuleScopeTrack","preferOnInput","noReturnInComponent","controlFlowJsx","noLazyDestructuringInModules","validForOfKey"],"sources":["../src/rules/no-module-scope-track.ts","../src/rules/prefer-oninput.ts","../src/rules/no-return-in-component.ts","../src/utils/tsrx.ts","../src/rules/control-flow-jsx.ts","../src/rules/no-lazy-destructuring-in-modules.ts","../src/rules/valid-for-of-key.ts","../src/index.ts"],"sourcesContent":["import type { Rule } from 'eslint';\nimport type * as AST from '@tsrx/core/types/estree';\n\nconst rule: Rule.RuleModule = {\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription: 'Disallow calling track() at module scope',\n\t\t\trecommended: true,\n\t\t},\n\t\tmessages: {\n\t\t\tmoduleScope: 'track() cannot be called at module scope. Move it into a function body.',\n\t\t},\n\t\tschema: [],\n\t},\n\tcreate(context) {\n\t\tlet functionDepth = 0;\n\n\t\tconst incrementFunctionDepth = () => functionDepth++;\n\t\tconst decrementFunctionDepth = () => functionDepth--;\n\n\t\treturn {\n\t\t\tFunctionDeclaration: incrementFunctionDepth,\n\t\t\t'FunctionDeclaration:exit': decrementFunctionDepth,\n\t\t\tFunctionExpression: incrementFunctionDepth,\n\t\t\t'FunctionExpression:exit': decrementFunctionDepth,\n\t\t\tArrowFunctionExpression: incrementFunctionDepth,\n\t\t\t'ArrowFunctionExpression:exit': decrementFunctionDepth,\n\n\t\t\t// Check track() calls\n\t\t\tCallExpression(node: AST.CallExpression) {\n\t\t\t\tif (\n\t\t\t\t\tnode.callee.type === 'Identifier' &&\n\t\t\t\t\tnode.callee.name === 'track' &&\n\t\t\t\t\tfunctionDepth === 0\n\t\t\t\t) {\n\t\t\t\t\tcontext.report({\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tmessageId: 'moduleScope',\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type * as AST from '@tsrx/core/types/estree';\nimport type * as ESTreeJSX from '@tsrx/core/types/estree-jsx';\n\nconst rule: Rule.RuleModule = {\n\tmeta: {\n\t\ttype: 'suggestion',\n\t\tdocs: {\n\t\t\tdescription: 'Prefer onInput over onChange for form inputs in Ripple',\n\t\t\trecommended: true,\n\t\t},\n\t\tmessages: {\n\t\t\tpreferOnInput:\n\t\t\t\t'Use \"onInput\" instead of \"onChange\". Ripple does not have synthetic events like React.',\n\t\t},\n\t\tfixable: 'code',\n\t\tschema: [],\n\t},\n\tcreate(context) {\n\t\tconst reported_ranges = new Set<string>();\n\n\t\tfunction report_onchange(node: AST.Attribute | ESTreeJSX.JSXAttribute) {\n\t\t\tconst range = node.range;\n\t\t\tif (!range) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst key = `${range[0]}:${range[1]}`;\n\t\t\tif (reported_ranges.has(key)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treported_ranges.add(key);\n\n\t\t\tcontext.report({\n\t\t\t\tnode,\n\t\t\t\tmessageId: 'preferOnInput',\n\t\t\t\tfix(fixer) {\n\t\t\t\t\treturn fixer.replaceText(node.name, 'onInput');\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\treturn {\n\t\t\t// Check JSX attributes (standard JSX)\n\t\t\t'JSXAttribute[name.name=\"onChange\"]'(node: ESTreeJSX.JSXAttribute) {\n\t\t\t\treport_onchange(node);\n\t\t\t},\n\t\t\t// Check Attribute nodes (Ripple parser)\n\t\t\t'Attribute[name.name=\"onChange\"]'(node: AST.Attribute) {\n\t\t\t\treport_onchange(node);\n\t\t\t},\n\t\t\t// Check object properties (for spread props)\n\t\t\t'Property[key.name=\"onChange\"]'(node: AST.Property) {\n\t\t\t\t// Only report if this looks like it's in a props object\n\t\t\t\tconst ancestors = context.sourceCode.getAncestors(node);\n\t\t\t\tconst inObjectExpression = ancestors.some(\n\t\t\t\t\t(ancestor) => ancestor.type === 'ObjectExpression',\n\t\t\t\t);\n\n\t\t\t\tif (inObjectExpression) {\n\t\t\t\t\tcontext.report({\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tmessageId: 'preferOnInput',\n\t\t\t\t\t\tfix(fixer) {\n\t\t\t\t\t\t\treturn fixer.replaceText(node.key, 'onInput');\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\n\nconst rule: Rule.RuleModule = {\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription: 'Deprecated: TSRX components are functions that return native TSRX expressions.',\n\t\t\trecommended: false,\n\t\t},\n\t\tdeprecated: true,\n\t\tmessages: {\n\t\t\tnoReturn: 'TSRX components should return native TSRX expressions.',\n\t\t},\n\t\tschema: [],\n\t},\n\tcreate(context) {\n\t\tvoid context;\n\t\treturn {};\n\t},\n};\n\nexport default rule;\n","import type * as AST from '@tsrx/core/types/estree';\n\ntype AnyNode = AST.Node & Record<string, any>;\n\nconst NESTED_BOUNDARY_TYPES = new Set([\n\t'FunctionDeclaration',\n\t'FunctionExpression',\n\t'ArrowFunctionExpression',\n\t'ClassDeclaration',\n\t'ClassExpression',\n\t'MethodDefinition',\n\t'PropertyDefinition',\n\t'StaticBlock',\n]);\n\nexport function isNativeTsrxNode(node: AST.Node | null | undefined): boolean {\n\treturn node?.type === 'Element' || node?.type === 'TsrxFragment';\n}\n\nexport function functionReturnsNativeTsrx(node: AST.Node): boolean {\n\tconst functionNode = node as AnyNode;\n\tconst body = functionNode.body as AnyNode | undefined;\n\n\tif (!body) {\n\t\treturn false;\n\t}\n\n\tif (isNativeTsrxNode(body)) {\n\t\treturn true;\n\t}\n\n\tif (body.type !== 'BlockStatement') {\n\t\treturn false;\n\t}\n\n\treturn containsNativeTsrxReturn(body);\n}\n\nfunction containsNativeTsrxReturn(node: AnyNode): boolean {\n\tif (!node || typeof node !== 'object') {\n\t\treturn false;\n\t}\n\n\tif (node.type === 'ReturnStatement' && isNativeTsrxNode(node.argument)) {\n\t\treturn true;\n\t}\n\n\tif (node.type !== 'BlockStatement' && NESTED_BOUNDARY_TYPES.has(node.type)) {\n\t\treturn false;\n\t}\n\n\tfor (const key of Object.keys(node)) {\n\t\tif (key === 'parent' || key === 'loc' || key === 'range') {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst value = node[key];\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (const child of value) {\n\t\t\t\tif (child?.type && containsNativeTsrxReturn(child)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (value?.type && containsNativeTsrxReturn(value)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n","import type { Rule } from 'eslint';\nimport type * as AST from '@tsrx/core/types/estree';\nimport { functionReturnsNativeTsrx, isNativeTsrxNode } from '../utils/tsrx.js';\n\nconst rule: Rule.RuleModule = {\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription:\n\t\t\t\t'Require JSX in for...of loops within components, but disallow JSX in for...of loops within effects',\n\t\t\trecommended: true,\n\t\t},\n\t\tmessages: {\n\t\t\trequireJsxInLoop:\n\t\t\t\t'For...of loops in returned TSRX should contain JSX elements. Use JSX to render items.',\n\t\t\tnoJsxInEffectLoop:\n\t\t\t\t'For...of loops inside effect() should not contain JSX. Effects are for side effects, not rendering.',\n\t\t},\n\t\tschema: [],\n\t},\n\tcreate(context) {\n\t\tlet insideComponent = 0;\n\t\tlet insideEffect = 0;\n\t\tlet nonComponentFunctionDepth = 0;\n\t\tconst functionStack: boolean[] = [];\n\n\t\tfunction containsJSX(node: AST.Node, visited: Set<AST.Node> = new Set()): boolean {\n\t\t\tif (!node) return false;\n\n\t\t\t// Avoid infinite loops from circular references\n\t\t\tif (visited.has(node)) return false;\n\t\t\tvisited.add(node);\n\n\t\t\tif (\n\t\t\t\tnode.type === ('JSXElement' as string) ||\n\t\t\t\tnode.type === ('JSXFragment' as string) ||\n\t\t\t\tisNativeTsrxNode(node)\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconst keys = Object.keys(node);\n\t\t\tfor (const key of keys) {\n\t\t\t\tif (key === 'parent' || key === 'loc' || key === 'range') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst value = (node as any)[key];\n\t\t\t\tif (value && typeof value === 'object') {\n\t\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\t\tfor (const item of value) {\n\t\t\t\t\t\t\tif (item && typeof item === 'object' && containsJSX(item, visited)) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (value.type && containsJSX(value, visited)) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn {\n\t\t\tFunctionDeclaration: enterFunction,\n\t\t\t'FunctionDeclaration:exit': exitFunction,\n\t\t\tFunctionExpression: enterFunction,\n\t\t\t'FunctionExpression:exit': exitFunction,\n\t\t\tArrowFunctionExpression: enterFunction,\n\t\t\t'ArrowFunctionExpression:exit': exitFunction,\n\n\t\t\t\"CallExpression[callee.name='effect']\"() {\n\t\t\t\tinsideEffect++;\n\t\t\t},\n\t\t\t\"CallExpression[callee.name='effect']:exit\"() {\n\t\t\t\tinsideEffect--;\n\t\t\t},\n\n\t\t\tForOfStatement(node: AST.ForOfStatement) {\n\t\t\t\tif (insideComponent === 0) return;\n\n\t\t\t\tconst hasJSX = containsJSX(node.body);\n\n\t\t\t\tif (insideEffect > 0) {\n\t\t\t\t\tif (hasJSX) {\n\t\t\t\t\t\tcontext.report({\n\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\tmessageId: 'noJsxInEffectLoop',\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else if (nonComponentFunctionDepth > 0) {\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tif (!hasJSX) {\n\t\t\t\t\t\tcontext.report({\n\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\tmessageId: 'requireJsxInLoop',\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\n\t\tfunction enterFunction(node: AST.Node) {\n\t\t\tconst isComponent = functionReturnsNativeTsrx(node);\n\t\t\tfunctionStack.push(isComponent);\n\n\t\t\tif (isComponent) {\n\t\t\t\tinsideComponent++;\n\t\t\t} else if (insideComponent > 0) {\n\t\t\t\tnonComponentFunctionDepth++;\n\t\t\t}\n\t\t}\n\n\t\tfunction exitFunction() {\n\t\t\tconst isComponent = functionStack.pop();\n\n\t\t\tif (isComponent) {\n\t\t\t\tinsideComponent--;\n\t\t\t} else if (insideComponent > 0) {\n\t\t\t\tnonComponentFunctionDepth--;\n\t\t\t}\n\t\t}\n\t},\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\n\nconst rule: Rule.RuleModule = {\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription: 'Disallow lazy destructuring (&[] / &{}) in TypeScript/JavaScript modules',\n\t\t\trecommended: true,\n\t\t},\n\t\tmessages: {\n\t\t\tnoLazyDestructuring:\n\t\t\t\t'Lazy destructuring (&[] / &{}) cannot be used in TypeScript/JavaScript modules. Use .value to read and write tracked values instead.',\n\t\t},\n\t\tschema: [],\n\t},\n\tcreate(context) {\n\t\tconst filename = context.filename;\n\n\t\t// Skip TSRX files where lazy destructuring is valid\n\t\tif (filename && filename.endsWith('.tsrx')) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\tArrayPattern(node: any) {\n\t\t\t\tif (node.lazy === true) {\n\t\t\t\t\tcontext.report({\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tmessageId: 'noLazyDestructuring',\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t\tObjectPattern(node: any) {\n\t\t\t\tif (node.lazy === true) {\n\t\t\t\t\tcontext.report({\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tmessageId: 'noLazyDestructuring',\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type * as AST from '@tsrx/core/types/estree';\nimport type { Scope } from 'eslint';\n\nconst rule: Rule.RuleModule = {\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription: 'Ensure variables used in for..of key expression are defined',\n\t\t\trecommended: true,\n\t\t},\n\t\tmessages: {\n\t\t\tundefinedVariable: \"Variable '{{name}}' is not defined.\",\n\t\t},\n\t\tschema: [],\n\t},\n\tcreate(context) {\n\t\treturn {\n\t\t\tForOfStatement(node: AST.ForOfStatement) {\n\t\t\t\tif (!node.key) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst checkIdentifier = (identifier: AST.Identifier) => {\n\t\t\t\t\tconst scope = context.sourceCode.getScope(node);\n\t\t\t\t\tconst variable = findVariable(scope, identifier.name);\n\n\t\t\t\t\tif (!variable) {\n\t\t\t\t\t\tcontext.report({\n\t\t\t\t\t\t\tnode: identifier,\n\t\t\t\t\t\t\tmessageId: 'undefinedVariable',\n\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\tname: identifier.name,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tconst traverse = (node: AST.Node) => {\n\t\t\t\t\tif (!node) return;\n\n\t\t\t\t\tswitch (node.type) {\n\t\t\t\t\t\tcase 'Identifier':\n\t\t\t\t\t\t\tcheckIdentifier(node);\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'MemberExpression':\n\t\t\t\t\t\t\ttraverse(node.object);\n\n\t\t\t\t\t\t\tif (node.computed) {\n\t\t\t\t\t\t\t\ttraverse(node.property);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'BinaryExpression':\n\t\t\t\t\t\tcase 'LogicalExpression':\n\t\t\t\t\t\t\ttraverse(node.left);\n\t\t\t\t\t\t\ttraverse(node.right);\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'UnaryExpression':\n\t\t\t\t\t\t\ttraverse(node.argument);\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'CallExpression':\n\t\t\t\t\t\t\ttraverse(node.callee);\n\t\t\t\t\t\t\tnode.arguments.forEach(traverse);\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'ArrayExpression':\n\t\t\t\t\t\t\t(node.elements as (AST.Expression | AST.SpreadElement)[]).forEach(traverse);\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'ObjectExpression':\n\t\t\t\t\t\t\tnode.properties.forEach((prop: AST.Property | AST.SpreadElement) => {\n\t\t\t\t\t\t\t\tif (prop.type === 'Property') {\n\t\t\t\t\t\t\t\t\tif (prop.computed) {\n\t\t\t\t\t\t\t\t\t\ttraverse(prop.key);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\ttraverse(prop.value);\n\t\t\t\t\t\t\t\t} else if (prop.type === 'SpreadElement') {\n\t\t\t\t\t\t\t\t\ttraverse(prop.argument);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'ConditionalExpression':\n\t\t\t\t\t\t\ttraverse(node.test);\n\t\t\t\t\t\t\ttraverse(node.consequent);\n\t\t\t\t\t\t\ttraverse(node.alternate);\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'TemplateLiteral':\n\t\t\t\t\t\t\tnode.expressions.forEach(traverse);\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\ttraverse(node.key);\n\t\t\t},\n\t\t};\n\t},\n};\n\nfunction findVariable(scope: Scope.Scope, name: string) {\n\tlet currentScope: Scope.Scope | null = scope;\n\n\twhile (currentScope) {\n\t\tconst variable = currentScope.variables.find((v: { name: string }) => v.name === name);\n\n\t\tif (variable) {\n\t\t\treturn variable;\n\t\t}\n\n\t\t// Also check references for global variables or variables defined in the loop itself (like the loop variable)\n\t\t// The loop variable might not be in the 'variables' list of the surrounding scope yet if we are inside the loop statement\n\t\t// But for 'for-of', the loop variable is in a special scope or the upper scope.\n\t\t// Let's rely on standard scope analysis.\n\n\t\t// Special case: check if the variable is the loop variable itself (left side of for-of)\n\t\t// The scope analysis might handle this, but let's be sure.\n\n\t\tcurrentScope = currentScope.upper;\n\t}\n\n\t// If not found in scopes, it might be a global variable.\n\t// ESLint scope analysis usually includes globals in the global scope.\n\t// However, if we are in a module, we might need to check if it's an implicit global or defined elsewhere.\n\t// For now, let's assume standard scope resolution works.\n\n\treturn null;\n}\n\nexport default rule;\n","import { createRequire } from 'module';\nimport noModuleScopeTrack from './rules/no-module-scope-track.js';\nimport preferOnInput from './rules/prefer-oninput.js';\nimport noReturnInComponent from './rules/no-return-in-component.js';\nimport controlFlowJsx from './rules/control-flow-jsx.js';\nimport noLazyDestructuringInModules from './rules/no-lazy-destructuring-in-modules.js';\nimport validForOfKey from './rules/valid-for-of-key.js';\n\nconst plugin = {\n\tmeta: {\n\t\tname: '@tsrx/eslint-plugin',\n\t\tversion: '0.1.3',\n\t},\n\trules: {\n\t\t'no-module-scope-track': noModuleScopeTrack,\n\t\t'prefer-oninput': preferOnInput,\n\t\t'no-return-in-component': noReturnInComponent,\n\t\t'control-flow-jsx': controlFlowJsx,\n\t\t'no-lazy-destructuring-in-modules': noLazyDestructuringInModules,\n\t\t'valid-for-of-key': validForOfKey,\n\t},\n\tconfigs: {} as any,\n};\n\n// Try to load optional parsers\nconst require = createRequire(import.meta.url);\n\nlet rippleParser: any;\nlet tsParser: any;\n\ntry {\n\trippleParser = require('@tsrx/eslint-parser');\n} catch {\n\t// @tsrx/eslint-parser is optional\n\trippleParser = null;\n}\n\ntry {\n\ttsParser = require('@typescript-eslint/parser');\n} catch {\n\t// @typescript-eslint/parser is optional\n\ttsParser = null;\n}\n\n// Helper to create config objects\nfunction createConfig(name: string, files: string[], parser: any) {\n\tconst config: any = {\n\t\tname,\n\t\tfiles,\n\t\tplugins: {\n\t\t\tripple: plugin,\n\t\t},\n\t\trules: {\n\t\t\t'ripple/no-module-scope-track': 'error',\n\t\t\t'ripple/prefer-oninput': 'warn',\n\t\t\t'ripple/control-flow-jsx': 'error',\n\t\t\t'ripple/no-lazy-destructuring-in-modules': 'error',\n\t\t\t'ripple/valid-for-of-key': 'error',\n\t\t},\n\t};\n\n\t// Only add parser if it's available\n\tif (parser) {\n\t\tconfig.languageOptions = {\n\t\t\tparser,\n\t\t\tparserOptions: {\n\t\t\t\tecmaVersion: 'latest',\n\t\t\t\tsourceType: 'module',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn config;\n}\n\n// Recommended configuration (flat config format)\nplugin.configs.recommended = [\n\tcreateConfig('ripple/recommended-ripple-files', ['**/*.tsrx'], rippleParser),\n\tcreateConfig('ripple/recommended-typescript-files', ['**/*.ts', '**/*.tsx'], tsParser),\n\t{\n\t\tname: 'ripple/ignores',\n\t\tignores: ['**/*.d.ts', '**/node_modules/**', '**/dist/**', '**/build/**'],\n\t},\n];\n\n// Strict configuration (flat config format)\nplugin.configs.strict = [\n\tcreateConfig('ripple/strict-ripple-files', ['**/*.tsrx'], rippleParser),\n\tcreateConfig('ripple/strict-typescript-files', ['**/*.ts', '**/*.tsx'], tsParser),\n\t{\n\t\tname: 'ripple/ignores',\n\t\tignores: ['**/*.d.ts', '**/node_modules/**', '**/dist/**', '**/build/**'],\n\t},\n];\n\nexport default plugin;\n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B;GAC3B;EACD;CAGD,IAAI,QACH,OAAO,kBAAkB;EACxB;EACA,eAAe;GACd,aAAa;GACb,YAAY;GACZ;EACD;CAGF,OAAO;;AAIR,OAAO,QAAQ,cAAc;CAC5B,aAAa,mCAAmC,CAAC,YAAY,EAAE,aAAa;CAC5E,aAAa,uCAAuC,CAAC,WAAW,WAAW,EAAE,SAAS;CACtF;EACC,MAAM;EACN,SAAS;GAAC;GAAa;GAAsB;GAAc;GAAc;EACzE;CACD;AAGD,OAAO,QAAQ,SAAS;CACvB,aAAa,8BAA8B,CAAC,YAAY,EAAE,aAAa;CACvE,aAAa,kCAAkC,CAAC,WAAW,WAAW,EAAE,SAAS;CACjF;EACC,MAAM;EACN,SAAS;GAAC;GAAa;GAAsB;GAAc;GAAc;EACzE;CACD"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["rule","rule","rule","NESTED_BOUNDARY_TYPES","functionNode","rule","rule","noModuleScopeTrack","preferOnInput","noReturnInComponent","controlFlowJsx","noLazyDestructuringInModules","validForOfKey"],"sources":["../src/rules/no-module-scope-track.ts","../src/rules/prefer-oninput.ts","../src/rules/no-return-in-component.ts","../src/utils/tsrx.ts","../src/rules/control-flow-jsx.ts","../src/rules/no-lazy-destructuring-in-modules.ts","../src/rules/valid-for-of-key.ts","../src/index.ts"],"sourcesContent":["import type { Rule } from 'eslint';\nimport type * as AST from '@tsrx/core/types/estree';\n\nconst rule: Rule.RuleModule = {\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription: 'Disallow calling track() at module scope',\n\t\t\trecommended: true,\n\t\t},\n\t\tmessages: {\n\t\t\tmoduleScope: 'track() cannot be called at module scope. Move it into a function body.',\n\t\t},\n\t\tschema: [],\n\t},\n\tcreate(context) {\n\t\tlet functionDepth = 0;\n\n\t\tconst incrementFunctionDepth = () => functionDepth++;\n\t\tconst decrementFunctionDepth = () => functionDepth--;\n\n\t\treturn {\n\t\t\tFunctionDeclaration: incrementFunctionDepth,\n\t\t\t'FunctionDeclaration:exit': decrementFunctionDepth,\n\t\t\tFunctionExpression: incrementFunctionDepth,\n\t\t\t'FunctionExpression:exit': decrementFunctionDepth,\n\t\t\tArrowFunctionExpression: incrementFunctionDepth,\n\t\t\t'ArrowFunctionExpression:exit': decrementFunctionDepth,\n\n\t\t\t// Check track() calls\n\t\t\tCallExpression(node: AST.CallExpression) {\n\t\t\t\tif (\n\t\t\t\t\tnode.callee.type === 'Identifier' &&\n\t\t\t\t\tnode.callee.name === 'track' &&\n\t\t\t\t\tfunctionDepth === 0\n\t\t\t\t) {\n\t\t\t\t\tcontext.report({\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tmessageId: 'moduleScope',\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type * as AST from '@tsrx/core/types/estree';\nimport type * as ESTreeJSX from '@tsrx/core/types/estree-jsx';\n\nconst rule: Rule.RuleModule = {\n\tmeta: {\n\t\ttype: 'suggestion',\n\t\tdocs: {\n\t\t\tdescription: 'Prefer onInput over onChange for form inputs in Ripple',\n\t\t\trecommended: true,\n\t\t},\n\t\tmessages: {\n\t\t\tpreferOnInput:\n\t\t\t\t'Use \"onInput\" instead of \"onChange\". Ripple does not have synthetic events like React.',\n\t\t},\n\t\tfixable: 'code',\n\t\tschema: [],\n\t},\n\tcreate(context) {\n\t\tconst reported_ranges = new Set<string>();\n\n\t\tfunction report_onchange(node: ESTreeJSX.JSXAttribute) {\n\t\t\tconst range = node.range;\n\t\t\tif (!range) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst key = `${range[0]}:${range[1]}`;\n\t\t\tif (reported_ranges.has(key)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treported_ranges.add(key);\n\n\t\t\tcontext.report({\n\t\t\t\tnode,\n\t\t\t\tmessageId: 'preferOnInput',\n\t\t\t\tfix(fixer) {\n\t\t\t\t\treturn fixer.replaceText(node.name, 'onInput');\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\treturn {\n\t\t\t// Check JSX attributes (standard JSX)\n\t\t\t'JSXAttribute[name.name=\"onChange\"]'(node: ESTreeJSX.JSXAttribute) {\n\t\t\t\treport_onchange(node);\n\t\t\t},\n\t\t\t// Check object properties (for spread props)\n\t\t\t'Property[key.name=\"onChange\"]'(node: AST.Property) {\n\t\t\t\t// Only report if this looks like it's in a props object\n\t\t\t\tconst ancestors = context.sourceCode.getAncestors(node);\n\t\t\t\tconst inObjectExpression = ancestors.some(\n\t\t\t\t\t(ancestor) => ancestor.type === 'ObjectExpression',\n\t\t\t\t);\n\n\t\t\t\tif (inObjectExpression) {\n\t\t\t\t\tcontext.report({\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tmessageId: 'preferOnInput',\n\t\t\t\t\t\tfix(fixer) {\n\t\t\t\t\t\t\treturn fixer.replaceText(node.key, 'onInput');\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\n\nconst rule: Rule.RuleModule = {\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription: 'Deprecated: TSRX components are functions that return native TSRX expressions.',\n\t\t\trecommended: false,\n\t\t},\n\t\tdeprecated: true,\n\t\tmessages: {\n\t\t\tnoReturn: 'TSRX components should return native TSRX expressions.',\n\t\t},\n\t\tschema: [],\n\t},\n\tcreate(context) {\n\t\tvoid context;\n\t\treturn {};\n\t},\n};\n\nexport default rule;\n","import type * as AST from '@tsrx/core/types/estree';\n\ntype AnyNode = AST.Node & Record<string, any>;\n\nconst NESTED_BOUNDARY_TYPES = new Set([\n\t'FunctionDeclaration',\n\t'FunctionExpression',\n\t'ArrowFunctionExpression',\n\t'ClassDeclaration',\n\t'ClassExpression',\n\t'MethodDefinition',\n\t'PropertyDefinition',\n\t'StaticBlock',\n]);\n\nexport function isNativeTsrxJsxNode(node: AST.Node | null | undefined): boolean {\n\tif (!node) return false;\n\n\tif (\n\t\tnode.type === ('JSXCodeBlock' as string) ||\n\t\tnode.type === ('JSXIfExpression' as string) ||\n\t\tnode.type === ('JSXForExpression' as string) ||\n\t\tnode.type === ('JSXSwitchExpression' as string) ||\n\t\tnode.type === ('JSXTryExpression' as string)\n\t) {\n\t\treturn true;\n\t}\n\n\treturn (\n\t\t(node.type === ('JSXElement' as string) ||\n\t\t\tnode.type === ('JSXFragment' as string) ||\n\t\t\tnode.type === ('JSXStyleElement' as string)) &&\n\t\t!!(node as AnyNode).metadata?.native_tsrx\n\t);\n}\n\nexport function functionReturnsNativeTsrx(node: AST.Node): boolean {\n\tconst functionNode = node as AnyNode;\n\tconst body = functionNode.body as AnyNode | undefined;\n\n\tif (!body) {\n\t\treturn false;\n\t}\n\n\tif (isNativeTsrxJsxNode(body)) {\n\t\treturn true;\n\t}\n\n\tif (body.type !== 'BlockStatement') {\n\t\treturn false;\n\t}\n\n\treturn containsNativeTsrxReturn(body);\n}\n\nfunction containsNativeTsrxReturn(node: AnyNode): boolean {\n\tif (!node || typeof node !== 'object') {\n\t\treturn false;\n\t}\n\n\tif (node.type === 'ReturnStatement' && isNativeTsrxJsxNode(node.argument)) {\n\t\treturn true;\n\t}\n\n\tif (node.type !== 'BlockStatement' && NESTED_BOUNDARY_TYPES.has(node.type)) {\n\t\treturn false;\n\t}\n\n\tfor (const key of Object.keys(node)) {\n\t\tif (key === 'parent' || key === 'loc' || key === 'range') {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst value = node[key];\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (const child of value) {\n\t\t\t\tif (child?.type && containsNativeTsrxReturn(child)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (value?.type && containsNativeTsrxReturn(value)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n","import type { Rule } from 'eslint';\nimport type * as AST from '@tsrx/core/types/estree';\nimport { functionReturnsNativeTsrx } from '../utils/tsrx.js';\n\nconst NESTED_BOUNDARY_TYPES = new Set([\n\t'FunctionDeclaration',\n\t'FunctionExpression',\n\t'ArrowFunctionExpression',\n\t'ClassDeclaration',\n\t'ClassExpression',\n\t'MethodDefinition',\n\t'PropertyDefinition',\n]);\n\nconst rule: Rule.RuleModule = {\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription:\n\t\t\t\t'Require template output in @for blocks, but disallow JSX output in effect loops',\n\t\t\trecommended: true,\n\t\t},\n\t\tmessages: {\n\t\t\trequireJsxInLoop:\n\t\t\t\t'@for blocks in returned TSRX should contain template output. Render an element, fragment, or nested template directive.',\n\t\t\tnoJsxInEffectLoop:\n\t\t\t\t'For...of loops inside effect() should not contain JSX. Effects are for side effects, not rendering.',\n\t\t},\n\t\tschema: [],\n\t},\n\tcreate(context) {\n\t\tlet insideComponent = 0;\n\t\tlet insideEffect = 0;\n\t\tlet nonComponentFunctionDepth = 0;\n\t\tconst functionStack: boolean[] = [];\n\n\t\tfunction containsTemplateOutput(node: AST.Node, visited: Set<AST.Node> = new Set()): boolean {\n\t\t\tif (!node) return false;\n\n\t\t\t// Avoid infinite loops from circular references\n\t\t\tif (visited.has(node)) return false;\n\t\t\tvisited.add(node);\n\n\t\t\tif (visited.size > 1 && NESTED_BOUNDARY_TYPES.has(node.type)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tnode.type === ('JSXElement' as string) ||\n\t\t\t\tnode.type === ('JSXFragment' as string) ||\n\t\t\t\tnode.type === ('JSXStyleElement' as string) ||\n\t\t\t\tnode.type === ('JSXIfExpression' as string) ||\n\t\t\t\tnode.type === ('JSXForExpression' as string) ||\n\t\t\t\tnode.type === ('JSXSwitchExpression' as string) ||\n\t\t\t\tnode.type === ('JSXTryExpression' as string)\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (node.type === ('JSXCodeBlock' as string)) {\n\t\t\t\tconst render = (node as any).render;\n\t\t\t\treturn !!render && containsTemplateOutput(render, visited);\n\t\t\t}\n\n\t\t\tconst keys = Object.keys(node);\n\t\t\tfor (const key of keys) {\n\t\t\t\tif (key === 'parent' || key === 'loc' || key === 'range') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst value = (node as any)[key];\n\t\t\t\tif (value && typeof value === 'object') {\n\t\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\t\tfor (const item of value) {\n\t\t\t\t\t\t\tif (item && typeof item === 'object' && containsTemplateOutput(item, visited)) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (value.type && containsTemplateOutput(value, visited)) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn {\n\t\t\tFunctionDeclaration: enterFunction,\n\t\t\t'FunctionDeclaration:exit': exitFunction,\n\t\t\tFunctionExpression: enterFunction,\n\t\t\t'FunctionExpression:exit': exitFunction,\n\t\t\tArrowFunctionExpression: enterFunction,\n\t\t\t'ArrowFunctionExpression:exit': exitFunction,\n\n\t\t\t\"CallExpression[callee.name='effect']\"() {\n\t\t\t\tinsideEffect++;\n\t\t\t},\n\t\t\t\"CallExpression[callee.name='effect']:exit\"() {\n\t\t\t\tinsideEffect--;\n\t\t\t},\n\n\t\t\tForOfStatement(node: AST.ForOfStatement) {\n\t\t\t\tif (insideComponent === 0 || insideEffect === 0) return;\n\n\t\t\t\tif (containsTemplateOutput(node.body)) {\n\t\t\t\t\tcontext.report({\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tmessageId: 'noJsxInEffectLoop',\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tJSXForExpression(node: AST.Node) {\n\t\t\t\tif (insideComponent === 0 || nonComponentFunctionDepth > 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst body = (node as any).body;\n\t\t\t\tif (!body || containsTemplateOutput(body)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode,\n\t\t\t\t\tmessageId: 'requireJsxInLoop',\n\t\t\t\t});\n\t\t\t},\n\t\t};\n\n\t\tfunction enterFunction(node: AST.Node) {\n\t\t\tconst isComponent = functionReturnsNativeTsrx(node);\n\t\t\tfunctionStack.push(isComponent);\n\n\t\t\tif (isComponent) {\n\t\t\t\tinsideComponent++;\n\t\t\t} else if (insideComponent > 0) {\n\t\t\t\tnonComponentFunctionDepth++;\n\t\t\t}\n\t\t}\n\n\t\tfunction exitFunction() {\n\t\t\tconst isComponent = functionStack.pop();\n\n\t\t\tif (isComponent) {\n\t\t\t\tinsideComponent--;\n\t\t\t} else if (insideComponent > 0) {\n\t\t\t\tnonComponentFunctionDepth--;\n\t\t\t}\n\t\t}\n\t},\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\n\nconst rule: Rule.RuleModule = {\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription: 'Disallow lazy destructuring (&[] / &{}) in TypeScript/JavaScript modules',\n\t\t\trecommended: true,\n\t\t},\n\t\tmessages: {\n\t\t\tnoLazyDestructuring:\n\t\t\t\t'Lazy destructuring (&[] / &{}) cannot be used in TypeScript/JavaScript modules. Use .value to read and write tracked values instead.',\n\t\t},\n\t\tschema: [],\n\t},\n\tcreate(context) {\n\t\tconst filename = context.filename;\n\n\t\t// Skip TSRX files where lazy destructuring is valid\n\t\tif (filename && filename.endsWith('.tsrx')) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\tArrayPattern(node: any) {\n\t\t\t\tif (node.lazy === true) {\n\t\t\t\t\tcontext.report({\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tmessageId: 'noLazyDestructuring',\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t\tObjectPattern(node: any) {\n\t\t\t\tif (node.lazy === true) {\n\t\t\t\t\tcontext.report({\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tmessageId: 'noLazyDestructuring',\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type * as AST from '@tsrx/core/types/estree';\nimport type { Scope } from 'eslint';\n\nconst rule: Rule.RuleModule = {\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription: 'Ensure variables used in for..of key expression are defined',\n\t\t\trecommended: true,\n\t\t},\n\t\tmessages: {\n\t\t\tundefinedVariable: \"Variable '{{name}}' is not defined.\",\n\t\t},\n\t\tschema: [],\n\t},\n\tcreate(context) {\n\t\tconst checkForOfKey = (node: AST.ForOfStatement | AST.JSXForExpression) => {\n\t\t\tif (!node.key) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst checkIdentifier = (identifier: AST.Identifier) => {\n\t\t\t\tconst scope = context.sourceCode.getScope(node);\n\t\t\t\tconst variable = findVariable(scope, identifier.name);\n\n\t\t\t\tif (!variable) {\n\t\t\t\t\tcontext.report({\n\t\t\t\t\t\tnode: identifier,\n\t\t\t\t\t\tmessageId: 'undefinedVariable',\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tname: identifier.name,\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst traverse = (node: AST.Node) => {\n\t\t\t\tif (!node) return;\n\n\t\t\t\tswitch (node.type) {\n\t\t\t\t\tcase 'Identifier':\n\t\t\t\t\t\tcheckIdentifier(node);\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'MemberExpression':\n\t\t\t\t\t\ttraverse(node.object);\n\n\t\t\t\t\t\tif (node.computed) {\n\t\t\t\t\t\t\ttraverse(node.property);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'BinaryExpression':\n\t\t\t\t\tcase 'LogicalExpression':\n\t\t\t\t\t\ttraverse(node.left);\n\t\t\t\t\t\ttraverse(node.right);\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'UnaryExpression':\n\t\t\t\t\t\ttraverse(node.argument);\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'CallExpression':\n\t\t\t\t\t\ttraverse(node.callee);\n\t\t\t\t\t\tnode.arguments.forEach(traverse);\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'ArrayExpression':\n\t\t\t\t\t\t(node.elements as (AST.Expression | AST.SpreadElement)[]).forEach(traverse);\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'ObjectExpression':\n\t\t\t\t\t\tnode.properties.forEach((prop: AST.Property | AST.SpreadElement) => {\n\t\t\t\t\t\t\tif (prop.type === 'Property') {\n\t\t\t\t\t\t\t\tif (prop.computed) {\n\t\t\t\t\t\t\t\t\ttraverse(prop.key);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ttraverse(prop.value);\n\t\t\t\t\t\t\t} else if (prop.type === 'SpreadElement') {\n\t\t\t\t\t\t\t\ttraverse(prop.argument);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'ConditionalExpression':\n\t\t\t\t\t\ttraverse(node.test);\n\t\t\t\t\t\ttraverse(node.consequent);\n\t\t\t\t\t\ttraverse(node.alternate);\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'TemplateLiteral':\n\t\t\t\t\t\tnode.expressions.forEach(traverse);\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\ttraverse(node.key);\n\t\t};\n\n\t\t// `@for (... ; key X)` loops parse to `JSXForExpression`, while the bare\n\t\t// `for (... ; key X)` form parses to `ForOfStatement`. Both carry the same\n\t\t// `key` shape, so validate either node type.\n\t\treturn {\n\t\t\tForOfStatement: checkForOfKey,\n\t\t\tJSXForExpression: checkForOfKey,\n\t\t};\n\t},\n};\n\nfunction findVariable(scope: Scope.Scope, name: string) {\n\tlet currentScope: Scope.Scope | null = scope;\n\n\twhile (currentScope) {\n\t\tconst variable = currentScope.variables.find((v: { name: string }) => v.name === name);\n\n\t\tif (variable) {\n\t\t\treturn variable;\n\t\t}\n\n\t\t// Also check references for global variables or variables defined in the loop itself (like the loop variable)\n\t\t// The loop variable might not be in the 'variables' list of the surrounding scope yet if we are inside the loop statement\n\t\t// But for 'for-of', the loop variable is in a special scope or the upper scope.\n\t\t// Let's rely on standard scope analysis.\n\n\t\t// Special case: check if the variable is the loop variable itself (left side of for-of)\n\t\t// The scope analysis might handle this, but let's be sure.\n\n\t\tcurrentScope = currentScope.upper;\n\t}\n\n\t// If not found in scopes, it might be a global variable.\n\t// ESLint scope analysis usually includes globals in the global scope.\n\t// However, if we are in a module, we might need to check if it's an implicit global or defined elsewhere.\n\t// For now, let's assume standard scope resolution works.\n\n\treturn null;\n}\n\nexport default rule;\n","import { createRequire } from 'module';\nimport noModuleScopeTrack from './rules/no-module-scope-track.js';\nimport preferOnInput from './rules/prefer-oninput.js';\nimport noReturnInComponent from './rules/no-return-in-component.js';\nimport controlFlowJsx from './rules/control-flow-jsx.js';\nimport noLazyDestructuringInModules from './rules/no-lazy-destructuring-in-modules.js';\nimport validForOfKey from './rules/valid-for-of-key.js';\n\nconst plugin = {\n\tmeta: {\n\t\tname: '@tsrx/eslint-plugin',\n\t\tversion: '0.1.3',\n\t},\n\trules: {\n\t\t'no-module-scope-track': noModuleScopeTrack,\n\t\t'prefer-oninput': preferOnInput,\n\t\t'no-return-in-component': noReturnInComponent,\n\t\t'control-flow-jsx': controlFlowJsx,\n\t\t'no-lazy-destructuring-in-modules': noLazyDestructuringInModules,\n\t\t'valid-for-of-key': validForOfKey,\n\t},\n\tconfigs: {} as any,\n};\n\n// Try to load optional parsers\nconst require = createRequire(import.meta.url);\n\nlet rippleParser: any;\nlet tsParser: any;\n\ntry {\n\trippleParser = require('@tsrx/eslint-parser');\n} catch {\n\t// @tsrx/eslint-parser is optional\n\trippleParser = null;\n}\n\ntry {\n\ttsParser = require('@typescript-eslint/parser');\n} catch {\n\t// @typescript-eslint/parser is optional\n\ttsParser = null;\n}\n\n// Helper to create config objects\nfunction createConfig(name: string, files: string[], parser: any) {\n\tconst config: any = {\n\t\tname,\n\t\tfiles,\n\t\tplugins: {\n\t\t\tripple: plugin,\n\t\t},\n\t\trules: {\n\t\t\t'ripple/no-module-scope-track': 'error',\n\t\t\t'ripple/prefer-oninput': 'warn',\n\t\t\t'ripple/control-flow-jsx': 'error',\n\t\t\t'ripple/no-lazy-destructuring-in-modules': 'error',\n\t\t\t'ripple/valid-for-of-key': 'error',\n\t\t},\n\t};\n\n\t// Only add parser if it's available\n\tif (parser) {\n\t\tconfig.languageOptions = {\n\t\t\tparser,\n\t\t\tparserOptions: {\n\t\t\t\tecmaVersion: 'latest',\n\t\t\t\tsourceType: 'module',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn config;\n}\n\n// Recommended configuration (flat config format)\nplugin.configs.recommended = [\n\tcreateConfig('ripple/recommended-ripple-files', ['**/*.tsrx'], rippleParser),\n\tcreateConfig('ripple/recommended-typescript-files', ['**/*.ts', '**/*.tsx'], tsParser),\n\t{\n\t\tname: 'ripple/ignores',\n\t\tignores: ['**/*.d.ts', '**/node_modules/**', '**/dist/**', '**/build/**'],\n\t},\n];\n\n// Strict configuration (flat config format)\nplugin.configs.strict = [\n\tcreateConfig('ripple/strict-ripple-files', ['**/*.tsrx'], rippleParser),\n\tcreateConfig('ripple/strict-typescript-files', ['**/*.ts', '**/*.tsx'], tsParser),\n\t{\n\t\tname: 'ripple/ignores',\n\t\tignores: ['**/*.d.ts', '**/node_modules/**', '**/dist/**', '**/build/**'],\n\t},\n];\n\nexport default plugin;\n"],"mappings":";;AAGA,MAAMA,SAAwB;CAC7B,MA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a;;CAQ7B,OAAO;;;;AClIR,MAAM,SAAS;CACd,MAAM;EACL,MAAM;EACN,SAAS;EACT;CACD,OAAO;EACN,yBAAyBC;EACzB,kBAAkBC;EAClB,0BAA0BC;EAC1B,oBAAoBC;EACpB,oCAAoCC;EACpC,oBAAoBC;EACpB;CACD,SAAS,EAAE;CACX;AAGD,MAAM,UAAU,cAAc,OAAO,KAAK,IAAI;AAE9C,IAAI;AACJ,IAAI;AAEJ,IAAI;CACH,eAAe,QAAQ,sBAAsB;QACtC;CAEP,eAAe;;AAGhB,IAAI;CACH,WAAW,QAAQ,4BAA4B;QACxC;CAEP,WAAW;;AAIZ,SAAS,aAAa,MAAc,OAAiB,QAAa;CACjE,MAAM,SAAc;EACnB;EACA;EACA,SAAS,EACR,QAAQ,QACR;EACD,OAAO;GACN,gCAAgC;GAChC,yBAAyB;GACzB,2BAA2B;GAC3B,2CAA2C;GAC3C,2BAA2B;GAC3B;EACD;CAGD,IAAI,QACH,OAAO,kBAAkB;EACxB;EACA,eAAe;GACd,aAAa;GACb,YAAY;GACZ;EACD;CAGF,OAAO;;AAIR,OAAO,QAAQ,cAAc;CAC5B,aAAa,mCAAmC,CAAC,YAAY,EAAE,aAAa;CAC5E,aAAa,uCAAuC,CAAC,WAAW,WAAW,EAAE,SAAS;CACtF;EACC,MAAM;EACN,SAAS;GAAC;GAAa;GAAsB;GAAc;GAAc;EACzE;CACD;AAGD,OAAO,QAAQ,SAAS;CACvB,aAAa,8BAA8B,CAAC,YAAY,EAAE,aAAa;CACvE,aAAa,kCAAkC,CAAC,WAAW,WAAW,EAAE,SAAS;CACjF;EACC,MAAM;EACN,SAAS;GAAC;GAAa;GAAsB;GAAc;GAAc;EACzE;CACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsrx/eslint-plugin",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.74",
|
|
4
4
|
"description": "ESLint plugin for Ripple",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"eslint": ">=9.0.0",
|
|
35
35
|
"@typescript-eslint/parser": "^8.56.1",
|
|
36
|
-
"@tsrx/eslint-parser": "0.3.
|
|
36
|
+
"@tsrx/eslint-parser": "0.3.74"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/eslint": "^9.6.1",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"tsdown": "^0.22.0",
|
|
44
44
|
"typescript": "^5.9.3",
|
|
45
45
|
"vitest": "^4.1.6",
|
|
46
|
-
"@tsrx/eslint-parser": "0.3.
|
|
47
|
-
"@tsrx/core": "0.1.
|
|
46
|
+
"@tsrx/eslint-parser": "0.3.74",
|
|
47
|
+
"@tsrx/core": "0.1.22"
|
|
48
48
|
},
|
|
49
49
|
"engines": {
|
|
50
50
|
"node": ">=22.0.0"
|