@studiometa/eslint-plugin-js-toolkit 3.9.0 → 4.0.0-alpha.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/README.md +78 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +2061 -1537
- package/dist/index.js.map +1 -7
- package/package.json +7 -7
- package/dist/rules/async-lifecycle-methods.d.ts +0 -7
- package/dist/rules/components-pascal-case.d.ts +0 -8
- package/dist/rules/emits-kebab-case.d.ts +0 -8
- package/dist/rules/emits-multi-word.d.ts +0 -8
- package/dist/rules/index.d.ts +0 -30
- package/dist/rules/no-create-app.d.ts +0 -7
- package/dist/rules/no-deep-utils-import.d.ts +0 -7
- package/dist/rules/no-deprecated-properties.d.ts +0 -7
- package/dist/rules/no-dispatch-event.d.ts +0 -7
- package/dist/rules/no-dollar-prefix.d.ts +0 -8
- package/dist/rules/no-event-listener-methods.d.ts +0 -7
- package/dist/rules/no-internal-barrel-import.d.ts +0 -7
- package/dist/rules/no-manual-intersection-observer.d.ts +0 -7
- package/dist/rules/no-manual-mutation-observer.d.ts +0 -7
- package/dist/rules/no-redundant-with-mount-when-in-view.d.ts +0 -7
- package/dist/rules/no-shadow-dom.d.ts +0 -7
- package/dist/rules/on-global-handler-prefix.d.ts +0 -7
- package/dist/rules/on-handler-naming.d.ts +0 -7
- package/dist/rules/options-camel-case.d.ts +0 -8
- package/dist/rules/prefer-destructured-lookups.d.ts +0 -8
- package/dist/rules/prefer-ref-over-query-selector.d.ts +0 -7
- package/dist/rules/refs-camel-case.d.ts +0 -8
- package/dist/rules/refs-no-bracket-access.d.ts +0 -7
- package/dist/rules/refs-plural-multiple.d.ts +0 -8
- package/dist/rules/require-children-declared-in-config.d.ts +0 -7
- package/dist/rules/require-config-name-pascal-case.d.ts +0 -8
- package/dist/rules/require-config.d.ts +0 -8
- package/dist/rules/require-destroyed-cleanup.d.ts +0 -12
- package/dist/rules/require-emit-declared-in-config.d.ts +0 -7
- package/dist/rules/require-options-declared-in-config.d.ts +0 -7
- package/dist/rules/require-refs-declared-in-config.d.ts +0 -7
- package/dist/utils/ast.d.ts +0 -51
- package/dist/utils/rule-tester.d.ts +0 -6
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../node_modules/@oxlint/plugins/index.js", "../src/utils/ast.ts", "../src/rules/require-config.ts", "../src/rules/require-config-name-pascal-case.ts", "../src/rules/refs-camel-case.ts", "../src/rules/options-camel-case.ts", "../src/rules/async-lifecycle-methods.ts", "../src/rules/on-handler-naming.ts", "../src/rules/on-global-handler-prefix.ts", "../src/rules/no-deprecated-properties.ts", "../src/rules/no-dispatch-event.ts", "../src/rules/no-shadow-dom.ts", "../src/rules/no-create-app.ts", "../src/rules/no-event-listener-methods.ts", "../src/rules/refs-plural-multiple.ts", "../src/rules/no-deep-utils-import.ts", "../src/rules/no-internal-barrel-import.ts", "../src/rules/refs-no-bracket-access.ts", "../src/rules/no-redundant-with-mount-when-in-view.ts", "../src/rules/prefer-ref-over-query-selector.ts", "../src/rules/require-refs-declared-in-config.ts", "../src/rules/no-manual-intersection-observer.ts", "../src/rules/no-manual-mutation-observer.ts", "../src/rules/emits-kebab-case.ts", "../src/rules/emits-multi-word.ts", "../src/rules/components-pascal-case.ts", "../src/rules/require-emit-declared-in-config.ts", "../src/rules/require-children-declared-in-config.ts", "../src/rules/require-options-declared-in-config.ts", "../src/rules/prefer-destructured-lookups.ts", "../src/rules/no-dollar-prefix.ts", "../src/rules/require-destroyed-cleanup.ts", "../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["//#region src-js/package/define.ts\n/**\n* Define a plugin.\n*\n* No-op function, just to provide type safety. Input is passed through unchanged.\n*\n* @param plugin - Plugin to define\n* @returns Same plugin as passed in\n*/\nfunction definePlugin(plugin) {\n\treturn plugin;\n}\n/**\n* Define a rule.\n*\n* No-op function, just to provide type safety. Input is passed through unchanged.\n*\n* @param rule - Rule to define\n* @returns Same rule as passed in\n*/\nfunction defineRule(rule) {\n\treturn rule;\n}\n//#endregion\n//#region src-js/package/compat.ts\nconst EMPTY_VISITOR = {};\n/**\n* Convert a plugin which used Oxlint's `createOnce` API to also work with ESLint.\n*\n* If any of the plugin's rules use the Oxlint alternative `createOnce` API,\n* add ESLint-compatible `create` methods to those rules, which delegate to `createOnce`.\n* This makes the plugin compatible with ESLint.\n*\n* The `plugin` object passed in is mutated in-place.\n*\n* @param plugin - Plugin to convert\n* @returns Plugin with all rules having `create` method\n* @throws {Error} If `plugin` is not an object, or `plugin.rules` is not an object\n*/\nfunction eslintCompatPlugin(plugin) {\n\tif (typeof plugin != \"object\" || !plugin) throw Error(\"Plugin must be an object\");\n\tlet { rules } = plugin;\n\tif (typeof rules != \"object\" || !rules) throw Error(\"Plugin must have an object as `rules` property\");\n\tlet afterHooksState = new AfterHooksState();\n\tfor (let ruleName in rules) Object.hasOwn(rules, ruleName) && convertRule(rules[ruleName], afterHooksState);\n\treturn plugin;\n}\n/**\n* Class containing state for tracking if any `after` hooks for a plugin's rules need to be called.\n*\n* # Aims\n*\n* Aims are:\n* 1. `after` hook of each rule runs after all other AST visit functions, and CFG event handlers.\n* 2. `after` hooks for *all* a plugin's rules run after *all* that plugin's rules have completed visiting AST.\n* 3. `after` hooks for *all* a plugin's rules run before *any* of plugin's rules begin linting another file.\n* 4. In the case of an error during AST traversal, `after` hooks are always still run.\n*\n* The above exactly matches the behavior when running a `createOnce` rule in Oxlint.\n*\n* # Why this is important\n*\n* All the complication comes from ensuring `after` hooks run even after an error during AST traversal.\n*\n* In ESLint CLI, an error will crash the process, so it doesn't particularly matter if `after` hooks run or not,\n* but language servers will typically swallow errors, and keep the process running.\n*\n* Rules using `before` and `after` hooks will often rely on both hooks running in a predictable order,\n* to maintain some internal state. For example, they may use `before` and `after` hooks to maintain a per-file\n* cache of data which is shared between rules. The cache use case is why rule (2) above is important.\n*\n* Below is an example of using `before` and `after` hooks to maintain a per-file cache, shared between rules.\n* It relies on all `before` hooks running before any rule starts visiting the AST,\n* and all `after` hooks running after all rules have finished visiting the AST.\n*\n* ```ts\n* let cache: Data | null = null;\n*\n* let numRunningRules = 0;\n*\n* const setupCache = (context) => {\n* if (cache === null) cache = new Data(context);\n* numRunningRules++;\n* };\n*\n* const teardownCache = () => {\n* numRunningRules--;\n* if (numRunningRules === 0) cache = null;\n* };\n*\n* const rule1 = {\n* createOnce(context) {\n* return {\n* before() {\n* setupCache(context);\n* },\n* Identifier(node) {\n* // Use `cache`\n* },\n* after: teardownCache,\n* };\n* },\n* };\n*\n* const rule2 = {\n* // Same as above\n* };\n*\n* const rule3 = {\n* // Same as above\n* };\n* ```\n*\n* If `after` hooks did not always run, the next lint run could get stale state, and malfunction.\n* If `after` hooks ran in the wrong order (e.g. after some `before` hooks for next file),\n* `numRunningRules` would never get to 0, and cache would never be cleared.\n*\n* Note that because all rules run together in a single AST traversal, if a rule from plugin X throws an error,\n* it can disrupt rules from plugin Y. This would make it hard to debug.\n*\n* # Mechanism\n*\n* ## Initialization\n*\n* Rules with an `after` hook register themselves by:\n*\n* 1. Calling `registerResetFunction` to register a function to run `after` hook and clean up internal state.\n* This call adds the reset fn to `resetFunctions`, and adds `AFTER_HOOK_INACTIVE` to `pendingStates`.\n* 2. Adding an `onCodePathEnd` CFG event handler to the visitor which calls `ruleFinished` at end of AST traversal.\n*\n* ## Per-file setup\n*\n* Before linting a file, `create` will call `setupAfterHook` which is created by `createContextAndVisitor`.\n* This registers that the `after` hook for the rule needs to run, by setting `pendingStates[ruleIndex]`\n* to `AFTER_HOOK_PENDING`, and incrementing `pendingCount`.\n*\n* If a cleanup microtask has not been scheduled yet, one is scheduled now (see reason below).\n*\n* ## Normal operation\n*\n* AST traversal for each rule ends with `ruleFinished` hook being called from `onCodePathEnd` CFG event handler.\n* It increments `lintFinishedCount`. If `lintFinishedCount` equals `pendingCount`, all rules have finished linting\n* the file, and `reset` is called, which calls all the pending `after` hooks.\n*\n* ## Error handling\n*\n* If an error is thrown during AST traversal, we ensure that `after` hooks are still run by 2 mechanisms:\n*\n* ### 1. Next microtick\n*\n* Before any rules began linting files, a microtask was scheduled, which runs on next micro-tick.\n* All language servers we're aware of run each lint task in a separate tick, so this microtask will run in next tick\n* after a linting run, before the next lint task starts.\n*\n* If the linting run completed successfully, the microtask does nothing.\n*\n* But if an error was thrown during AST traversal, this will be visible from the state of `pendingCount`.\n* The microtask will run any `after` hooks which need to be run, and reset state to reflect that there are\n* no more pending `after` hooks.\n*\n* ### 2. Fallback: Next lint run\n*\n* Before linting any file, the state of `pendingCount` is checked.\n* If any `after` hooks are still pending, they are run immediately.\n* They're run before the `context` objects in `createOnce` closures are updated to the next file,\n* so they run with access to the old `context` object from the last file.\n*\n* This fallback should not be required, but it's included as \"belt and braces\", to handle if any language server\n* or other environment running ESLint programmatically, does not pause a tick between linting runs.\n*/\nvar AfterHooksState = class {\n\tresetFunctions = [];\n\tpendingStates = [];\n\tpendingCount = 0;\n\tlintFinishedCount = 0;\n\tresetIsScheduled = !1;\n\tsourceCode = null;\n\tresetMicrotask = this.resetMicrotaskImpl.bind(this);\n\t/**\n\t* Register a function to run `after` hook for a rule, and reset state.\n\t* @param reset - Function to run `after` hook and reset state\n\t* @returns Index of rule\n\t*/\n\tregisterResetFunction(reset) {\n\t\tlet { pendingStates } = this, index = pendingStates.length;\n\t\treturn pendingStates.push(0), this.resetFunctions.push(reset), index;\n\t}\n\t/**\n\t* Register that a rule with `after` hook has completed linting a file.\n\t* Called by `onCodePathEnd` CFG event handler which is added to visitor for rules with `after` hooks.\n\t*\n\t* If all rules with an `after` hook which needs to be run have completed linting the file, run all `after` hooks.\n\t*/\n\truleFinished() {\n\t\tthis.lintFinishedCount++, this.lintFinishedCount === this.pendingCount && this.reset(!1);\n\t}\n\t/**\n\t* Call all reset functions where corresponding entry in `pendingStates` is `AFTER_HOOK_PENDING`.\n\t* Should only be called when some `after` hooks are pending.\n\t*\n\t* @param ignoreErrors - `true` to catch and silently ignore any errors which occur in `after` hooks.\n\t* `false` to throw them,\n\t* @throws {unknown} If `ignoreErrors` is `false` and an error occurs in any `after` hooks.\n\t*/\n\treset(ignoreErrors) {\n\t\tthis.pendingCount;\n\t\tlet { resetFunctions, pendingStates } = this, hooksLen = pendingStates.length, hasError = !1, error;\n\t\tfor (let i = 0; i < hooksLen; i++) if (pendingStates[i] !== 0) {\n\t\t\tpendingStates[i] = 0;\n\t\t\ttry {\n\t\t\t\tresetFunctions[i]();\n\t\t\t} catch (e) {\n\t\t\t\thasError === !1 && (hasError = !0, error = e);\n\t\t\t}\n\t\t}\n\t\tif (this.pendingCount = 0, this.lintFinishedCount = 0, this.sourceCode = null, hasError === !0 && ignoreErrors === !1) throw error;\n\t}\n\t/**\n\t* Schedule a microtask to run `reset` functions.\n\t*/\n\tscheduleReset() {\n\t\tqueueMicrotask(this.resetMicrotask), this.resetIsScheduled = !0;\n\t}\n\t/**\n\t* Function which is scheduled as the cleanup microtask.\n\t* `scheduleReset` uses `resetMicrotask` which is this method bound to `this`.\n\t*/\n\tresetMicrotaskImpl() {\n\t\tthis.resetIsScheduled = !1, this.pendingCount !== 0 && this.reset(!0);\n\t}\n};\n/**\n* Convert a rule.\n*\n* The `rule` object passed in is mutated in-place.\n*\n* @param rule - Rule to convert\n* @param afterHooksState - State of `after` hooks\n* @throws {Error} If `rule` is not an object\n*/\nfunction convertRule(rule, afterHooksState) {\n\tif (typeof rule != \"object\" || !rule) throw Error(\"Rule must be an object\");\n\tif (\"create\" in rule) return;\n\tlet context = null, visitor, beforeHook, setupAfterHook;\n\trule.create = (eslintContext) => {\n\t\tcontext === null && ({context, visitor, beforeHook, setupAfterHook} = createContextAndVisitor(rule, afterHooksState));\n\t\tlet eslintFileContext = Object.getPrototypeOf(eslintContext);\n\t\tif (setupAfterHook !== null) {\n\t\t\tlet { sourceCode } = eslintFileContext;\n\t\t\tafterHooksState.sourceCode !== sourceCode && (afterHooksState.sourceCode = sourceCode, afterHooksState.pendingCount !== 0 && afterHooksState.reset(!0));\n\t\t}\n\t\treturn Object.defineProperties(context, {\n\t\t\tid: { value: eslintContext.id },\n\t\t\toptions: { value: eslintContext.options },\n\t\t\treport: { value: eslintContext.report }\n\t\t}), Object.setPrototypeOf(context, eslintFileContext), beforeHook !== null && beforeHook() === !1 ? EMPTY_VISITOR : (setupAfterHook !== null && (setupAfterHook(eslintFileContext.sourceCode.ast), afterHooksState.resetIsScheduled === !1 && afterHooksState.scheduleReset()), visitor);\n\t};\n}\nconst FILE_CONTEXT = Object.freeze({\n\tget filename() {\n\t\tthrow Error(\"Cannot access `context.filename` in `createOnce`\");\n\t},\n\tgetFilename() {\n\t\tthrow Error(\"Cannot call `context.getFilename` in `createOnce`\");\n\t},\n\tget physicalFilename() {\n\t\tthrow Error(\"Cannot access `context.physicalFilename` in `createOnce`\");\n\t},\n\tgetPhysicalFilename() {\n\t\tthrow Error(\"Cannot call `context.getPhysicalFilename` in `createOnce`\");\n\t},\n\tget cwd() {\n\t\tthrow Error(\"Cannot access `context.cwd` in `createOnce`\");\n\t},\n\tgetCwd() {\n\t\tthrow Error(\"Cannot call `context.getCwd` in `createOnce`\");\n\t},\n\tget sourceCode() {\n\t\tthrow Error(\"Cannot access `context.sourceCode` in `createOnce`\");\n\t},\n\tgetSourceCode() {\n\t\tthrow Error(\"Cannot call `context.getSourceCode` in `createOnce`\");\n\t},\n\tget languageOptions() {\n\t\tthrow Error(\"Cannot access `context.languageOptions` in `createOnce`\");\n\t},\n\tget settings() {\n\t\tthrow Error(\"Cannot access `context.settings` in `createOnce`\");\n\t},\n\textend(extension) {\n\t\treturn Object.freeze(Object.assign(Object.create(this), extension));\n\t},\n\tget parserOptions() {\n\t\tthrow Error(\"Cannot access `context.parserOptions` in `createOnce`\");\n\t},\n\tget parserPath() {\n\t\tthrow Error(\"Cannot access `context.parserPath` in `createOnce`\");\n\t}\n});\n/**\n* Call `createOnce` method of rule, and return `Context`, `Visitor`, and `beforeHook` (if any).\n*\n* @param rule - Rule with `createOnce` method\n* @param afterHooksState - State of `after` hooks\n* @returns Object with `context`, `visitor`, and `beforeHook` properties,\n* and `setupAfterHook` function if visitor has an `after` hook\n*/\nfunction createContextAndVisitor(rule, afterHooksState) {\n\tlet { createOnce } = rule;\n\tif (createOnce == null) throw Error(\"Rules must define either a `create` or `createOnce` method\");\n\tif (typeof createOnce != \"function\") throw Error(\"Rule `createOnce` property must be a function\");\n\tlet context = Object.create(FILE_CONTEXT, {\n\t\tid: {\n\t\t\tvalue: null,\n\t\t\tenumerable: !0,\n\t\t\tconfigurable: !0\n\t\t},\n\t\toptions: {\n\t\t\tvalue: null,\n\t\t\tenumerable: !0,\n\t\t\tconfigurable: !0\n\t\t},\n\t\treport: {\n\t\t\tvalue() {\n\t\t\t\tthrow Error(\"Cannot report errors in `createOnce`\");\n\t\t\t},\n\t\t\tenumerable: !0,\n\t\t\tconfigurable: !0\n\t\t}\n\t}), { before: beforeHook, after: afterHook, ...visitor } = createOnce.call(rule, context);\n\tif (beforeHook === void 0) beforeHook = null;\n\telse if (beforeHook !== null && typeof beforeHook != \"function\") throw Error(\"`before` property of visitor must be a function if defined\");\n\tlet setupAfterHook = null;\n\tif (afterHook != null) {\n\t\tif (typeof afterHook != \"function\") throw Error(\"`after` property of visitor must be a function if defined\");\n\t\tlet program = null, ruleIndex = afterHooksState.registerResetFunction(() => {\n\t\t\tprogram = null, afterHook();\n\t\t});\n\t\tsetupAfterHook = (ast) => {\n\t\t\tprogram = ast, afterHooksState.pendingStates[ruleIndex] = 1, afterHooksState.pendingCount++;\n\t\t};\n\t\tlet onCodePathEnd = visitor.onCodePathEnd;\n\t\tvisitor.onCodePathEnd = onCodePathEnd == null ? function(_codePath, node) {\n\t\t\tnode === program && afterHooksState.ruleFinished();\n\t\t} : function(codePath, node) {\n\t\t\tonCodePathEnd.call(this, codePath, node), node === program && afterHooksState.ruleFinished();\n\t\t};\n\t}\n\treturn {\n\t\tcontext,\n\t\tvisitor,\n\t\tbeforeHook,\n\t\tsetupAfterHook\n\t};\n}\n//#endregion\nexport { definePlugin, defineRule, eslintCompatPlugin };\n", "/**\n * ESLint v9 compatible AST node types used across rules.\n * We use loose typings here since oxlint/eslint expose their own node types.\n */\n\nexport type Node = Record<string, any>;\nexport type RuleContext = Record<string, any>;\n\nexport type RuleMeta = {\n type?: 'problem' | 'suggestion' | 'layout';\n fixable?: 'code' | 'whitespace';\n hasSuggestions?: boolean;\n docs?: { description?: string };\n messages?: Record<string, string>;\n};\n\nexport function createRule<V extends Record<string, (node: Node) => unknown>>(rule: {\n meta?: RuleMeta;\n createOnce(context: RuleContext): V;\n}): { meta?: RuleMeta; createOnce(context: RuleContext): V } {\n return rule;\n}\n\nexport const LIFECYCLE_METHODS = new Set([\n 'mounted',\n 'destroyed',\n 'updated',\n 'terminated',\n 'ticked',\n 'scrolled',\n 'resized',\n 'moved',\n 'loaded',\n 'keyed',\n]);\n\nexport const TOOLKIT_PACKAGE = '@studiometa/js-toolkit';\n\n/**\n * Returns true if a class declaration extends an identifier imported from\n * @studiometa/js-toolkit, or extends a bare identifier named `Base`.\n *\n * This is a heuristic \u2014 we cannot do full type resolution in a lint rule.\n */\nexport function isBaseSubclass(node: Node, context: RuleContext): boolean {\n if (node.type !== 'ClassDeclaration' && node.type !== 'ClassExpression') {\n return false;\n }\n\n if (!node.superClass) {\n return false;\n }\n\n const superName = node.superClass.type === 'Identifier' ? node.superClass.name : null;\n\n if (!superName) {\n return false;\n }\n\n // Fast path: class extends Base\n if (superName === 'Base') {\n return true;\n }\n\n // Check if the superclass identifier is imported from @studiometa/js-toolkit\n const sourceCode = context.sourceCode ?? context.getSourceCode?.();\n const ast = sourceCode?.ast;\n\n if (!ast) {\n return false;\n }\n\n for (const node of ast.body) {\n if (node.type !== 'ImportDeclaration') continue;\n if (node.source.value !== TOOLKIT_PACKAGE) continue;\n\n for (const specifier of node.specifiers) {\n if (specifier.type === 'ImportSpecifier' && specifier.local.name === superName) {\n return true;\n }\n }\n }\n\n return false;\n}\n\n/**\n * Returns true if the string is camelCase (starts lowercase, no separators).\n */\nexport function isCamelCase(value: string): boolean {\n return /^[a-z][a-zA-Z0-9]*$/.test(value);\n}\n\n/**\n * Returns true if the string is PascalCase.\n */\nexport function isPascalCase(value: string): boolean {\n return /^[A-Z][a-zA-Z0-9]*$/.test(value);\n}\n\n/**\n * Converts a kebab-case, snake_case or PascalCase string to camelCase.\n */\nexport function toCamelCase(value: string): string {\n return value\n .replace(/[-_](.)/g, (_, c: string) => c.toUpperCase())\n .replace(/^[A-Z]/, (c) => c.toLowerCase());\n}\n\n/**\n * Converts a kebab-case, snake_case or camelCase string to PascalCase.\n */\nexport function toPascalCase(value: string): string {\n return value\n .replace(/[-_](.)/g, (_, c: string) => c.toUpperCase())\n .replace(/^[a-z]/, (c) => c.toUpperCase());\n}\n\n/**\n * Walks up ancestor nodes to find the nearest class declaration/expression.\n */\nexport function findEnclosingClass(ancestors: Node[]): Node | null {\n for (let i = ancestors.length - 1; i >= 0; i--) {\n const node = ancestors[i];\n if (node.type === 'ClassDeclaration' || node.type === 'ClassExpression') {\n return node;\n }\n }\n return null;\n}\n", "import { isBaseSubclass, type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nexport const requireConfig = createRule({\n meta: {\n type: 'problem',\n docs: {\n description: 'Require a static config property on classes extending Base',\n },\n messages: {\n missingConfig: 'Classes extending Base must define a static config property.',\n missingName: 'The static config must include a name property.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ClassDeclaration(node: Node) {\n check(node, context);\n },\n ClassExpression(node: Node) {\n check(node, context);\n },\n };\n },\n});\n\nfunction check(node: Node, context: RuleContext) {\n if (!isBaseSubclass(node, context)) return;\n\n const body: Node[] = node.body?.body ?? [];\n\n const configProp = body.find(\n (member: Node) =>\n member.type === 'PropertyDefinition' &&\n member.static === true &&\n member.key?.name === 'config',\n );\n\n if (!configProp) {\n context.report({ node, messageId: 'missingConfig' });\n return;\n }\n\n // Check that config has a `name` property\n const value = configProp.value;\n if (!value || value.type !== 'ObjectExpression') return;\n\n const hasName = value.properties?.some(\n (prop: Node) => prop.type === 'Property' && prop.key?.name === 'name' && prop.value?.value,\n );\n\n if (!hasName) {\n context.report({ node: configProp, messageId: 'missingName' });\n }\n}\n", "import {\n isBaseSubclass,\n isPascalCase,\n toPascalCase,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nexport const requireConfigNamePascalCase = createRule({\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description: 'Require config.name to be PascalCase on classes extending Base',\n },\n messages: {\n notPascalCase: 'config.name \"{{name}}\" must be PascalCase.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ClassDeclaration(node: Node) {\n check(node, context);\n },\n ClassExpression(node: Node) {\n check(node, context);\n },\n };\n },\n});\n\nfunction check(node: Node, context: RuleContext) {\n if (!isBaseSubclass(node, context)) return;\n\n const body: Node[] = node.body?.body ?? [];\n\n const configProp = body.find(\n (member: Node) =>\n member.type === 'PropertyDefinition' &&\n member.static === true &&\n member.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return;\n\n const nameProp = configProp.value.properties?.find(\n (prop: Node) => prop.type === 'Property' && prop.key?.name === 'name',\n );\n\n if (!nameProp) return;\n\n const nameValue = nameProp.value?.value;\n if (typeof nameValue !== 'string') return;\n\n if (!isPascalCase(nameValue)) {\n context.report({\n node: nameProp.value,\n messageId: 'notPascalCase',\n data: { name: nameValue },\n fix: (fixer: any) => fixer.replaceText(nameProp.value, `'${toPascalCase(nameValue)}'`),\n });\n }\n}\n", "import {\n isBaseSubclass,\n isCamelCase,\n toCamelCase,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nexport const refsCamelCase = createRule({\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description: 'Require ref names in static config to be camelCase',\n },\n messages: {\n notCamelCase: 'Ref name \"{{name}}\" must be camelCase.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ClassDeclaration(node: Node) {\n check(node, context);\n },\n ClassExpression(node: Node) {\n check(node, context);\n },\n };\n },\n});\n\nfunction check(node: Node, context: RuleContext) {\n if (!isBaseSubclass(node, context)) return;\n\n const body: Node[] = node.body?.body ?? [];\n\n const configProp = body.find(\n (member: Node) =>\n member.type === 'PropertyDefinition' &&\n member.static === true &&\n member.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return;\n\n const refsProp = configProp.value.properties?.find(\n (prop: Node) => prop.type === 'Property' && prop.key?.name === 'refs',\n );\n\n if (!refsProp?.value || refsProp.value.type !== 'ArrayExpression') return;\n\n for (const element of refsProp.value.elements ?? []) {\n if (!element || element.type !== 'Literal') continue;\n const raw = element.value;\n if (typeof raw !== 'string') continue;\n // Strip the multiple-ref suffix before checking casing\n const name = raw.endsWith('[]') ? raw.slice(0, -2) : raw;\n if (!isCamelCase(name)) {\n const fixed = toCamelCase(name) + (raw.endsWith('[]') ? '[]' : '');\n context.report({\n node: element,\n messageId: 'notCamelCase',\n data: { name },\n fix: (fixer: any) => fixer.replaceText(element, `'${fixed}'`),\n });\n }\n }\n}\n", "import {\n isBaseSubclass,\n isCamelCase,\n toCamelCase,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nexport const optionsCamelCase = createRule({\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description: 'Require option keys in static config to be camelCase',\n },\n messages: {\n notCamelCase: 'Option key \"{{name}}\" must be camelCase.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ClassDeclaration(node: Node) {\n check(node, context);\n },\n ClassExpression(node: Node) {\n check(node, context);\n },\n };\n },\n});\n\nfunction check(node: Node, context: RuleContext) {\n if (!isBaseSubclass(node, context)) return;\n\n const body: Node[] = node.body?.body ?? [];\n\n const configProp = body.find(\n (member: Node) =>\n member.type === 'PropertyDefinition' &&\n member.static === true &&\n member.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return;\n\n const optionsProp = configProp.value.properties?.find(\n (prop: Node) => prop.type === 'Property' && prop.key?.name === 'options',\n );\n\n if (!optionsProp?.value || optionsProp.value.type !== 'ObjectExpression') return;\n\n for (const prop of optionsProp.value.properties ?? []) {\n if (prop.type !== 'Property') continue;\n const name = prop.key?.name ?? prop.key?.value;\n if (typeof name !== 'string') continue;\n if (!isCamelCase(name)) {\n const fixed = toCamelCase(name);\n // Quoted key ('slides-to-show') vs identifier key (SlidesToShow)\n const fixedText = prop.key.type === 'Literal' ? `'${fixed}'` : fixed;\n context.report({\n node: prop.key,\n messageId: 'notCamelCase',\n data: { name },\n fix: (fixer: any) => fixer.replaceText(prop.key, fixedText),\n });\n }\n }\n}\n", "import {\n isBaseSubclass,\n LIFECYCLE_METHODS,\n findEnclosingClass,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nexport const asyncLifecycleMethods = createRule({\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description: 'Require lifecycle methods on Base subclasses to be async',\n },\n messages: {\n notAsync: 'Lifecycle method \"{{name}}\" must be declared as async.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n MethodDefinition(node: Node) {\n const name = node.key?.name;\n if (!name || !LIFECYCLE_METHODS.has(name)) return;\n if (node.value?.async) return;\n\n const ancestors = context.getAncestors\n ? context.getAncestors()\n : (context.sourceCode?.getAncestors?.(node) ?? []);\n\n const enclosingClass = findEnclosingClass(ancestors);\n if (!enclosingClass || !isBaseSubclass(enclosingClass, context)) return;\n\n context.report({\n node,\n messageId: 'notAsync',\n data: { name },\n fix: (fixer: any) => fixer.insertTextBefore(node.key, 'async '),\n });\n },\n };\n },\n});\n", "import {\n isBaseSubclass,\n findEnclosingClass,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\n// onXxxYyy \u2014 the part after \"on\" must start with an uppercase letter\nconst ON_HANDLER_RE = /^on[A-Z][a-zA-Z0-9]*$/;\n\nexport const onHandlerNaming = createRule({\n meta: {\n type: 'problem',\n docs: {\n description: 'Require event handler methods to follow the onXxxYyy naming convention',\n },\n messages: {\n invalidName:\n 'Event handler \"{{name}}\" must follow the onXxxYyy camelCase convention (e.g. onClickButton).',\n },\n },\n createOnce(context: RuleContext) {\n return {\n MethodDefinition(node: Node) {\n // Skip getters, setters \u2014 those are not event handlers\n if (node.kind === 'get' || node.kind === 'set') return;\n\n const name = node.key?.name;\n // Only lint methods that start with \"on\" followed by an uppercase letter \u2014\n // that's the unambiguous signal of an intended event handler.\n if (!name || !/^on[A-Z]/.test(name)) return;\n if (ON_HANDLER_RE.test(name)) return;\n\n const ancestors = context.getAncestors\n ? context.getAncestors()\n : (context.sourceCode?.getAncestors?.(node) ?? []);\n\n const enclosingClass = findEnclosingClass(ancestors);\n if (!enclosingClass || !isBaseSubclass(enclosingClass, context)) return;\n\n context.report({ node, messageId: 'invalidName', data: { name } });\n },\n };\n },\n});\n", "import {\n isBaseSubclass,\n findEnclosingClass,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\n// Events that only make sense on window/document, never on a DOM element.\n// Pointer, keyboard, and form events are intentionally excluded \u2014 they can all\n// fire on elements too, so onResize/onScroll without a prefix is the only\n// unambiguous mistake worth flagging automatically.\nconst GLOBAL_ONLY_EVENTS = new Set(['Resize']);\n\nexport const onGlobalHandlerPrefix = createRule({\n meta: {\n type: 'suggestion',\n docs: {\n description:\n 'Require global event handlers (resize, scroll, etc.) to be prefixed with onWindow or onDocument',\n },\n messages: {\n missingPrefix:\n '\"{{name}}\" looks like a global event handler. Use \"onWindow{{event}}\" or \"onDocument{{event}}\" to bind to window/document events.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n MethodDefinition(node: Node) {\n const name = node.key?.name;\n if (!name || !name.startsWith('on')) return;\n\n const suffix = name.slice(2); // strip \"on\"\n const event = GLOBAL_ONLY_EVENTS.has(suffix) ? suffix : null;\n if (!event) return;\n\n // Allow onWindow* and onDocument* \u2014 those are correct\n if (name.startsWith('onWindow') || name.startsWith('onDocument')) return;\n\n const ancestors = context.getAncestors\n ? context.getAncestors()\n : (context.sourceCode?.getAncestors?.(node) ?? []);\n\n const enclosingClass = findEnclosingClass(ancestors);\n if (!enclosingClass || !isBaseSubclass(enclosingClass, context)) return;\n\n context.report({\n node,\n messageId: 'missingPrefix',\n data: { name, event },\n });\n },\n };\n },\n});\n", "import {\n isBaseSubclass,\n findEnclosingClass,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nconst DEPRECATED = new Map([\n ['$parent', '$closest()'],\n ['$root', '$closest()'],\n ['$children', '$query()'],\n]);\n\nexport const noDeprecatedProperties = createRule({\n meta: {\n type: 'problem',\n docs: {\n description: 'Disallow deprecated Base properties ($parent, $children, $root)',\n },\n messages: {\n deprecated: '\"{{name}}\" is deprecated. Use {{replacement}} instead.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n MemberExpression(node: Node) {\n const prop = node.property?.name;\n if (!prop || !DEPRECATED.has(prop)) return;\n\n // Only flag `this.$parent` etc. \u2014 not arbitrary object access\n if (node.object?.type !== 'ThisExpression') return;\n\n const ancestors = context.getAncestors\n ? context.getAncestors()\n : (context.sourceCode?.getAncestors?.(node) ?? []);\n\n const enclosingClass = findEnclosingClass(ancestors);\n if (!enclosingClass || !isBaseSubclass(enclosingClass, context)) return;\n\n const replacement = DEPRECATED.get(prop);\n context.report({\n node,\n messageId: 'deprecated',\n data: { name: prop, replacement },\n });\n },\n };\n },\n});\n", "import {\n findEnclosingClass,\n isBaseSubclass,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nexport const noDispatchEvent = createRule({\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Disallow dispatchEvent() in Base subclasses \u2014 use this.$emit() instead',\n },\n messages: {\n useEmit: 'Use this.$emit() instead of dispatchEvent() to emit events in a Base component.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n CallExpression(node: Node) {\n const callee = node.callee;\n\n const isDispatchEvent =\n // this.dispatchEvent(...)\n (callee.type === 'MemberExpression' &&\n callee.object?.type === 'ThisExpression' &&\n callee.property?.name === 'dispatchEvent') ||\n // this.$el.dispatchEvent(...) or el.dispatchEvent(...)\n (callee.type === 'MemberExpression' && callee.property?.name === 'dispatchEvent');\n\n if (!isDispatchEvent) return;\n\n const ancestors = context.getAncestors\n ? context.getAncestors()\n : (context.sourceCode?.getAncestors?.(node) ?? []);\n\n const enclosingClass = findEnclosingClass(ancestors);\n if (!enclosingClass || !isBaseSubclass(enclosingClass, context)) return;\n\n context.report({ node, messageId: 'useEmit' });\n },\n };\n },\n});\n", "import {\n findEnclosingClass,\n isBaseSubclass,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nexport const noShadowDom = createRule({\n meta: {\n type: 'problem',\n docs: {\n description: 'Disallow attachShadow() in Base subclasses \u2014 js-toolkit uses Light DOM only',\n },\n messages: {\n noShadow:\n 'Do not use attachShadow() in a Base component. @studiometa/js-toolkit uses Light DOM only.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n CallExpression(node: Node) {\n const callee = node.callee;\n if (callee.type !== 'MemberExpression' || callee.property?.name !== 'attachShadow') {\n return;\n }\n\n const ancestors = context.getAncestors\n ? context.getAncestors()\n : (context.sourceCode?.getAncestors?.(node) ?? []);\n\n const enclosingClass = findEnclosingClass(ancestors);\n if (!enclosingClass || !isBaseSubclass(enclosingClass, context)) return;\n\n context.report({ node, messageId: 'noShadow' });\n },\n };\n },\n});\n", "import { type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nexport const noCreateApp = createRule({\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Disallow createApp() \u2014 use registerComponent() instead',\n },\n messages: {\n useRegister:\n 'createApp() is deprecated. Use registerComponent() from @studiometa/js-toolkit instead.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n CallExpression(node: Node) {\n const callee = node.callee;\n if (callee.type === 'Identifier' && callee.name === 'createApp') {\n context.report({ node, messageId: 'useRegister' });\n }\n },\n };\n },\n});\n", "import {\n findEnclosingClass,\n isBaseSubclass,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nconst FORBIDDEN = new Set(['addEventListener', 'removeEventListener']);\n\nexport const noEventListenerMethods = createRule({\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Disallow addEventListener/removeEventListener in Base subclasses \u2014 use on* methods instead',\n },\n messages: {\n useOnMethod:\n '\"{{method}}()\" should not be used in a Base component. ' +\n 'Define an \"on<Target><Event>()\" method instead \u2014 the framework handles binding and cleanup automatically.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n CallExpression(node: Node) {\n const callee = node.callee;\n if (callee.type !== 'MemberExpression') return;\n\n const method = callee.property?.name;\n if (!method || !FORBIDDEN.has(method)) return;\n\n // Only flag calls on `this.*`, `document`, or `window`\n let root = callee.object;\n while (root?.type === 'MemberExpression') root = root.object;\n const isThis = root?.type === 'ThisExpression';\n const isGlobal =\n root?.type === 'Identifier' && (root.name === 'document' || root.name === 'window');\n if (!isThis && !isGlobal) return;\n\n const ancestors = context.getAncestors\n ? context.getAncestors()\n : (context.sourceCode?.getAncestors?.(node) ?? []);\n\n const enclosingClass = findEnclosingClass(ancestors);\n if (!enclosingClass || !isBaseSubclass(enclosingClass, context)) return;\n\n context.report({ node, messageId: 'useOnMethod', data: { method } });\n },\n };\n },\n});\n", "import { isBaseSubclass, type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nexport const refsPluralMultiple = createRule({\n meta: {\n type: 'problem',\n docs: {\n description: 'Require multiple-ref names (using [] suffix) to be pluralized',\n },\n messages: {\n notPlural: 'Multiple ref \"{{name}}\" must be pluralized (e.g. \"{{name}}s[]\").',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ClassDeclaration(node: Node) {\n check(node, context);\n },\n ClassExpression(node: Node) {\n check(node, context);\n },\n };\n },\n});\n\nfunction check(node: Node, context: RuleContext) {\n if (!isBaseSubclass(node, context)) return;\n\n const body: Node[] = node.body?.body ?? [];\n\n const configProp = body.find(\n (member: Node) =>\n member.type === 'PropertyDefinition' &&\n member.static === true &&\n member.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return;\n\n const refsProp = configProp.value.properties?.find(\n (prop: Node) => prop.type === 'Property' && prop.key?.name === 'refs',\n );\n\n if (!refsProp?.value || refsProp.value.type !== 'ArrayExpression') return;\n\n for (const element of refsProp.value.elements ?? []) {\n if (!element || element.type !== 'Literal') continue;\n const raw = element.value;\n if (typeof raw !== 'string') continue;\n if (!raw.endsWith('[]')) continue;\n\n const name = raw.slice(0, -2);\n if (!name.endsWith('s')) {\n context.report({\n node: element,\n messageId: 'notPlural',\n data: { name },\n });\n }\n }\n}\n", "import { type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nconst UTILS_PREFIX = '@studiometa/js-toolkit/utils/';\n\n/**\n * A published per-symbol subpath: exactly one segment after `utils/`, and no dot in it.\n *\n * Since v3.9.0 every util is exported at `@studiometa/js-toolkit/utils/<name>`. Those subpaths are\n * public API and the cheapest way to import a util \u2014 they resolve to the module declaring the symbol,\n * so a consumer served by a CDN downloads that module instead of the whole `utils` barrel. Anything\n * deeper (`utils/math/damp.js`) reaches into the package layout, which is not part of the API and\n * changes without notice.\n *\n * Every key of the `exports` map is a symbol name, so none of them contains a dot; rejecting the dot\n * outright keeps a file path out (`utils/damp.ts`, `utils/foo.css`) whatever its extension.\n */\nconst PUBLIC_SUBPATH_RE = /^[^/.]+$/;\n\nexport const noDeepUtilsImport = createRule({\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Disallow importing internal module paths from @studiometa/js-toolkit/utils \u2014 use the public per-symbol subpath',\n },\n messages: {\n noDeepImport:\n 'Import from \"{{source}}\" reaches into the package layout. Use the public subpath \"@studiometa/js-toolkit/utils/<name>\" for a single util, or \"@studiometa/js-toolkit/utils\" for several.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ImportDeclaration(node: Node) {\n const source: string = node.source.value;\n if (!source.startsWith(UTILS_PREFIX)) return;\n\n if (PUBLIC_SUBPATH_RE.test(source.slice(UTILS_PREFIX.length))) return;\n\n // No autofix: the subpath key is the symbol's exported name, which does not always match the\n // module path (`utils/history.js` exports `push`, published as `utils/historyPush`), so a\n // mechanical rewrite can produce a subpath which does not exist.\n context.report({ node, messageId: 'noDeepImport', data: { source } });\n },\n };\n },\n});\n", "import { type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\n/** A relative import of a barrel: `'./utils/index.js'`, `'../Base/index.js'`. */\nconst RELATIVE_BARREL_RE = /^\\.{1,2}\\/.*\\/index\\.js$/;\n\nexport const noInternalBarrelImport = createRule({\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Disallow importing an internal barrel inside the package \u2014 import the declaring module instead',\n },\n messages: {\n noBarrelImport:\n 'Import from \"{{source}}\" pulls in every symbol the barrel names. Import the module declaring the symbol instead, so a consumer served by a CDN only downloads what it uses.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ImportDeclaration(node: Node) {\n const source: string = node.source.value;\n if (!RELATIVE_BARREL_RE.test(source)) return;\n\n context.report({ node, messageId: 'noBarrelImport', data: { source } });\n },\n };\n },\n});\n", "import { toCamelCase, type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nfunction isThisRefs(node: Node): boolean {\n return (\n node.type === 'MemberExpression' &&\n node.object?.type === 'ThisExpression' &&\n node.property?.name === '$refs'\n );\n}\n\nexport const refsNoBracketAccess = createRule({\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description: 'Disallow bracket access with [] suffix on this.$refs',\n },\n messages: {\n noBracketAccess: 'Use \"this.$refs.{{fixed}}\" instead of \"this.$refs[\\'{{raw}}\\']\".',\n },\n },\n createOnce(context: RuleContext) {\n return {\n MemberExpression(node: Node) {\n if (!isThisRefs(node.object)) return;\n if (!node.computed) return;\n const prop = node.property;\n if (prop.type !== 'Literal' || typeof prop.value !== 'string') return;\n const raw: string = prop.value;\n if (!raw.endsWith('[]')) return;\n\n const stripped = raw.slice(0, -2);\n const fixed = toCamelCase(stripped);\n\n context.report({\n node,\n messageId: 'noBracketAccess',\n data: { raw, fixed },\n fix(fixer: any) {\n const src = context.sourceCode ?? context.getSourceCode?.();\n const objText = src.getText(node.object);\n return fixer.replaceText(node, `${objText}.${fixed}`);\n },\n });\n },\n };\n },\n});\n", "import { type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nexport const noRedundantWithMountWhenInView = createRule({\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Disallow wrapping withMountWhenInView inside withScrolledInView (redundant)',\n },\n messages: {\n redundant:\n 'withScrolledInView already includes withMountWhenInView internally. Remove the inner withMountWhenInView call.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n 'ClassDeclaration, ClassExpression'(node: Node) {\n check(node, context);\n },\n };\n },\n});\n\nfunction check(node: Node, context: RuleContext) {\n const superClass = node.superClass;\n if (!superClass || superClass.type !== 'CallExpression') return;\n if (superClass.callee?.name !== 'withScrolledInView') return;\n\n const arg = superClass.arguments?.[0];\n if (!arg || arg.type !== 'CallExpression') return;\n if (arg.callee?.name !== 'withMountWhenInView') return;\n\n context.report({ node: superClass, messageId: 'redundant' });\n}\n", "import {\n findEnclosingClass,\n isBaseSubclass,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nconst QUERY_METHODS = new Set(['querySelector', 'querySelectorAll']);\n\nfunction isThisEl(node: Node): boolean {\n return (\n node.type === 'MemberExpression' &&\n node.object?.type === 'ThisExpression' &&\n node.property?.name === '$el'\n );\n}\n\nexport const preferRefOverQuerySelector = createRule({\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Prefer this.$refs over this.$el.querySelector() in Base subclasses',\n },\n messages: {\n preferRef:\n 'Avoid \"this.$el.{{method}}()\". Declare a ref in static config and use \"this.$refs\" instead.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n CallExpression(node: Node) {\n const callee = node.callee;\n if (callee?.type !== 'MemberExpression') return;\n if (!isThisEl(callee.object)) return;\n const method = callee.property?.name;\n if (!QUERY_METHODS.has(method)) return;\n\n const ancestors =\n context.getAncestors?.() ?? context.sourceCode?.getAncestors?.(node) ?? [];\n const cls = findEnclosingClass(ancestors);\n if (!cls || !isBaseSubclass(cls, context)) return;\n\n context.report({ node, messageId: 'preferRef', data: { method } });\n },\n };\n },\n});\n", "import {\n isBaseSubclass,\n toCamelCase,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nfunction collectDeclaredRefs(classNode: Node): Set<string> {\n const body: Node[] = classNode.body?.body ?? [];\n const configProp = body.find(\n (m: Node) => m.type === 'PropertyDefinition' && m.static === true && m.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return new Set();\n\n const refsProp = configProp.value.properties?.find(\n (p: Node) => p.type === 'Property' && p.key?.name === 'refs',\n );\n\n if (!refsProp?.value || refsProp.value.type !== 'ArrayExpression') return new Set();\n\n const names = new Set<string>();\n for (const el of refsProp.value.elements ?? []) {\n if (!el || el.type !== 'Literal' || typeof el.value !== 'string') continue;\n const raw: string = el.value;\n const stripped = raw.endsWith('[]') ? raw.slice(0, -2) : raw;\n names.add(toCamelCase(stripped));\n }\n return names;\n}\n\nfunction isThisRefs(node: Node): boolean {\n return (\n node.type === 'MemberExpression' &&\n node.object?.type === 'ThisExpression' &&\n node.property?.name === '$refs'\n );\n}\n\nexport const requireRefsDeclaredInConfig = createRule({\n meta: {\n type: 'problem',\n docs: {\n description: 'Require all this.$refs accesses to be declared in static config.refs',\n },\n messages: {\n undeclared: 'Ref \"{{name}}\" is not declared in static config.refs.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n 'ClassDeclaration, ClassExpression'(classNode: Node) {\n if (!isBaseSubclass(classNode, context)) return;\n\n const declared = collectDeclaredRefs(classNode);\n\n // Walk the class body looking for this.$refs.<name> accesses\n walkNode(classNode.body, (node: Node) => {\n if (node.type !== 'MemberExpression') return;\n if (!isThisRefs(node.object)) return;\n\n let refName: string | null = null;\n\n if (!node.computed && node.property?.type === 'Identifier') {\n refName = node.property.name;\n } else if (\n node.computed &&\n node.property?.type === 'Literal' &&\n typeof node.property.value === 'string'\n ) {\n const raw: string = node.property.value;\n const stripped = raw.endsWith('[]') ? raw.slice(0, -2) : raw;\n refName = toCamelCase(stripped);\n }\n\n if (refName && !declared.has(refName)) {\n context.report({\n node,\n messageId: 'undeclared',\n data: { name: refName },\n });\n }\n });\n },\n };\n },\n});\n\nfunction walkNode(node: Node, visit: (n: Node) => void) {\n if (!node || typeof node !== 'object') return;\n visit(node);\n for (const key of Object.keys(node)) {\n if (key === 'parent') continue;\n const child = node[key];\n if (Array.isArray(child)) {\n for (const item of child) walkNode(item, visit);\n } else if (child && typeof child === 'object' && child.type) {\n walkNode(child, visit);\n }\n }\n}\n", "import {\n findEnclosingClass,\n isBaseSubclass,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nexport const noManualIntersectionObserver = createRule({\n meta: {\n type: 'suggestion',\n docs: {\n description:\n 'Disallow manual IntersectionObserver inside Base subclasses; use withIntersectionObserver or withMountWhenInView instead',\n },\n messages: {\n noManual:\n 'Avoid manual \"new IntersectionObserver()\". Use \"withIntersectionObserver\" or \"withMountWhenInView\" decorators instead.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n NewExpression(node: Node) {\n if (node.callee?.name !== 'IntersectionObserver') return;\n\n const ancestors =\n context.getAncestors?.() ?? context.sourceCode?.getAncestors?.(node) ?? [];\n const cls = findEnclosingClass(ancestors);\n if (!cls || !isBaseSubclass(cls, context)) return;\n\n context.report({ node, messageId: 'noManual' });\n },\n };\n },\n});\n", "import {\n findEnclosingClass,\n isBaseSubclass,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nexport const noManualMutationObserver = createRule({\n meta: {\n type: 'suggestion',\n docs: {\n description:\n 'Disallow manual MutationObserver inside Base subclasses; use withMutation decorator instead',\n },\n messages: {\n noManual: 'Avoid manual \"new MutationObserver()\". Use the \"withMutation\" decorator instead.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n NewExpression(node: Node) {\n if (node.callee?.name !== 'MutationObserver') return;\n\n const ancestors =\n context.getAncestors?.() ?? context.sourceCode?.getAncestors?.(node) ?? [];\n const cls = findEnclosingClass(ancestors);\n if (!cls || !isBaseSubclass(cls, context)) return;\n\n context.report({ node, messageId: 'noManual' });\n },\n };\n },\n});\n", "import { isBaseSubclass, type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\n/**\n * Returns true if the string is kebab-case:\n * all lowercase letters, digits and hyphens, no underscores or uppercase.\n */\nfunction isKebabCase(value: string): boolean {\n return /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/.test(value);\n}\n\n/**\n * Converts a camelCase, PascalCase or snake_case string to kebab-case.\n */\nfunction toKebabCase(value: string): string {\n return value\n .replace(/([A-Z])/g, (_, c: string) => `-${c.toLowerCase()}`)\n .replace(/_/g, '-')\n .replace(/^-/, '')\n .toLowerCase();\n}\n\nfunction check(node: Node, context: RuleContext) {\n if (!isBaseSubclass(node, context)) return;\n\n const body: Node[] = node.body?.body ?? [];\n\n const configProp = body.find(\n (member: Node) =>\n member.type === 'PropertyDefinition' &&\n member.static === true &&\n member.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return;\n\n const emitsProp = configProp.value.properties?.find(\n (prop: Node) => prop.type === 'Property' && prop.key?.name === 'emits',\n );\n\n if (!emitsProp?.value || emitsProp.value.type !== 'ArrayExpression') return;\n\n for (const element of emitsProp.value.elements ?? []) {\n if (!element || element.type !== 'Literal') continue;\n const name = element.value;\n if (typeof name !== 'string') continue;\n if (!isKebabCase(name)) {\n const fixed = toKebabCase(name);\n context.report({\n node: element,\n messageId: 'notKebabCase',\n data: { name },\n fix: (fixer: any) => fixer.replaceText(element, `'${fixed}'`),\n });\n }\n }\n}\n\nexport const emitsKebabCase = createRule({\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description: 'Require emit names in static config to be kebab-case',\n },\n messages: {\n notKebabCase: 'Emit name \"{{name}}\" must be kebab-case (e.g. \"content-change\").',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ClassDeclaration(node: Node) {\n check(node, context);\n },\n ClassExpression(node: Node) {\n check(node, context);\n },\n };\n },\n});\n", "import { isBaseSubclass, type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nfunction check(node: Node, context: RuleContext) {\n if (!isBaseSubclass(node, context)) return;\n\n const body: Node[] = node.body?.body ?? [];\n\n const configProp = body.find(\n (member: Node) =>\n member.type === 'PropertyDefinition' &&\n member.static === true &&\n member.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return;\n\n const emitsProp = configProp.value.properties?.find(\n (prop: Node) => prop.type === 'Property' && prop.key?.name === 'emits',\n );\n\n if (!emitsProp?.value || emitsProp.value.type !== 'ArrayExpression') return;\n\n for (const element of emitsProp.value.elements ?? []) {\n if (!element || element.type !== 'Literal') continue;\n const name = element.value;\n if (typeof name !== 'string') continue;\n if (!name.includes('-')) {\n context.report({\n node: element,\n messageId: 'singleWord',\n data: { name },\n });\n }\n }\n}\n\nexport const emitsMultiWord = createRule({\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Require emit names in static config to be multi-word to avoid collision with native DOM events',\n },\n messages: {\n singleWord:\n 'Emit name \"{{name}}\" must be multi-word (e.g. \"item-click\" instead of \"click\") to avoid collisions with native DOM events.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ClassDeclaration(node: Node) {\n check(node, context);\n },\n ClassExpression(node: Node) {\n check(node, context);\n },\n };\n },\n});\n", "import {\n isBaseSubclass,\n isPascalCase,\n toPascalCase,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nfunction check(node: Node, context: RuleContext) {\n if (!isBaseSubclass(node, context)) return;\n\n const body: Node[] = node.body?.body ?? [];\n\n const configProp = body.find(\n (member: Node) =>\n member.type === 'PropertyDefinition' &&\n member.static === true &&\n member.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return;\n\n const componentsProp = configProp.value.properties?.find(\n (prop: Node) => prop.type === 'Property' && prop.key?.name === 'components',\n );\n\n if (!componentsProp?.value || componentsProp.value.type !== 'ObjectExpression') return;\n\n for (const prop of componentsProp.value.properties ?? []) {\n if (prop.type !== 'Property') continue;\n const name = prop.key?.name ?? prop.key?.value;\n if (typeof name !== 'string') continue;\n if (!isPascalCase(name)) {\n const fixed = toPascalCase(name);\n const fixedText = prop.key.type === 'Literal' ? `'${fixed}'` : fixed;\n context.report({\n node: prop.key,\n messageId: 'notPascalCase',\n data: { name },\n fix: (fixer: any) => fixer.replaceText(prop.key, fixedText),\n });\n }\n }\n}\n\nexport const componentsPascalCase = createRule({\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description: 'Require component keys in static config to be PascalCase',\n },\n messages: {\n notPascalCase: 'Component key \"{{name}}\" must be PascalCase (e.g. \"MyComponent\").',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ClassDeclaration(node: Node) {\n check(node, context);\n },\n ClassExpression(node: Node) {\n check(node, context);\n },\n };\n },\n});\n", "import { isBaseSubclass, type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nfunction collectDeclaredEmits(classNode: Node): Set<string> {\n const body: Node[] = classNode.body?.body ?? [];\n const configProp = body.find(\n (m: Node) => m.type === 'PropertyDefinition' && m.static === true && m.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return new Set();\n\n const emitsProp = configProp.value.properties?.find(\n (p: Node) => p.type === 'Property' && p.key?.name === 'emits',\n );\n\n if (!emitsProp?.value || emitsProp.value.type !== 'ArrayExpression') return new Set();\n\n const names = new Set<string>();\n for (const el of emitsProp.value.elements ?? []) {\n if (el?.type === 'Literal' && typeof el.value === 'string') {\n names.add(el.value);\n }\n }\n return names;\n}\n\n/**\n * Returns true if `node` looks like `this.$emit`.\n */\nfunction isThisEmit(node: Node): boolean {\n return (\n node.type === 'MemberExpression' &&\n node.object?.type === 'ThisExpression' &&\n node.property?.name === '$emit'\n );\n}\n\nexport const requireEmitDeclaredInConfig = createRule({\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Require all this.$emit() calls to use event names declared in static config.emits',\n },\n messages: {\n undeclared: 'Emit \"{{name}}\" is not declared in static config.emits.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n 'ClassDeclaration, ClassExpression'(classNode: Node) {\n if (!isBaseSubclass(classNode, context)) return;\n\n const declared = collectDeclaredEmits(classNode);\n\n walkNode(classNode.body, (node: Node) => {\n // Match: this.$emit('event-name', ...)\n if (node.type !== 'CallExpression') return;\n if (!isThisEmit(node.callee)) return;\n\n const firstArg = node.arguments?.[0];\n if (!firstArg || firstArg.type !== 'Literal') return;\n const name = firstArg.value;\n if (typeof name !== 'string') return;\n\n if (!declared.has(name)) {\n context.report({\n node: firstArg,\n messageId: 'undeclared',\n data: { name },\n });\n }\n });\n },\n };\n },\n});\n\nfunction walkNode(node: Node, visit: (n: Node) => void) {\n if (!node || typeof node !== 'object') return;\n visit(node);\n for (const key of Object.keys(node)) {\n if (key === 'parent') continue;\n const child = node[key];\n if (Array.isArray(child)) {\n for (const item of child) walkNode(item, visit);\n } else if (child && typeof child === 'object' && child.type) {\n walkNode(child, visit);\n }\n }\n}\n", "import { isBaseSubclass, type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nfunction collectDeclaredComponents(classNode: Node): Set<string> {\n const body: Node[] = classNode.body?.body ?? [];\n const configProp = body.find(\n (m: Node) => m.type === 'PropertyDefinition' && m.static === true && m.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return new Set();\n\n const componentsProp = configProp.value.properties?.find(\n (p: Node) => p.type === 'Property' && p.key?.name === 'components',\n );\n\n if (!componentsProp?.value || componentsProp.value.type !== 'ObjectExpression') return new Set();\n\n const names = new Set<string>();\n for (const prop of componentsProp.value.properties ?? []) {\n if (prop.type !== 'Property') continue;\n const name = prop.key?.name ?? prop.key?.value;\n if (typeof name === 'string') {\n names.add(name);\n }\n }\n return names;\n}\n\n/**\n * Returns true if `node` looks like `this.$children`.\n */\nfunction isThisChildren(node: Node): boolean {\n return (\n node.type === 'MemberExpression' &&\n node.object?.type === 'ThisExpression' &&\n node.property?.name === '$children'\n );\n}\n\nexport const requireChildrenDeclaredInConfig = createRule({\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Require all this.$children accesses to use component names declared in static config.components',\n },\n messages: {\n undeclared: 'Component \"{{name}}\" is not declared in static config.components.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n 'ClassDeclaration, ClassExpression'(classNode: Node) {\n if (!isBaseSubclass(classNode, context)) return;\n\n const declared = collectDeclaredComponents(classNode);\n\n walkNode(classNode.body, (node: Node) => {\n if (node.type !== 'MemberExpression') return;\n if (!isThisChildren(node.object)) return;\n\n let name: string | null = null;\n\n if (!node.computed && node.property?.type === 'Identifier') {\n name = node.property.name;\n } else if (\n node.computed &&\n node.property?.type === 'Literal' &&\n typeof node.property.value === 'string'\n ) {\n name = node.property.value;\n }\n\n if (name && !declared.has(name)) {\n context.report({\n node,\n messageId: 'undeclared',\n data: { name },\n });\n }\n });\n },\n };\n },\n});\n\nfunction walkNode(node: Node, visit: (n: Node) => void) {\n if (!node || typeof node !== 'object') return;\n visit(node);\n for (const key of Object.keys(node)) {\n if (key === 'parent') continue;\n const child = node[key];\n if (Array.isArray(child)) {\n for (const item of child) walkNode(item, visit);\n } else if (child && typeof child === 'object' && child.type) {\n walkNode(child, visit);\n }\n }\n}\n", "import {\n isBaseSubclass,\n toCamelCase,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nfunction collectDeclaredOptions(classNode: Node): Set<string> {\n const body: Node[] = classNode.body?.body ?? [];\n const configProp = body.find(\n (m: Node) => m.type === 'PropertyDefinition' && m.static === true && m.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return new Set();\n\n const optionsProp = configProp.value.properties?.find(\n (p: Node) => p.type === 'Property' && p.key?.name === 'options',\n );\n\n if (!optionsProp?.value || optionsProp.value.type !== 'ObjectExpression') return new Set();\n\n const names = new Set<string>();\n for (const prop of optionsProp.value.properties ?? []) {\n if (prop.type !== 'Property') continue;\n const name = prop.key?.name ?? prop.key?.value;\n if (typeof name === 'string') {\n names.add(toCamelCase(name));\n }\n }\n return names;\n}\n\n/**\n * Returns true if `node` looks like `this.$options`.\n */\nfunction isThisOptions(node: Node): boolean {\n return (\n node.type === 'MemberExpression' &&\n node.object?.type === 'ThisExpression' &&\n node.property?.name === '$options'\n );\n}\n\nexport const requireOptionsDeclaredInConfig = createRule({\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Require all this.$options accesses to use option names declared in static config.options',\n },\n messages: {\n undeclared: 'Option \"{{name}}\" is not declared in static config.options.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n 'ClassDeclaration, ClassExpression'(classNode: Node) {\n if (!isBaseSubclass(classNode, context)) return;\n\n const declared = collectDeclaredOptions(classNode);\n\n walkNode(classNode.body, (node: Node) => {\n if (node.type !== 'MemberExpression') return;\n if (!isThisOptions(node.object)) return;\n\n let name: string | null = null;\n\n if (!node.computed && node.property?.type === 'Identifier') {\n name = node.property.name;\n } else if (\n node.computed &&\n node.property?.type === 'Literal' &&\n typeof node.property.value === 'string'\n ) {\n name = toCamelCase(node.property.value);\n }\n\n if (name && !declared.has(name)) {\n context.report({\n node,\n messageId: 'undeclared',\n data: { name },\n });\n }\n });\n },\n };\n },\n});\n\nfunction walkNode(node: Node, visit: (n: Node) => void) {\n if (!node || typeof node !== 'object') return;\n visit(node);\n for (const key of Object.keys(node)) {\n if (key === 'parent') continue;\n const child = node[key];\n if (Array.isArray(child)) {\n for (const item of child) walkNode(item, visit);\n } else if (child && typeof child === 'object' && child.type) {\n walkNode(child, visit);\n }\n }\n}\n", "import {\n findEnclosingClass,\n isBaseSubclass,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nconst TRACKED_PROPERTIES = new Set(['$refs', '$options', '$children']);\n\nfunction isTrackedLookup(node: Node): { prop: string; name: string } | null {\n if (\n node.type === 'MemberExpression' &&\n node.object?.type === 'MemberExpression' &&\n node.object.object?.type === 'ThisExpression' &&\n node.object.property?.type === 'Identifier' &&\n TRACKED_PROPERTIES.has(node.object.property.name) &&\n node.property?.type === 'Identifier' &&\n !node.computed\n ) {\n return { prop: node.object.property.name, name: node.property.name };\n }\n return null;\n}\n\nfunction findEnclosingMethod(ancestors: Node[]): Node | null {\n for (let i = ancestors.length - 1; i >= 0; i--) {\n const node = ancestors[i];\n if (node.type === 'MethodDefinition') return node;\n }\n return null;\n}\n\nexport const preferDestructuredLookups = createRule({\n meta: {\n type: 'suggestion',\n docs: {\n description:\n 'Prefer destructuring this.$refs, this.$options and this.$children into local variables when accessed multiple times in the same method',\n },\n messages: {\n preferDestructured:\n '\"this.{{prop}}.{{name}}\" is accessed {{count}} times. Destructure it into a local variable to avoid repeated lookups.',\n },\n },\n createOnce(context: RuleContext) {\n // methodKey -> lookup key -> list of nodes\n const methodLookups = new Map<Node, Map<string, Node[]>>();\n\n return {\n MemberExpression(node: Node) {\n const match = isTrackedLookup(node);\n if (!match) return;\n\n const ancestors =\n context.getAncestors?.() ?? context.sourceCode?.getAncestors?.(node) ?? [];\n const method = findEnclosingMethod(ancestors);\n if (!method) return;\n\n const cls = findEnclosingClass(ancestors);\n if (!cls || !isBaseSubclass(cls, context)) return;\n\n if (!methodLookups.has(method)) methodLookups.set(method, new Map());\n const map = methodLookups.get(method)!;\n const key = `${match.prop}.${match.name}`;\n const list = map.get(key) ?? [];\n list.push(node);\n map.set(key, list);\n },\n\n 'MethodDefinition:exit'(node: Node) {\n const map = methodLookups.get(node);\n if (!map) return;\n methodLookups.delete(node);\n\n for (const [key, nodes] of map) {\n if (nodes.length < 2) continue;\n const [prop, name] = key.split('.');\n context.report({\n node: nodes[0],\n messageId: 'preferDestructured',\n data: { prop, name, count: String(nodes.length) },\n });\n }\n },\n };\n },\n});\n", "import { isBaseSubclass, type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nexport const noDollarPrefix = createRule({\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Disallow user-defined methods and properties prefixed with \"$\" in Base subclasses \u2014 \"$\" is reserved for js-toolkit framework members',\n },\n messages: {\n noDollarPrefix:\n '\"${{name}}\" uses the \"$\" prefix, which is reserved for js-toolkit framework members. Rename it without the \"$\" prefix.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ClassDeclaration(node: Node) {\n check(node, context);\n },\n ClassExpression(node: Node) {\n check(node, context);\n },\n };\n },\n});\n\nfunction check(node: Node, context: RuleContext) {\n if (!isBaseSubclass(node, context)) return;\n\n for (const member of node.body?.body ?? []) {\n if (member.static) continue;\n if (member.type !== 'MethodDefinition' && member.type !== 'PropertyDefinition') continue;\n const name: string = member.key?.name ?? '';\n if (name.startsWith('$')) {\n context.report({\n node: member.key,\n messageId: 'noDollarPrefix',\n data: { name: name.slice(1) },\n });\n }\n }\n}\n", "import { isBaseSubclass, type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nconst SETUP_CALLS = new Set(['setTimeout', 'setInterval', 'requestAnimationFrame']);\n\nexport const requireDestroyedCleanup = createRule({\n meta: {\n type: 'suggestion',\n docs: {\n description:\n 'Require a destroyed() method in Base subclasses that use setTimeout, setInterval or requestAnimationFrame',\n },\n messages: {\n requireDestroyed:\n 'This component uses {{calls}} but has no destroyed() method. Add destroyed() to clear timers and avoid memory leaks.',\n },\n },\n createOnce(context: RuleContext) {\n // class node -> set of timer call names found\n const classTimers = new Map<Node, Set<string>>();\n // class node -> whether destroyed() exists\n const classHasDestroyed = new Map<Node, boolean>();\n\n return {\n ClassDeclaration(node: Node) {\n classTimers.set(node, new Set());\n classHasDestroyed.set(node, false);\n },\n\n ClassExpression(node: Node) {\n classTimers.set(node, new Set());\n classHasDestroyed.set(node, false);\n },\n\n MethodDefinition(node: Node) {\n if (node.key?.name === 'destroyed') {\n // Find the enclosing class\n const sourceCode = context.sourceCode ?? context.getSourceCode?.();\n const ancestors = context.getAncestors?.() ?? sourceCode?.getAncestors?.(node) ?? [];\n for (let i = ancestors.length - 1; i >= 0; i--) {\n const a = ancestors[i];\n if (a.type === 'ClassDeclaration' || a.type === 'ClassExpression') {\n classHasDestroyed.set(a, true);\n break;\n }\n }\n }\n },\n\n CallExpression(node: Node) {\n if (node.callee?.type !== 'Identifier') return;\n if (!SETUP_CALLS.has(node.callee.name)) return;\n\n const sourceCode = context.sourceCode ?? context.getSourceCode?.();\n const ancestors = context.getAncestors?.() ?? sourceCode?.getAncestors?.(node) ?? [];\n\n for (let i = ancestors.length - 1; i >= 0; i--) {\n const a = ancestors[i];\n if (a.type === 'ClassDeclaration' || a.type === 'ClassExpression') {\n if (!isBaseSubclass(a, context)) break;\n classTimers.get(a)?.add(node.callee.name);\n break;\n }\n }\n },\n\n 'ClassDeclaration:exit'(node: Node) {\n reportIfNeeded(node, context, classTimers, classHasDestroyed);\n },\n\n 'ClassExpression:exit'(node: Node) {\n reportIfNeeded(node, context, classTimers, classHasDestroyed);\n },\n };\n },\n});\n\nfunction reportIfNeeded(\n node: Node,\n context: RuleContext,\n classTimers: Map<Node, Set<string>>,\n classHasDestroyed: Map<Node, boolean>,\n) {\n const timers = classTimers.get(node);\n const hasDestroyed = classHasDestroyed.get(node);\n classTimers.delete(node);\n classHasDestroyed.delete(node);\n\n if (!timers || timers.size === 0) return;\n if (hasDestroyed) return;\n\n context.report({\n node: node.id ?? node,\n messageId: 'requireDestroyed',\n data: { calls: [...timers].join(', ') },\n });\n}\n", "import { eslintCompatPlugin } from '@oxlint/plugins';\nimport {\n requireConfig,\n requireConfigNamePascalCase,\n refsCamelCase,\n optionsCamelCase,\n asyncLifecycleMethods,\n onHandlerNaming,\n onGlobalHandlerPrefix,\n noDeprecatedProperties,\n noDispatchEvent,\n noShadowDom,\n noCreateApp,\n noEventListenerMethods,\n refsPluralMultiple,\n noDeepUtilsImport,\n noInternalBarrelImport,\n refsNoBracketAccess,\n noRedundantWithMountWhenInView,\n preferRefOverQuerySelector,\n requireRefsDeclaredInConfig,\n noManualIntersectionObserver,\n noManualMutationObserver,\n emitsKebabCase,\n emitsMultiWord,\n componentsPascalCase,\n requireEmitDeclaredInConfig,\n requireChildrenDeclaredInConfig,\n requireOptionsDeclaredInConfig,\n preferDestructuredLookups,\n noDollarPrefix,\n requireDestroyedCleanup,\n} from './rules/index.ts';\n\nconst PLUGIN_NAME = 'js-toolkit';\n\nconst rules = {\n 'require-config': requireConfig,\n 'require-config-name-pascal-case': requireConfigNamePascalCase,\n 'refs-camel-case': refsCamelCase,\n 'refs-plural-multiple': refsPluralMultiple,\n 'options-camel-case': optionsCamelCase,\n 'async-lifecycle-methods': asyncLifecycleMethods,\n 'on-handler-naming': onHandlerNaming,\n 'on-global-handler-prefix': onGlobalHandlerPrefix,\n 'no-deprecated-properties': noDeprecatedProperties,\n 'no-dispatch-event': noDispatchEvent,\n 'no-shadow-dom': noShadowDom,\n 'no-create-app': noCreateApp,\n 'no-event-listener-methods': noEventListenerMethods,\n 'no-deep-utils-import': noDeepUtilsImport,\n 'no-internal-barrel-import': noInternalBarrelImport,\n 'refs-no-bracket-access': refsNoBracketAccess,\n 'no-redundant-with-mount-when-in-view': noRedundantWithMountWhenInView,\n 'prefer-ref-over-query-selector': preferRefOverQuerySelector,\n 'require-refs-declared-in-config': requireRefsDeclaredInConfig,\n 'no-manual-intersection-observer': noManualIntersectionObserver,\n 'no-manual-mutation-observer': noManualMutationObserver,\n 'emits-kebab-case': emitsKebabCase,\n 'emits-multi-word': emitsMultiWord,\n 'components-pascal-case': componentsPascalCase,\n 'require-emit-declared-in-config': requireEmitDeclaredInConfig,\n 'require-children-declared-in-config': requireChildrenDeclaredInConfig,\n 'require-options-declared-in-config': requireOptionsDeclaredInConfig,\n 'prefer-destructured-lookups': preferDestructuredLookups,\n 'no-dollar-prefix': noDollarPrefix,\n 'require-destroyed-cleanup': requireDestroyedCleanup,\n};\n\nconst recommendedRules: Record<string, string> = {\n [`${PLUGIN_NAME}/require-config`]: 'error',\n [`${PLUGIN_NAME}/require-config-name-pascal-case`]: 'error',\n [`${PLUGIN_NAME}/refs-camel-case`]: 'error',\n [`${PLUGIN_NAME}/refs-plural-multiple`]: 'error',\n [`${PLUGIN_NAME}/options-camel-case`]: 'error',\n [`${PLUGIN_NAME}/async-lifecycle-methods`]: 'error',\n [`${PLUGIN_NAME}/on-handler-naming`]: 'error',\n [`${PLUGIN_NAME}/on-global-handler-prefix`]: 'warn',\n [`${PLUGIN_NAME}/no-deprecated-properties`]: 'warn',\n [`${PLUGIN_NAME}/no-dispatch-event`]: 'warn',\n [`${PLUGIN_NAME}/no-shadow-dom`]: 'error',\n [`${PLUGIN_NAME}/no-create-app`]: 'warn',\n [`${PLUGIN_NAME}/no-event-listener-methods`]: 'error',\n [`${PLUGIN_NAME}/no-deep-utils-import`]: 'error',\n [`${PLUGIN_NAME}/refs-no-bracket-access`]: 'error',\n [`${PLUGIN_NAME}/no-redundant-with-mount-when-in-view`]: 'warn',\n [`${PLUGIN_NAME}/prefer-ref-over-query-selector`]: 'warn',\n [`${PLUGIN_NAME}/require-refs-declared-in-config`]: 'error',\n [`${PLUGIN_NAME}/no-manual-intersection-observer`]: 'warn',\n [`${PLUGIN_NAME}/no-manual-mutation-observer`]: 'warn',\n [`${PLUGIN_NAME}/emits-kebab-case`]: 'error',\n [`${PLUGIN_NAME}/emits-multi-word`]: 'error',\n [`${PLUGIN_NAME}/components-pascal-case`]: 'error',\n [`${PLUGIN_NAME}/require-emit-declared-in-config`]: 'error',\n [`${PLUGIN_NAME}/require-children-declared-in-config`]: 'error',\n [`${PLUGIN_NAME}/require-options-declared-in-config`]: 'error',\n [`${PLUGIN_NAME}/prefer-destructured-lookups`]: 'warn',\n [`${PLUGIN_NAME}/no-dollar-prefix`]: 'error',\n [`${PLUGIN_NAME}/require-destroyed-cleanup`]: 'warn',\n};\n\nconst base = eslintCompatPlugin({\n meta: {\n name: '@studiometa/eslint-plugin-js-toolkit',\n },\n rules,\n});\n\nconst plugin = Object.assign(base, { configs: {} as Record<string, object> });\n\nplugin.configs['recommended'] = {\n plugins: { [PLUGIN_NAME]: plugin },\n rules: recommendedRules,\n};\n\nexport { plugin as jsToolkit };\nexport default plugin;\n"],
|
|
5
|
-
"mappings": ";AAyBA,IAAM,gBAAgB,CAAC;AAcvB,SAAS,mBAAmBA,SAAQ;AACnC,MAAI,OAAOA,WAAU,YAAY,CAACA,QAAQ,OAAM,MAAM,0BAA0B;AAChF,MAAI,EAAE,OAAAC,OAAM,IAAID;AAChB,MAAI,OAAOC,UAAS,YAAY,CAACA,OAAO,OAAM,MAAM,gDAAgD;AACpG,MAAI,kBAAkB,IAAI,gBAAgB;AAC1C,WAAS,YAAYA,OAAO,QAAO,OAAOA,QAAO,QAAQ,KAAK,YAAYA,OAAM,QAAQ,GAAG,eAAe;AAC1G,SAAOD;AACR;AA4HA,IAAI,kBAAkB,MAAM;AAAA,EAC3B,iBAAiB,CAAC;AAAA,EAClB,gBAAgB,CAAC;AAAA,EACjB,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,aAAa;AAAA,EACb,iBAAiB,KAAK,mBAAmB,KAAK,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMlD,sBAAsB,OAAO;AAC5B,QAAI,EAAE,cAAc,IAAI,MAAM,QAAQ,cAAc;AACpD,WAAO,cAAc,KAAK,CAAC,GAAG,KAAK,eAAe,KAAK,KAAK,GAAG;AAAA,EAChE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,eAAe;AACd,SAAK,qBAAqB,KAAK,sBAAsB,KAAK,gBAAgB,KAAK,MAAM,KAAE;AAAA,EACxF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,cAAc;AACnB,SAAK;AACL,QAAI,EAAE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4B,GAAG;AAChD;AAEA,IAAM,OAAO,mBAAmB;AAAA,EAC9B,MAAM;AAAA,IACJ,MAAM;AAAA,EACR;AAAA,EACA;AACF,CAAC;AAED,IAAM,SAAS,OAAO,OAAO,MAAM,EAAE,SAAS,CAAC,EAA4B,CAAC;AAE5E,OAAO,QAAQ,aAAa,IAAI;AAAA,EAC9B,SAAS,EAAE,CAAC,WAAW,GAAG,OAAO;AAAA,EACjC,OAAO;AACT;AAGA,IAAO,gBAAQ;",
|
|
6
|
-
"names": ["plugin", "rules", "node", "check", "check", "check", "check", "check", "isThisRefs", "check", "check", "check", "walkNode", "walkNode", "walkNode", "check"]
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"index.js","names":["check","check","check","check","check","isThisRefs","check","walkNode","check","check","check","walkNode","walkNode"],"sources":["../src/utils/ast.ts","../src/rules/require-config.ts","../src/rules/require-config-name-pascal-case.ts","../src/rules/refs-camel-case.ts","../src/rules/options-camel-case.ts","../src/rules/async-lifecycle-methods.ts","../src/rules/on-handler-naming.ts","../src/rules/on-global-handler-prefix.ts","../src/rules/no-deprecated-properties.ts","../src/rules/no-dispatch-event.ts","../src/rules/no-shadow-dom.ts","../src/rules/no-create-app.ts","../src/rules/no-event-listener-methods.ts","../src/rules/refs-plural-multiple.ts","../src/rules/no-deep-utils-import.ts","../src/rules/no-internal-barrel-import.ts","../src/rules/refs-no-bracket-access.ts","../src/rules/no-redundant-with-mount-when-in-view.ts","../src/rules/prefer-ref-over-query-selector.ts","../src/rules/require-refs-declared-in-config.ts","../src/rules/no-manual-intersection-observer.ts","../src/rules/no-manual-mutation-observer.ts","../src/rules/emits-kebab-case.ts","../src/rules/emits-multi-word.ts","../src/rules/components-pascal-case.ts","../src/rules/require-emit-declared-in-config.ts","../src/rules/require-children-declared-in-config.ts","../src/rules/require-options-declared-in-config.ts","../src/rules/prefer-destructured-lookups.ts","../src/rules/no-dollar-prefix.ts","../src/rules/require-destroyed-cleanup.ts","../src/rules/no-write-in-read-phase.ts","../src/rules/no-options-assignment.ts","../src/rules/prefer-instance-scheduler.ts","../src/rules/option-default-factory.ts","../src/rules/no-conflicting-negated-option.ts","../src/rules/no-destroy-lifecycle.ts","../src/index.ts"],"sourcesContent":["/**\n * ESLint v9 compatible AST node types used across rules.\n * We use loose typings here since oxlint/eslint expose their own node types.\n */\n\nexport type Node = Record<string, any>;\nexport type RuleContext = Record<string, any>;\n\nexport type RuleMeta = {\n type?: 'problem' | 'suggestion' | 'layout';\n fixable?: 'code' | 'whitespace';\n hasSuggestions?: boolean;\n docs?: { description?: string };\n messages?: Record<string, string>;\n schema?: unknown[];\n};\n\nexport function createRule<V extends Record<string, (node: Node) => unknown>>(rule: {\n meta?: RuleMeta;\n createOnce(context: RuleContext): V;\n}): { meta?: RuleMeta; createOnce(context: RuleContext): V } {\n return rule;\n}\n\nexport const LIFECYCLE_METHODS = new Set([\n 'mounted',\n 'destroyed',\n 'updated',\n 'terminated',\n 'ticked',\n 'scrolled',\n 'resized',\n 'moved',\n 'loaded',\n 'keyed',\n]);\n\nexport const TOOLKIT_PACKAGE = '@studiometa/js-toolkit';\n\n/**\n * Returns true if a class declaration extends an identifier imported from\n * @studiometa/js-toolkit, or extends a bare identifier named `Base`.\n *\n * This is a heuristic — we cannot do full type resolution in a lint rule.\n */\nexport function isBaseSubclass(node: Node, context: RuleContext): boolean {\n if (node.type !== 'ClassDeclaration' && node.type !== 'ClassExpression') {\n return false;\n }\n\n if (!node.superClass) {\n return false;\n }\n\n const superName = node.superClass.type === 'Identifier' ? node.superClass.name : null;\n\n if (!superName) {\n return false;\n }\n\n // Fast path: class extends Base\n if (superName === 'Base') {\n return true;\n }\n\n // Check if the superclass identifier is imported from @studiometa/js-toolkit\n const sourceCode = context.sourceCode ?? context.getSourceCode?.();\n const ast = sourceCode?.ast;\n\n if (!ast) {\n return false;\n }\n\n for (const node of ast.body) {\n if (node.type !== 'ImportDeclaration') continue;\n if (node.source.value !== TOOLKIT_PACKAGE) continue;\n\n for (const specifier of node.specifiers) {\n if (specifier.type === 'ImportSpecifier' && specifier.local.name === superName) {\n return true;\n }\n }\n }\n\n return false;\n}\n\n/**\n * Returns true if the string is camelCase (starts lowercase, no separators).\n */\nexport function isCamelCase(value: string): boolean {\n return /^[a-z][a-zA-Z0-9]*$/.test(value);\n}\n\n/**\n * Returns true if the string is PascalCase.\n */\nexport function isPascalCase(value: string): boolean {\n return /^[A-Z][a-zA-Z0-9]*$/.test(value);\n}\n\n/**\n * Converts a kebab-case, snake_case or PascalCase string to camelCase.\n */\nexport function toCamelCase(value: string): string {\n return value\n .replace(/[-_](.)/g, (_, c: string) => c.toUpperCase())\n .replace(/^[A-Z]/, (c) => c.toLowerCase());\n}\n\n/**\n * Converts a kebab-case, snake_case or camelCase string to PascalCase.\n */\nexport function toPascalCase(value: string): string {\n return value\n .replace(/[-_](.)/g, (_, c: string) => c.toUpperCase())\n .replace(/^[a-z]/, (c) => c.toUpperCase());\n}\n\n/**\n * Walks up ancestor nodes to find the nearest class declaration/expression.\n */\nexport function findEnclosingClass(ancestors: Node[]): Node | null {\n for (let i = ancestors.length - 1; i >= 0; i--) {\n const node = ancestors[i];\n if (node.type === 'ClassDeclaration' || node.type === 'ClassExpression') {\n return node;\n }\n }\n return null;\n}\n\n/**\n * Returns the ancestors of a node, whichever accessor the runtime exposes.\n */\nexport function getAncestors(node: Node, context: RuleContext): Node[] {\n return context.getAncestors\n ? context.getAncestors()\n : (context.sourceCode?.getAncestors?.(node) ?? []);\n}\n\n/**\n * Returns true for the node types that open a new function scope.\n */\nexport function isFunctionNode(node: Node): boolean {\n return (\n node.type === 'FunctionDeclaration' ||\n node.type === 'FunctionExpression' ||\n node.type === 'ArrowFunctionExpression'\n );\n}\n\n/**\n * Walks every descendant node, depth first, calling `visit` on each.\n *\n * Returning `false` from `visit` skips the subtree of that node. Used by rules\n * which have to analyse a node the visitor will not hand them again, such as\n * the body of a method resolved from its call site.\n */\nexport function walk(node: Node, visit: (node: Node) => boolean | void): void {\n if (!node || typeof node.type !== 'string') return;\n\n if (visit(node) === false) return;\n\n for (const key of Object.keys(node)) {\n if (key === 'parent') continue;\n\n const value = node[key];\n\n if (Array.isArray(value)) {\n for (const item of value) {\n if (item && typeof item.type === 'string') walk(item, visit);\n }\n } else if (value && typeof value.type === 'string') {\n walk(value, visit);\n }\n }\n}\n\n/**\n * Returns the name of a class member key, for identifier and literal keys alike.\n */\nexport function getKeyName(node: Node): string | null {\n const key = node?.key;\n if (!key) return null;\n if (key.type === 'Identifier') return key.name;\n if (key.type === 'Literal' && typeof key.value === 'string') return key.value;\n return null;\n}\n\n/**\n * Returns true if a class member carries one of the named decorators, written\n * either bare (`@write`) or called (`@write()`).\n */\nexport function hasDecorator(node: Node, names: Set<string>): boolean {\n for (const decorator of node?.decorators ?? []) {\n const expression = decorator.expression;\n if (!expression) continue;\n if (expression.type === 'Identifier' && names.has(expression.name)) return true;\n if (\n expression.type === 'CallExpression' &&\n expression.callee?.type === 'Identifier' &&\n names.has(expression.callee.name)\n ) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Unwraps the type-argument application a v4 component writes on its\n * superclass, as in `extends withRaf(Base)<Props>`.\n */\nfunction unwrapTypeArguments(node: Node): Node {\n return node?.type === 'TSInstantiationExpression' ? (node.expression ?? node) : node;\n}\n\n/**\n * The instance surface only a v4 component has.\n *\n * Reaching for one of these off `this` is the signal that a class extending\n * something unresolvable is a component rather than an ordinary subclass. The\n * lifecycle and service hook names are deliberately **not** in this set: they\n * are the very thing a rule like `no-write-in-read-phase` keys on, so counting\n * them as proof would make the test circular and let `class Store extends\n * Error { ticked() {} }` pass for a component.\n */\nconst COMPONENT_MEMBERS = new Set([\n '$el',\n '$refs',\n '$options',\n '$id',\n '$config',\n '$isMounted',\n '$emit',\n '$on',\n '$off',\n '$query',\n '$closest',\n '$watchChildren',\n '$provide',\n '$inject',\n '$injectSync',\n '$read',\n '$write',\n '$mount',\n '$unmount',\n // v4 renamed `$destroy()` to `$unmount()`. The old name stays in this set\n // while unmigrated code exists, so that `no-destroy-lifecycle` still reads a\n // class whose only framework signal is the call it is there to rewrite.\n '$destroy',\n '$services',\n]);\n\n/**\n * Returns true if the class body reaches for the framework surface off `this`.\n */\nfunction usesComponentSurface(node: Node): boolean {\n let found = false;\n\n walk(node.body, (inner: Node) => {\n if (found) return false;\n\n // A nested class carries its own identity; do not read it as this one's.\n if (\n inner !== node.body &&\n (inner.type === 'ClassDeclaration' || inner.type === 'ClassExpression')\n ) {\n return false;\n }\n\n if (\n inner.type === 'MemberExpression' &&\n !inner.computed &&\n inner.object?.type === 'ThisExpression' &&\n COMPONENT_MEMBERS.has(inner.property?.name)\n ) {\n found = true;\n return false;\n }\n });\n\n return found;\n}\n\n/**\n * Returns true if a class looks like a v4 component.\n *\n * A component always extends something — `Base`, a `with<Service>(…)` mixin,\n * or a local abstract component — so a superclass is necessary. It is nowhere\n * near sufficient: `class Store extends Error` would read as a component, and\n * `prefer-instance-scheduler` would then tell it to call a `this.$read()` it\n * does not have, which is wrong advice rather than mere noise.\n *\n * Restricting to a list of known bases is not the answer either. `extends\n * AbstractCarouselChild`, `extends Indexable` and `extends AbstractPrefetch`\n * are the common shape in `@studiometa/ui`, and a single-file linter cannot\n * follow the chain to `Base`.\n *\n * So a superclass **plus** a second signal in the same class body: a\n * `@component({ … })` decorator, a `static config`, or use of the framework\n * surface off `this`. That keeps a subclass of a local abstract component —\n * which reads `this.$el` or emits — while rejecting a class that merely\n * extends something.\n *\n * Requiring the superclass is what keeps `Base` itself out. It declares\n * `static config` and defines the whole surface, but it extends nothing, and\n * the class defining `$read()` is not a class that should be told to call it.\n *\n * A component using none of the three anywhere in its body is missed, which\n * is the right way to be wrong: a false negative rather than advice that does\n * not apply.\n */\nexport function isComponentClass(node: Node): boolean {\n if (node?.type !== 'ClassDeclaration' && node?.type !== 'ClassExpression') {\n return false;\n }\n\n if (!unwrapTypeArguments(node.superClass)) {\n return false;\n }\n\n return (\n hasDecorator(node, new Set(['component'])) ||\n Boolean(findStaticConfig(node)) ||\n usesComponentSurface(node)\n );\n}\n\n/** The object literal passed to a class's `@component({ … })` decorator. */\nfunction findDecoratorConfig(node: Node): Node | null {\n for (const decorator of node?.decorators ?? []) {\n const expression = decorator.expression;\n if (expression?.type !== 'CallExpression') continue;\n if (expression.callee?.type !== 'Identifier') continue;\n if (expression.callee.name !== 'component') continue;\n\n const argument = expression.arguments?.[0];\n if (argument?.type === 'ObjectExpression') return argument;\n }\n\n return null;\n}\n\n/** The `static config = { … }` object of a class. */\nfunction findStaticConfig(node: Node): Node | null {\n for (const member of node?.body?.body ?? []) {\n if (member.type !== 'PropertyDefinition') continue;\n if (member.static !== true) continue;\n if (member.key?.name !== 'config') continue;\n if (member.value?.type === 'ObjectExpression') return member.value;\n }\n\n return null;\n}\n\n/**\n * Finds the `static config = { … }` object of a class, or the object literal\n * passed to its `@component({ … })` decorator. v4 accepts both spellings.\n */\nexport function findComponentConfig(node: Node): Node | null {\n return findDecoratorConfig(node) ?? findStaticConfig(node);\n}\n\n/**\n * Returns the value of a named property of an object literal.\n */\nexport function getProperty(node: Node, name: string): Node | null {\n for (const property of node?.properties ?? []) {\n if (property.type !== 'Property') continue;\n if (getKeyName(property) === name) return property.value ?? null;\n }\n return null;\n}\n","import { isBaseSubclass, type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nexport const requireConfig = createRule({\n meta: {\n type: 'problem',\n docs: {\n description: 'Require a static config property on classes extending Base',\n },\n messages: {\n missingConfig: 'Classes extending Base must define a static config property.',\n missingName: 'The static config must include a name property.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ClassDeclaration(node: Node) {\n check(node, context);\n },\n ClassExpression(node: Node) {\n check(node, context);\n },\n };\n },\n});\n\nfunction check(node: Node, context: RuleContext) {\n if (!isBaseSubclass(node, context)) return;\n\n const body: Node[] = node.body?.body ?? [];\n\n const configProp = body.find(\n (member: Node) =>\n member.type === 'PropertyDefinition' &&\n member.static === true &&\n member.key?.name === 'config',\n );\n\n if (!configProp) {\n context.report({ node, messageId: 'missingConfig' });\n return;\n }\n\n // Check that config has a `name` property\n const value = configProp.value;\n if (!value || value.type !== 'ObjectExpression') return;\n\n const hasName = value.properties?.some(\n (prop: Node) => prop.type === 'Property' && prop.key?.name === 'name' && prop.value?.value,\n );\n\n if (!hasName) {\n context.report({ node: configProp, messageId: 'missingName' });\n }\n}\n","import {\n isBaseSubclass,\n isPascalCase,\n toPascalCase,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nexport const requireConfigNamePascalCase = createRule({\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description: 'Require config.name to be PascalCase on classes extending Base',\n },\n messages: {\n notPascalCase: 'config.name \"{{name}}\" must be PascalCase.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ClassDeclaration(node: Node) {\n check(node, context);\n },\n ClassExpression(node: Node) {\n check(node, context);\n },\n };\n },\n});\n\nfunction check(node: Node, context: RuleContext) {\n if (!isBaseSubclass(node, context)) return;\n\n const body: Node[] = node.body?.body ?? [];\n\n const configProp = body.find(\n (member: Node) =>\n member.type === 'PropertyDefinition' &&\n member.static === true &&\n member.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return;\n\n const nameProp = configProp.value.properties?.find(\n (prop: Node) => prop.type === 'Property' && prop.key?.name === 'name',\n );\n\n if (!nameProp) return;\n\n const nameValue = nameProp.value?.value;\n if (typeof nameValue !== 'string') return;\n\n if (!isPascalCase(nameValue)) {\n context.report({\n node: nameProp.value,\n messageId: 'notPascalCase',\n data: { name: nameValue },\n fix: (fixer: any) => fixer.replaceText(nameProp.value, `'${toPascalCase(nameValue)}'`),\n });\n }\n}\n","import {\n isBaseSubclass,\n isCamelCase,\n toCamelCase,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nexport const refsCamelCase = createRule({\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description: 'Require ref names in static config to be camelCase',\n },\n messages: {\n notCamelCase: 'Ref name \"{{name}}\" must be camelCase.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ClassDeclaration(node: Node) {\n check(node, context);\n },\n ClassExpression(node: Node) {\n check(node, context);\n },\n };\n },\n});\n\nfunction check(node: Node, context: RuleContext) {\n if (!isBaseSubclass(node, context)) return;\n\n const body: Node[] = node.body?.body ?? [];\n\n const configProp = body.find(\n (member: Node) =>\n member.type === 'PropertyDefinition' &&\n member.static === true &&\n member.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return;\n\n const refsProp = configProp.value.properties?.find(\n (prop: Node) => prop.type === 'Property' && prop.key?.name === 'refs',\n );\n\n if (!refsProp?.value || refsProp.value.type !== 'ArrayExpression') return;\n\n for (const element of refsProp.value.elements ?? []) {\n if (!element || element.type !== 'Literal') continue;\n const raw = element.value;\n if (typeof raw !== 'string') continue;\n // Strip the multiple-ref suffix before checking casing\n const name = raw.endsWith('[]') ? raw.slice(0, -2) : raw;\n if (!isCamelCase(name)) {\n const fixed = toCamelCase(name) + (raw.endsWith('[]') ? '[]' : '');\n context.report({\n node: element,\n messageId: 'notCamelCase',\n data: { name },\n fix: (fixer: any) => fixer.replaceText(element, `'${fixed}'`),\n });\n }\n }\n}\n","import {\n isBaseSubclass,\n isCamelCase,\n toCamelCase,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nexport const optionsCamelCase = createRule({\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description: 'Require option keys in static config to be camelCase',\n },\n messages: {\n notCamelCase: 'Option key \"{{name}}\" must be camelCase.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ClassDeclaration(node: Node) {\n check(node, context);\n },\n ClassExpression(node: Node) {\n check(node, context);\n },\n };\n },\n});\n\nfunction check(node: Node, context: RuleContext) {\n if (!isBaseSubclass(node, context)) return;\n\n const body: Node[] = node.body?.body ?? [];\n\n const configProp = body.find(\n (member: Node) =>\n member.type === 'PropertyDefinition' &&\n member.static === true &&\n member.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return;\n\n const optionsProp = configProp.value.properties?.find(\n (prop: Node) => prop.type === 'Property' && prop.key?.name === 'options',\n );\n\n if (!optionsProp?.value || optionsProp.value.type !== 'ObjectExpression') return;\n\n for (const prop of optionsProp.value.properties ?? []) {\n if (prop.type !== 'Property') continue;\n const name = prop.key?.name ?? prop.key?.value;\n if (typeof name !== 'string') continue;\n if (!isCamelCase(name)) {\n const fixed = toCamelCase(name);\n // Quoted key ('slides-to-show') vs identifier key (SlidesToShow)\n const fixedText = prop.key.type === 'Literal' ? `'${fixed}'` : fixed;\n context.report({\n node: prop.key,\n messageId: 'notCamelCase',\n data: { name },\n fix: (fixer: any) => fixer.replaceText(prop.key, fixedText),\n });\n }\n }\n}\n","import {\n isBaseSubclass,\n LIFECYCLE_METHODS,\n findEnclosingClass,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nexport const asyncLifecycleMethods = createRule({\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description: 'Require lifecycle methods on Base subclasses to be async',\n },\n messages: {\n notAsync: 'Lifecycle method \"{{name}}\" must be declared as async.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n MethodDefinition(node: Node) {\n const name = node.key?.name;\n if (!name || !LIFECYCLE_METHODS.has(name)) return;\n if (node.value?.async) return;\n\n const ancestors = context.getAncestors\n ? context.getAncestors()\n : (context.sourceCode?.getAncestors?.(node) ?? []);\n\n const enclosingClass = findEnclosingClass(ancestors);\n if (!enclosingClass || !isBaseSubclass(enclosingClass, context)) return;\n\n context.report({\n node,\n messageId: 'notAsync',\n data: { name },\n fix: (fixer: any) => fixer.insertTextBefore(node.key, 'async '),\n });\n },\n };\n },\n});\n","import {\n isBaseSubclass,\n findEnclosingClass,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\n// onXxxYyy — the part after \"on\" must start with an uppercase letter\nconst ON_HANDLER_RE = /^on[A-Z][a-zA-Z0-9]*$/;\n\nexport const onHandlerNaming = createRule({\n meta: {\n type: 'problem',\n docs: {\n description: 'Require event handler methods to follow the onXxxYyy naming convention',\n },\n messages: {\n invalidName:\n 'Event handler \"{{name}}\" must follow the onXxxYyy camelCase convention (e.g. onClickButton).',\n },\n },\n createOnce(context: RuleContext) {\n return {\n MethodDefinition(node: Node) {\n // Skip getters, setters — those are not event handlers\n if (node.kind === 'get' || node.kind === 'set') return;\n\n const name = node.key?.name;\n // Only lint methods that start with \"on\" followed by an uppercase letter —\n // that's the unambiguous signal of an intended event handler.\n if (!name || !/^on[A-Z]/.test(name)) return;\n if (ON_HANDLER_RE.test(name)) return;\n\n const ancestors = context.getAncestors\n ? context.getAncestors()\n : (context.sourceCode?.getAncestors?.(node) ?? []);\n\n const enclosingClass = findEnclosingClass(ancestors);\n if (!enclosingClass || !isBaseSubclass(enclosingClass, context)) return;\n\n context.report({ node, messageId: 'invalidName', data: { name } });\n },\n };\n },\n});\n","import {\n isBaseSubclass,\n findEnclosingClass,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\n// Events that only make sense on window/document, never on a DOM element.\n// Pointer, keyboard, and form events are intentionally excluded — they can all\n// fire on elements too, so onResize/onScroll without a prefix is the only\n// unambiguous mistake worth flagging automatically.\nconst GLOBAL_ONLY_EVENTS = new Set(['Resize']);\n\nexport const onGlobalHandlerPrefix = createRule({\n meta: {\n type: 'suggestion',\n docs: {\n description:\n 'Require global event handlers (resize, scroll, etc.) to be prefixed with onWindow or onDocument',\n },\n messages: {\n missingPrefix:\n '\"{{name}}\" looks like a global event handler. Use \"onWindow{{event}}\" or \"onDocument{{event}}\" to bind to window/document events.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n MethodDefinition(node: Node) {\n const name = node.key?.name;\n if (!name || !name.startsWith('on')) return;\n\n const suffix = name.slice(2); // strip \"on\"\n const event = GLOBAL_ONLY_EVENTS.has(suffix) ? suffix : null;\n if (!event) return;\n\n // Allow onWindow* and onDocument* — those are correct\n if (name.startsWith('onWindow') || name.startsWith('onDocument')) return;\n\n const ancestors = context.getAncestors\n ? context.getAncestors()\n : (context.sourceCode?.getAncestors?.(node) ?? []);\n\n const enclosingClass = findEnclosingClass(ancestors);\n if (!enclosingClass || !isBaseSubclass(enclosingClass, context)) return;\n\n context.report({\n node,\n messageId: 'missingPrefix',\n data: { name, event },\n });\n },\n };\n },\n});\n","import {\n createRule,\n findComponentConfig,\n findEnclosingClass,\n getAncestors,\n getKeyName,\n getProperty,\n isBaseSubclass,\n isComponentClass,\n type Node,\n type RuleContext,\n} from '../utils/ast.ts';\n\n/** Deprecated in v3, still present at runtime. */\nconst V3_DEPRECATED = new Map([\n ['$parent', '$closest()'],\n ['$root', '$closest()'],\n ['$children', '$query()'],\n]);\n\n/** Removed in v4. Reaching for any of these is a runtime error, not a warning. */\nconst V4_REMOVED = new Map([\n ['$parent', '$closest()'],\n ['$root', '$closest()'],\n ['$children', '$watchChildren()'],\n ['$update', 'nothing — $refs and $options read the DOM on every access'],\n // `$warn` is not listed: v4 has one again, and it is a different thing from\n // v3's logger — it reports on the cancelable diagnostic channel, filling in\n // the component name and element, rather than writing to the console. See\n // `$error` for the counterpart that carries a cause.\n ['$log', 'console.log()'],\n ['$terminate', '$unmount()'],\n]);\n\n/** Methods v4 no longer calls. Defining one is dead code. */\nconst V4_REMOVED_METHODS = new Map([\n ['updated', '$watchChildren(), or an option<Name>Changed() hook'],\n ['terminated', 'unmounted()'],\n]);\n\n/** `$services` survives, but its two switches do not. */\nconst V4_REMOVED_SERVICE_METHODS = new Map([\n ['enable', 'this.$services.<hook>.start()'],\n ['disable', 'this.$services.<hook>.stop()'],\n]);\n\nexport const noDeprecatedProperties = createRule({\n meta: {\n type: 'problem',\n docs: {\n description: 'Disallow deprecated Base properties, and the members v4 removed',\n },\n schema: [\n {\n type: 'object',\n properties: { version: { enum: ['v3', 'v4'] } },\n additionalProperties: false,\n },\n ],\n messages: {\n deprecated: '\"{{name}}\" is deprecated. Use {{replacement}} instead.',\n removed: '\"{{name}}\" is removed in v4. Use {{replacement}} instead.',\n removedMethod:\n '\"{{name}}()\" is removed in v4, so this method is never called. Use {{replacement}} instead.',\n removedConfig:\n '`config.emits` is removed in v4. Declare the events in the `$emits` type of the component instead — nothing of it stays in the bundle.',\n },\n },\n createOnce(context: RuleContext) {\n /**\n * `createOnce` runs once for the whole run, while `context` tracks the file\n * being linted. Options are therefore read per file, at report time.\n */\n const isV4Mode = (): boolean => context.options?.[0]?.version === 'v4';\n\n /**\n * v3 resolves a component class by its `Base` superclass; v4 also writes\n * `extends with<Service>(…)` and `@component({ … })`.\n */\n function isComponent(node: Node): boolean {\n return isV4Mode() ? isComponentClass(node) : isBaseSubclass(node, context);\n }\n\n function enclosingComponent(node: Node): Node | null {\n const enclosing = findEnclosingClass(getAncestors(node, context));\n return enclosing && isComponent(enclosing) ? enclosing : null;\n }\n\n return {\n MemberExpression(node: Node) {\n const name = node.property?.name;\n if (!name) return;\n\n const isV4 = isV4Mode();\n\n // `this.$services.enable(…)` — the receiver is a member, not `this`.\n if (\n isV4 &&\n V4_REMOVED_SERVICE_METHODS.has(name) &&\n node.object?.type === 'MemberExpression' &&\n node.object.object?.type === 'ThisExpression' &&\n node.object.property?.name === '$services'\n ) {\n if (!enclosingComponent(node)) return;\n context.report({\n node,\n messageId: 'removed',\n data: {\n name: `$services.${name}`,\n replacement: V4_REMOVED_SERVICE_METHODS.get(name),\n },\n });\n return;\n }\n\n const members = isV4 ? V4_REMOVED : V3_DEPRECATED;\n if (!members.has(name)) return;\n\n // Only flag `this.$parent` etc. — not arbitrary object access\n if (node.object?.type !== 'ThisExpression') return;\n if (!enclosingComponent(node)) return;\n\n context.report({\n node,\n messageId: isV4 ? 'removed' : 'deprecated',\n data: { name, replacement: members.get(name) },\n });\n },\n\n MethodDefinition(node: Node) {\n if (!isV4Mode()) return;\n\n const name = getKeyName(node);\n if (!name || !V4_REMOVED_METHODS.has(name)) return;\n if (node.static === true) return;\n if (!enclosingComponent(node)) return;\n\n context.report({\n node: node.key ?? node,\n messageId: 'removedMethod',\n data: { name, replacement: V4_REMOVED_METHODS.get(name) },\n });\n },\n\n ClassDeclaration(node: Node) {\n checkConfig(node);\n },\n ClassExpression(node: Node) {\n checkConfig(node);\n },\n };\n\n function checkConfig(node: Node) {\n if (!isV4Mode() || !isComponent(node)) return;\n\n const config = findComponentConfig(node);\n const emits = getProperty(config, 'emits');\n if (!emits) return;\n\n context.report({ node: emits, messageId: 'removedConfig' });\n }\n },\n});\n","import {\n findEnclosingClass,\n isBaseSubclass,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nexport const noDispatchEvent = createRule({\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Disallow dispatchEvent() in Base subclasses — use this.$emit() instead',\n },\n messages: {\n useEmit: 'Use this.$emit() instead of dispatchEvent() to emit events in a Base component.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n CallExpression(node: Node) {\n const callee = node.callee;\n\n const isDispatchEvent =\n // this.dispatchEvent(...)\n (callee.type === 'MemberExpression' &&\n callee.object?.type === 'ThisExpression' &&\n callee.property?.name === 'dispatchEvent') ||\n // this.$el.dispatchEvent(...) or el.dispatchEvent(...)\n (callee.type === 'MemberExpression' && callee.property?.name === 'dispatchEvent');\n\n if (!isDispatchEvent) return;\n\n const ancestors = context.getAncestors\n ? context.getAncestors()\n : (context.sourceCode?.getAncestors?.(node) ?? []);\n\n const enclosingClass = findEnclosingClass(ancestors);\n if (!enclosingClass || !isBaseSubclass(enclosingClass, context)) return;\n\n context.report({ node, messageId: 'useEmit' });\n },\n };\n },\n});\n","import {\n findEnclosingClass,\n isBaseSubclass,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nexport const noShadowDom = createRule({\n meta: {\n type: 'problem',\n docs: {\n description: 'Disallow attachShadow() in Base subclasses — js-toolkit uses Light DOM only',\n },\n messages: {\n noShadow:\n 'Do not use attachShadow() in a Base component. @studiometa/js-toolkit uses Light DOM only.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n CallExpression(node: Node) {\n const callee = node.callee;\n if (callee.type !== 'MemberExpression' || callee.property?.name !== 'attachShadow') {\n return;\n }\n\n const ancestors = context.getAncestors\n ? context.getAncestors()\n : (context.sourceCode?.getAncestors?.(node) ?? []);\n\n const enclosingClass = findEnclosingClass(ancestors);\n if (!enclosingClass || !isBaseSubclass(enclosingClass, context)) return;\n\n context.report({ node, messageId: 'noShadow' });\n },\n };\n },\n});\n","import { type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nexport const noCreateApp = createRule({\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Disallow createApp() — use registerComponent() instead',\n },\n messages: {\n useRegister:\n 'createApp() is deprecated. Use registerComponent() from @studiometa/js-toolkit instead.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n CallExpression(node: Node) {\n const callee = node.callee;\n if (callee.type === 'Identifier' && callee.name === 'createApp') {\n context.report({ node, messageId: 'useRegister' });\n }\n },\n };\n },\n});\n","import {\n findEnclosingClass,\n isBaseSubclass,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nconst FORBIDDEN = new Set(['addEventListener', 'removeEventListener']);\n\nexport const noEventListenerMethods = createRule({\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Disallow addEventListener/removeEventListener in Base subclasses — use on* methods instead',\n },\n messages: {\n useOnMethod:\n '\"{{method}}()\" should not be used in a Base component. ' +\n 'Define an \"on<Target><Event>()\" method instead — the framework handles binding and cleanup automatically.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n CallExpression(node: Node) {\n const callee = node.callee;\n if (callee.type !== 'MemberExpression') return;\n\n const method = callee.property?.name;\n if (!method || !FORBIDDEN.has(method)) return;\n\n // Only flag calls on `this.*`, `document`, or `window`\n let root = callee.object;\n while (root?.type === 'MemberExpression') root = root.object;\n const isThis = root?.type === 'ThisExpression';\n const isGlobal =\n root?.type === 'Identifier' && (root.name === 'document' || root.name === 'window');\n if (!isThis && !isGlobal) return;\n\n const ancestors = context.getAncestors\n ? context.getAncestors()\n : (context.sourceCode?.getAncestors?.(node) ?? []);\n\n const enclosingClass = findEnclosingClass(ancestors);\n if (!enclosingClass || !isBaseSubclass(enclosingClass, context)) return;\n\n context.report({ node, messageId: 'useOnMethod', data: { method } });\n },\n };\n },\n});\n","import { isBaseSubclass, type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nexport const refsPluralMultiple = createRule({\n meta: {\n type: 'problem',\n docs: {\n description: 'Require multiple-ref names (using [] suffix) to be pluralized',\n },\n messages: {\n notPlural: 'Multiple ref \"{{name}}\" must be pluralized (e.g. \"{{name}}s[]\").',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ClassDeclaration(node: Node) {\n check(node, context);\n },\n ClassExpression(node: Node) {\n check(node, context);\n },\n };\n },\n});\n\nfunction check(node: Node, context: RuleContext) {\n if (!isBaseSubclass(node, context)) return;\n\n const body: Node[] = node.body?.body ?? [];\n\n const configProp = body.find(\n (member: Node) =>\n member.type === 'PropertyDefinition' &&\n member.static === true &&\n member.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return;\n\n const refsProp = configProp.value.properties?.find(\n (prop: Node) => prop.type === 'Property' && prop.key?.name === 'refs',\n );\n\n if (!refsProp?.value || refsProp.value.type !== 'ArrayExpression') return;\n\n for (const element of refsProp.value.elements ?? []) {\n if (!element || element.type !== 'Literal') continue;\n const raw = element.value;\n if (typeof raw !== 'string') continue;\n if (!raw.endsWith('[]')) continue;\n\n const name = raw.slice(0, -2);\n if (!name.endsWith('s')) {\n context.report({\n node: element,\n messageId: 'notPlural',\n data: { name },\n });\n }\n }\n}\n","import { type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nconst UTILS_PREFIX = '@studiometa/js-toolkit/utils/';\n\n/**\n * A published per-symbol subpath: exactly one segment after `utils/`, and no dot in it.\n *\n * Since v3.9.0 every util is exported at `@studiometa/js-toolkit/utils/<name>`. Those subpaths are\n * public API and the cheapest way to import a util — they resolve to the module declaring the symbol,\n * so a consumer served by a CDN downloads that module instead of the whole `utils` barrel. Anything\n * deeper (`utils/math/damp.js`) reaches into the package layout, which is not part of the API and\n * changes without notice.\n *\n * Every key of the `exports` map is a symbol name, so none of them contains a dot; rejecting the dot\n * outright keeps a file path out (`utils/damp.ts`, `utils/foo.css`) whatever its extension.\n */\nconst PUBLIC_SUBPATH_RE = /^[^/.]+$/;\n\nexport const noDeepUtilsImport = createRule({\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Disallow importing internal module paths from @studiometa/js-toolkit/utils — use the public per-symbol subpath',\n },\n messages: {\n noDeepImport:\n 'Import from \"{{source}}\" reaches into the package layout. Use the public subpath \"@studiometa/js-toolkit/utils/<name>\" for a single util, or \"@studiometa/js-toolkit/utils\" for several.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ImportDeclaration(node: Node) {\n const source: string = node.source.value;\n if (!source.startsWith(UTILS_PREFIX)) return;\n\n if (PUBLIC_SUBPATH_RE.test(source.slice(UTILS_PREFIX.length))) return;\n\n // No autofix: the subpath key is the symbol's exported name, which does not always match the\n // module path (`utils/history.js` exports `push`, published as `utils/historyPush`), so a\n // mechanical rewrite can produce a subpath which does not exist.\n context.report({ node, messageId: 'noDeepImport', data: { source } });\n },\n };\n },\n});\n","import { type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\n/** A relative import of a barrel: `'./utils/index.js'`, `'../Base/index.js'`. */\nconst RELATIVE_BARREL_RE = /^\\.{1,2}\\/.*\\/index\\.js$/;\n\nexport const noInternalBarrelImport = createRule({\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Disallow importing an internal barrel inside the package — import the declaring module instead',\n },\n messages: {\n noBarrelImport:\n 'Import from \"{{source}}\" pulls in every symbol the barrel names. Import the module declaring the symbol instead, so a consumer served by a CDN only downloads what it uses.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ImportDeclaration(node: Node) {\n const source: string = node.source.value;\n if (!RELATIVE_BARREL_RE.test(source)) return;\n\n context.report({ node, messageId: 'noBarrelImport', data: { source } });\n },\n };\n },\n});\n","import { toCamelCase, type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nfunction isThisRefs(node: Node): boolean {\n return (\n node.type === 'MemberExpression' &&\n node.object?.type === 'ThisExpression' &&\n node.property?.name === '$refs'\n );\n}\n\nexport const refsNoBracketAccess = createRule({\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description: 'Disallow bracket access with [] suffix on this.$refs',\n },\n messages: {\n noBracketAccess: 'Use \"this.$refs.{{fixed}}\" instead of \"this.$refs[\\'{{raw}}\\']\".',\n },\n },\n createOnce(context: RuleContext) {\n return {\n MemberExpression(node: Node) {\n if (!isThisRefs(node.object)) return;\n if (!node.computed) return;\n const prop = node.property;\n if (prop.type !== 'Literal' || typeof prop.value !== 'string') return;\n const raw: string = prop.value;\n if (!raw.endsWith('[]')) return;\n\n const stripped = raw.slice(0, -2);\n const fixed = toCamelCase(stripped);\n\n context.report({\n node,\n messageId: 'noBracketAccess',\n data: { raw, fixed },\n fix(fixer: any) {\n const src = context.sourceCode ?? context.getSourceCode?.();\n const objText = src.getText(node.object);\n return fixer.replaceText(node, `${objText}.${fixed}`);\n },\n });\n },\n };\n },\n});\n","import { type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nexport const noRedundantWithMountWhenInView = createRule({\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Disallow wrapping withMountWhenInView inside withScrolledInView (redundant)',\n },\n messages: {\n redundant:\n 'withScrolledInView already includes withMountWhenInView internally. Remove the inner withMountWhenInView call.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n 'ClassDeclaration, ClassExpression'(node: Node) {\n check(node, context);\n },\n };\n },\n});\n\nfunction check(node: Node, context: RuleContext) {\n const superClass = node.superClass;\n if (!superClass || superClass.type !== 'CallExpression') return;\n if (superClass.callee?.name !== 'withScrolledInView') return;\n\n const arg = superClass.arguments?.[0];\n if (!arg || arg.type !== 'CallExpression') return;\n if (arg.callee?.name !== 'withMountWhenInView') return;\n\n context.report({ node: superClass, messageId: 'redundant' });\n}\n","import {\n findEnclosingClass,\n isBaseSubclass,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nconst QUERY_METHODS = new Set(['querySelector', 'querySelectorAll']);\n\nfunction isThisEl(node: Node): boolean {\n return (\n node.type === 'MemberExpression' &&\n node.object?.type === 'ThisExpression' &&\n node.property?.name === '$el'\n );\n}\n\nexport const preferRefOverQuerySelector = createRule({\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Prefer this.$refs over this.$el.querySelector() in Base subclasses',\n },\n messages: {\n preferRef:\n 'Avoid \"this.$el.{{method}}()\". Declare a ref in static config and use \"this.$refs\" instead.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n CallExpression(node: Node) {\n const callee = node.callee;\n if (callee?.type !== 'MemberExpression') return;\n if (!isThisEl(callee.object)) return;\n const method = callee.property?.name;\n if (!QUERY_METHODS.has(method)) return;\n\n const ancestors =\n context.getAncestors?.() ?? context.sourceCode?.getAncestors?.(node) ?? [];\n const cls = findEnclosingClass(ancestors);\n if (!cls || !isBaseSubclass(cls, context)) return;\n\n context.report({ node, messageId: 'preferRef', data: { method } });\n },\n };\n },\n});\n","import {\n isBaseSubclass,\n toCamelCase,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nfunction collectDeclaredRefs(classNode: Node): Set<string> {\n const body: Node[] = classNode.body?.body ?? [];\n const configProp = body.find(\n (m: Node) => m.type === 'PropertyDefinition' && m.static === true && m.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return new Set();\n\n const refsProp = configProp.value.properties?.find(\n (p: Node) => p.type === 'Property' && p.key?.name === 'refs',\n );\n\n if (!refsProp?.value || refsProp.value.type !== 'ArrayExpression') return new Set();\n\n const names = new Set<string>();\n for (const el of refsProp.value.elements ?? []) {\n if (!el || el.type !== 'Literal' || typeof el.value !== 'string') continue;\n const raw: string = el.value;\n const stripped = raw.endsWith('[]') ? raw.slice(0, -2) : raw;\n names.add(toCamelCase(stripped));\n }\n return names;\n}\n\nfunction isThisRefs(node: Node): boolean {\n return (\n node.type === 'MemberExpression' &&\n node.object?.type === 'ThisExpression' &&\n node.property?.name === '$refs'\n );\n}\n\nexport const requireRefsDeclaredInConfig = createRule({\n meta: {\n type: 'problem',\n docs: {\n description: 'Require all this.$refs accesses to be declared in static config.refs',\n },\n messages: {\n undeclared: 'Ref \"{{name}}\" is not declared in static config.refs.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n 'ClassDeclaration, ClassExpression'(classNode: Node) {\n if (!isBaseSubclass(classNode, context)) return;\n\n const declared = collectDeclaredRefs(classNode);\n\n // Walk the class body looking for this.$refs.<name> accesses\n walkNode(classNode.body, (node: Node) => {\n if (node.type !== 'MemberExpression') return;\n if (!isThisRefs(node.object)) return;\n\n let refName: string | null = null;\n\n if (!node.computed && node.property?.type === 'Identifier') {\n refName = node.property.name;\n } else if (\n node.computed &&\n node.property?.type === 'Literal' &&\n typeof node.property.value === 'string'\n ) {\n const raw: string = node.property.value;\n const stripped = raw.endsWith('[]') ? raw.slice(0, -2) : raw;\n refName = toCamelCase(stripped);\n }\n\n if (refName && !declared.has(refName)) {\n context.report({\n node,\n messageId: 'undeclared',\n data: { name: refName },\n });\n }\n });\n },\n };\n },\n});\n\nfunction walkNode(node: Node, visit: (n: Node) => void) {\n if (!node || typeof node !== 'object') return;\n visit(node);\n for (const key of Object.keys(node)) {\n if (key === 'parent') continue;\n const child = node[key];\n if (Array.isArray(child)) {\n for (const item of child) walkNode(item, visit);\n } else if (child && typeof child === 'object' && child.type) {\n walkNode(child, visit);\n }\n }\n}\n","import {\n findEnclosingClass,\n isBaseSubclass,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nexport const noManualIntersectionObserver = createRule({\n meta: {\n type: 'suggestion',\n docs: {\n description:\n 'Disallow manual IntersectionObserver inside Base subclasses; use withIntersectionObserver or withMountWhenInView instead',\n },\n messages: {\n noManual:\n 'Avoid manual \"new IntersectionObserver()\". Use \"withIntersectionObserver\" or \"withMountWhenInView\" decorators instead.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n NewExpression(node: Node) {\n if (node.callee?.name !== 'IntersectionObserver') return;\n\n const ancestors =\n context.getAncestors?.() ?? context.sourceCode?.getAncestors?.(node) ?? [];\n const cls = findEnclosingClass(ancestors);\n if (!cls || !isBaseSubclass(cls, context)) return;\n\n context.report({ node, messageId: 'noManual' });\n },\n };\n },\n});\n","import {\n findEnclosingClass,\n isBaseSubclass,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nexport const noManualMutationObserver = createRule({\n meta: {\n type: 'suggestion',\n docs: {\n description:\n 'Disallow manual MutationObserver inside Base subclasses; use withMutation decorator instead',\n },\n messages: {\n noManual: 'Avoid manual \"new MutationObserver()\". Use the \"withMutation\" decorator instead.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n NewExpression(node: Node) {\n if (node.callee?.name !== 'MutationObserver') return;\n\n const ancestors =\n context.getAncestors?.() ?? context.sourceCode?.getAncestors?.(node) ?? [];\n const cls = findEnclosingClass(ancestors);\n if (!cls || !isBaseSubclass(cls, context)) return;\n\n context.report({ node, messageId: 'noManual' });\n },\n };\n },\n});\n","import { isBaseSubclass, type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\n/**\n * Returns true if the string is kebab-case:\n * all lowercase letters, digits and hyphens, no underscores or uppercase.\n */\nfunction isKebabCase(value: string): boolean {\n return /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/.test(value);\n}\n\n/**\n * Converts a camelCase, PascalCase or snake_case string to kebab-case.\n */\nfunction toKebabCase(value: string): string {\n return value\n .replace(/([A-Z])/g, (_, c: string) => `-${c.toLowerCase()}`)\n .replace(/_/g, '-')\n .replace(/^-/, '')\n .toLowerCase();\n}\n\nfunction check(node: Node, context: RuleContext) {\n if (!isBaseSubclass(node, context)) return;\n\n const body: Node[] = node.body?.body ?? [];\n\n const configProp = body.find(\n (member: Node) =>\n member.type === 'PropertyDefinition' &&\n member.static === true &&\n member.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return;\n\n const emitsProp = configProp.value.properties?.find(\n (prop: Node) => prop.type === 'Property' && prop.key?.name === 'emits',\n );\n\n if (!emitsProp?.value || emitsProp.value.type !== 'ArrayExpression') return;\n\n for (const element of emitsProp.value.elements ?? []) {\n if (!element || element.type !== 'Literal') continue;\n const name = element.value;\n if (typeof name !== 'string') continue;\n if (!isKebabCase(name)) {\n const fixed = toKebabCase(name);\n context.report({\n node: element,\n messageId: 'notKebabCase',\n data: { name },\n fix: (fixer: any) => fixer.replaceText(element, `'${fixed}'`),\n });\n }\n }\n}\n\nexport const emitsKebabCase = createRule({\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description: 'Require emit names in static config to be kebab-case',\n },\n messages: {\n notKebabCase: 'Emit name \"{{name}}\" must be kebab-case (e.g. \"content-change\").',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ClassDeclaration(node: Node) {\n check(node, context);\n },\n ClassExpression(node: Node) {\n check(node, context);\n },\n };\n },\n});\n","import { isBaseSubclass, type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nfunction check(node: Node, context: RuleContext) {\n if (!isBaseSubclass(node, context)) return;\n\n const body: Node[] = node.body?.body ?? [];\n\n const configProp = body.find(\n (member: Node) =>\n member.type === 'PropertyDefinition' &&\n member.static === true &&\n member.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return;\n\n const emitsProp = configProp.value.properties?.find(\n (prop: Node) => prop.type === 'Property' && prop.key?.name === 'emits',\n );\n\n if (!emitsProp?.value || emitsProp.value.type !== 'ArrayExpression') return;\n\n for (const element of emitsProp.value.elements ?? []) {\n if (!element || element.type !== 'Literal') continue;\n const name = element.value;\n if (typeof name !== 'string') continue;\n if (!name.includes('-')) {\n context.report({\n node: element,\n messageId: 'singleWord',\n data: { name },\n });\n }\n }\n}\n\nexport const emitsMultiWord = createRule({\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Require emit names in static config to be multi-word to avoid collision with native DOM events',\n },\n messages: {\n singleWord:\n 'Emit name \"{{name}}\" must be multi-word (e.g. \"item-click\" instead of \"click\") to avoid collisions with native DOM events.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ClassDeclaration(node: Node) {\n check(node, context);\n },\n ClassExpression(node: Node) {\n check(node, context);\n },\n };\n },\n});\n","import {\n isBaseSubclass,\n isPascalCase,\n toPascalCase,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nfunction check(node: Node, context: RuleContext) {\n if (!isBaseSubclass(node, context)) return;\n\n const body: Node[] = node.body?.body ?? [];\n\n const configProp = body.find(\n (member: Node) =>\n member.type === 'PropertyDefinition' &&\n member.static === true &&\n member.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return;\n\n const componentsProp = configProp.value.properties?.find(\n (prop: Node) => prop.type === 'Property' && prop.key?.name === 'components',\n );\n\n if (!componentsProp?.value || componentsProp.value.type !== 'ObjectExpression') return;\n\n for (const prop of componentsProp.value.properties ?? []) {\n if (prop.type !== 'Property') continue;\n const name = prop.key?.name ?? prop.key?.value;\n if (typeof name !== 'string') continue;\n if (!isPascalCase(name)) {\n const fixed = toPascalCase(name);\n const fixedText = prop.key.type === 'Literal' ? `'${fixed}'` : fixed;\n context.report({\n node: prop.key,\n messageId: 'notPascalCase',\n data: { name },\n fix: (fixer: any) => fixer.replaceText(prop.key, fixedText),\n });\n }\n }\n}\n\nexport const componentsPascalCase = createRule({\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description: 'Require component keys in static config to be PascalCase',\n },\n messages: {\n notPascalCase: 'Component key \"{{name}}\" must be PascalCase (e.g. \"MyComponent\").',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ClassDeclaration(node: Node) {\n check(node, context);\n },\n ClassExpression(node: Node) {\n check(node, context);\n },\n };\n },\n});\n","import { isBaseSubclass, type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nfunction collectDeclaredEmits(classNode: Node): Set<string> {\n const body: Node[] = classNode.body?.body ?? [];\n const configProp = body.find(\n (m: Node) => m.type === 'PropertyDefinition' && m.static === true && m.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return new Set();\n\n const emitsProp = configProp.value.properties?.find(\n (p: Node) => p.type === 'Property' && p.key?.name === 'emits',\n );\n\n if (!emitsProp?.value || emitsProp.value.type !== 'ArrayExpression') return new Set();\n\n const names = new Set<string>();\n for (const el of emitsProp.value.elements ?? []) {\n if (el?.type === 'Literal' && typeof el.value === 'string') {\n names.add(el.value);\n }\n }\n return names;\n}\n\n/**\n * Returns true if `node` looks like `this.$emit`.\n */\nfunction isThisEmit(node: Node): boolean {\n return (\n node.type === 'MemberExpression' &&\n node.object?.type === 'ThisExpression' &&\n node.property?.name === '$emit'\n );\n}\n\nexport const requireEmitDeclaredInConfig = createRule({\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Require all this.$emit() calls to use event names declared in static config.emits',\n },\n messages: {\n undeclared: 'Emit \"{{name}}\" is not declared in static config.emits.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n 'ClassDeclaration, ClassExpression'(classNode: Node) {\n if (!isBaseSubclass(classNode, context)) return;\n\n const declared = collectDeclaredEmits(classNode);\n\n walkNode(classNode.body, (node: Node) => {\n // Match: this.$emit('event-name', ...)\n if (node.type !== 'CallExpression') return;\n if (!isThisEmit(node.callee)) return;\n\n const firstArg = node.arguments?.[0];\n if (!firstArg || firstArg.type !== 'Literal') return;\n const name = firstArg.value;\n if (typeof name !== 'string') return;\n\n if (!declared.has(name)) {\n context.report({\n node: firstArg,\n messageId: 'undeclared',\n data: { name },\n });\n }\n });\n },\n };\n },\n});\n\nfunction walkNode(node: Node, visit: (n: Node) => void) {\n if (!node || typeof node !== 'object') return;\n visit(node);\n for (const key of Object.keys(node)) {\n if (key === 'parent') continue;\n const child = node[key];\n if (Array.isArray(child)) {\n for (const item of child) walkNode(item, visit);\n } else if (child && typeof child === 'object' && child.type) {\n walkNode(child, visit);\n }\n }\n}\n","import { isBaseSubclass, type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nfunction collectDeclaredComponents(classNode: Node): Set<string> {\n const body: Node[] = classNode.body?.body ?? [];\n const configProp = body.find(\n (m: Node) => m.type === 'PropertyDefinition' && m.static === true && m.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return new Set();\n\n const componentsProp = configProp.value.properties?.find(\n (p: Node) => p.type === 'Property' && p.key?.name === 'components',\n );\n\n if (!componentsProp?.value || componentsProp.value.type !== 'ObjectExpression') return new Set();\n\n const names = new Set<string>();\n for (const prop of componentsProp.value.properties ?? []) {\n if (prop.type !== 'Property') continue;\n const name = prop.key?.name ?? prop.key?.value;\n if (typeof name === 'string') {\n names.add(name);\n }\n }\n return names;\n}\n\n/**\n * Returns true if `node` looks like `this.$children`.\n */\nfunction isThisChildren(node: Node): boolean {\n return (\n node.type === 'MemberExpression' &&\n node.object?.type === 'ThisExpression' &&\n node.property?.name === '$children'\n );\n}\n\nexport const requireChildrenDeclaredInConfig = createRule({\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Require all this.$children accesses to use component names declared in static config.components',\n },\n messages: {\n undeclared: 'Component \"{{name}}\" is not declared in static config.components.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n 'ClassDeclaration, ClassExpression'(classNode: Node) {\n if (!isBaseSubclass(classNode, context)) return;\n\n const declared = collectDeclaredComponents(classNode);\n\n walkNode(classNode.body, (node: Node) => {\n if (node.type !== 'MemberExpression') return;\n if (!isThisChildren(node.object)) return;\n\n let name: string | null = null;\n\n if (!node.computed && node.property?.type === 'Identifier') {\n name = node.property.name;\n } else if (\n node.computed &&\n node.property?.type === 'Literal' &&\n typeof node.property.value === 'string'\n ) {\n name = node.property.value;\n }\n\n if (name && !declared.has(name)) {\n context.report({\n node,\n messageId: 'undeclared',\n data: { name },\n });\n }\n });\n },\n };\n },\n});\n\nfunction walkNode(node: Node, visit: (n: Node) => void) {\n if (!node || typeof node !== 'object') return;\n visit(node);\n for (const key of Object.keys(node)) {\n if (key === 'parent') continue;\n const child = node[key];\n if (Array.isArray(child)) {\n for (const item of child) walkNode(item, visit);\n } else if (child && typeof child === 'object' && child.type) {\n walkNode(child, visit);\n }\n }\n}\n","import {\n isBaseSubclass,\n toCamelCase,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nfunction collectDeclaredOptions(classNode: Node): Set<string> {\n const body: Node[] = classNode.body?.body ?? [];\n const configProp = body.find(\n (m: Node) => m.type === 'PropertyDefinition' && m.static === true && m.key?.name === 'config',\n );\n\n if (!configProp?.value || configProp.value.type !== 'ObjectExpression') return new Set();\n\n const optionsProp = configProp.value.properties?.find(\n (p: Node) => p.type === 'Property' && p.key?.name === 'options',\n );\n\n if (!optionsProp?.value || optionsProp.value.type !== 'ObjectExpression') return new Set();\n\n const names = new Set<string>();\n for (const prop of optionsProp.value.properties ?? []) {\n if (prop.type !== 'Property') continue;\n const name = prop.key?.name ?? prop.key?.value;\n if (typeof name === 'string') {\n names.add(toCamelCase(name));\n }\n }\n return names;\n}\n\n/**\n * Returns true if `node` looks like `this.$options`.\n */\nfunction isThisOptions(node: Node): boolean {\n return (\n node.type === 'MemberExpression' &&\n node.object?.type === 'ThisExpression' &&\n node.property?.name === '$options'\n );\n}\n\nexport const requireOptionsDeclaredInConfig = createRule({\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Require all this.$options accesses to use option names declared in static config.options',\n },\n messages: {\n undeclared: 'Option \"{{name}}\" is not declared in static config.options.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n 'ClassDeclaration, ClassExpression'(classNode: Node) {\n if (!isBaseSubclass(classNode, context)) return;\n\n const declared = collectDeclaredOptions(classNode);\n\n walkNode(classNode.body, (node: Node) => {\n if (node.type !== 'MemberExpression') return;\n if (!isThisOptions(node.object)) return;\n\n let name: string | null = null;\n\n if (!node.computed && node.property?.type === 'Identifier') {\n name = node.property.name;\n } else if (\n node.computed &&\n node.property?.type === 'Literal' &&\n typeof node.property.value === 'string'\n ) {\n name = toCamelCase(node.property.value);\n }\n\n if (name && !declared.has(name)) {\n context.report({\n node,\n messageId: 'undeclared',\n data: { name },\n });\n }\n });\n },\n };\n },\n});\n\nfunction walkNode(node: Node, visit: (n: Node) => void) {\n if (!node || typeof node !== 'object') return;\n visit(node);\n for (const key of Object.keys(node)) {\n if (key === 'parent') continue;\n const child = node[key];\n if (Array.isArray(child)) {\n for (const item of child) walkNode(item, visit);\n } else if (child && typeof child === 'object' && child.type) {\n walkNode(child, visit);\n }\n }\n}\n","import {\n findEnclosingClass,\n isBaseSubclass,\n type Node,\n type RuleContext,\n createRule,\n} from '../utils/ast.ts';\n\nconst TRACKED_PROPERTIES = new Set(['$refs', '$options', '$children']);\n\nfunction isTrackedLookup(node: Node): { prop: string; name: string } | null {\n if (\n node.type === 'MemberExpression' &&\n node.object?.type === 'MemberExpression' &&\n node.object.object?.type === 'ThisExpression' &&\n node.object.property?.type === 'Identifier' &&\n TRACKED_PROPERTIES.has(node.object.property.name) &&\n node.property?.type === 'Identifier' &&\n !node.computed\n ) {\n return { prop: node.object.property.name, name: node.property.name };\n }\n return null;\n}\n\nfunction findEnclosingMethod(ancestors: Node[]): Node | null {\n for (let i = ancestors.length - 1; i >= 0; i--) {\n const node = ancestors[i];\n if (node.type === 'MethodDefinition') return node;\n }\n return null;\n}\n\nexport const preferDestructuredLookups = createRule({\n meta: {\n type: 'suggestion',\n docs: {\n description:\n 'Prefer destructuring this.$refs, this.$options and this.$children into local variables when accessed multiple times in the same method',\n },\n messages: {\n preferDestructured:\n '\"this.{{prop}}.{{name}}\" is accessed {{count}} times. Destructure it into a local variable to avoid repeated lookups.',\n },\n },\n createOnce(context: RuleContext) {\n // methodKey -> lookup key -> list of nodes\n const methodLookups = new Map<Node, Map<string, Node[]>>();\n\n return {\n MemberExpression(node: Node) {\n const match = isTrackedLookup(node);\n if (!match) return;\n\n const ancestors =\n context.getAncestors?.() ?? context.sourceCode?.getAncestors?.(node) ?? [];\n const method = findEnclosingMethod(ancestors);\n if (!method) return;\n\n const cls = findEnclosingClass(ancestors);\n if (!cls || !isBaseSubclass(cls, context)) return;\n\n if (!methodLookups.has(method)) methodLookups.set(method, new Map());\n const map = methodLookups.get(method)!;\n const key = `${match.prop}.${match.name}`;\n const list = map.get(key) ?? [];\n list.push(node);\n map.set(key, list);\n },\n\n 'MethodDefinition:exit'(node: Node) {\n const map = methodLookups.get(node);\n if (!map) return;\n methodLookups.delete(node);\n\n for (const [key, nodes] of map) {\n if (nodes.length < 2) continue;\n const [prop, name] = key.split('.');\n context.report({\n node: nodes[0],\n messageId: 'preferDestructured',\n data: { prop, name, count: String(nodes.length) },\n });\n }\n },\n };\n },\n});\n","import { isBaseSubclass, type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nexport const noDollarPrefix = createRule({\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Disallow user-defined methods and properties prefixed with \"$\" in Base subclasses — \"$\" is reserved for js-toolkit framework members',\n },\n messages: {\n noDollarPrefix:\n '\"${{name}}\" uses the \"$\" prefix, which is reserved for js-toolkit framework members. Rename it without the \"$\" prefix.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n ClassDeclaration(node: Node) {\n check(node, context);\n },\n ClassExpression(node: Node) {\n check(node, context);\n },\n };\n },\n});\n\nfunction check(node: Node, context: RuleContext) {\n if (!isBaseSubclass(node, context)) return;\n\n for (const member of node.body?.body ?? []) {\n if (member.static) continue;\n if (member.type !== 'MethodDefinition' && member.type !== 'PropertyDefinition') continue;\n const name: string = member.key?.name ?? '';\n if (name.startsWith('$')) {\n context.report({\n node: member.key,\n messageId: 'noDollarPrefix',\n data: { name: name.slice(1) },\n });\n }\n }\n}\n","import { isBaseSubclass, type Node, type RuleContext, createRule } from '../utils/ast.ts';\n\nconst SETUP_CALLS = new Set(['setTimeout', 'setInterval', 'requestAnimationFrame']);\n\nexport const requireDestroyedCleanup = createRule({\n meta: {\n type: 'suggestion',\n docs: {\n description:\n 'Require a destroyed() method in Base subclasses that use setTimeout, setInterval or requestAnimationFrame',\n },\n messages: {\n requireDestroyed:\n 'This component uses {{calls}} but has no destroyed() method. Add destroyed() to clear timers and avoid memory leaks.',\n },\n },\n createOnce(context: RuleContext) {\n // class node -> set of timer call names found\n const classTimers = new Map<Node, Set<string>>();\n // class node -> whether destroyed() exists\n const classHasDestroyed = new Map<Node, boolean>();\n\n return {\n ClassDeclaration(node: Node) {\n classTimers.set(node, new Set());\n classHasDestroyed.set(node, false);\n },\n\n ClassExpression(node: Node) {\n classTimers.set(node, new Set());\n classHasDestroyed.set(node, false);\n },\n\n MethodDefinition(node: Node) {\n if (node.key?.name === 'destroyed') {\n // Find the enclosing class\n const sourceCode = context.sourceCode ?? context.getSourceCode?.();\n const ancestors = context.getAncestors?.() ?? sourceCode?.getAncestors?.(node) ?? [];\n for (let i = ancestors.length - 1; i >= 0; i--) {\n const a = ancestors[i];\n if (a.type === 'ClassDeclaration' || a.type === 'ClassExpression') {\n classHasDestroyed.set(a, true);\n break;\n }\n }\n }\n },\n\n CallExpression(node: Node) {\n if (node.callee?.type !== 'Identifier') return;\n if (!SETUP_CALLS.has(node.callee.name)) return;\n\n const sourceCode = context.sourceCode ?? context.getSourceCode?.();\n const ancestors = context.getAncestors?.() ?? sourceCode?.getAncestors?.(node) ?? [];\n\n for (let i = ancestors.length - 1; i >= 0; i--) {\n const a = ancestors[i];\n if (a.type === 'ClassDeclaration' || a.type === 'ClassExpression') {\n if (!isBaseSubclass(a, context)) break;\n classTimers.get(a)?.add(node.callee.name);\n break;\n }\n }\n },\n\n 'ClassDeclaration:exit'(node: Node) {\n reportIfNeeded(node, context, classTimers, classHasDestroyed);\n },\n\n 'ClassExpression:exit'(node: Node) {\n reportIfNeeded(node, context, classTimers, classHasDestroyed);\n },\n };\n },\n});\n\nfunction reportIfNeeded(\n node: Node,\n context: RuleContext,\n classTimers: Map<Node, Set<string>>,\n classHasDestroyed: Map<Node, boolean>,\n) {\n const timers = classTimers.get(node);\n const hasDestroyed = classHasDestroyed.get(node);\n classTimers.delete(node);\n classHasDestroyed.delete(node);\n\n if (!timers || timers.size === 0) return;\n if (hasDestroyed) return;\n\n context.report({\n node: node.id ?? node,\n messageId: 'requireDestroyed',\n data: { calls: [...timers].join(', ') },\n });\n}\n","import {\n createRule,\n findEnclosingClass,\n getAncestors,\n getKeyName,\n hasDecorator,\n isComponentClass,\n isFunctionNode,\n walk,\n type Node,\n type RuleContext,\n} from '../utils/ast.ts';\n\n/**\n * Hooks whose service fans its subscribers out inside `defaultScheduler.read()`.\n *\n * `raf.ts`, `scroll.ts` and `scroll-progress.ts` all coalesce into the read\n * phase. The other services — resize, pointer, key, mutation, in-view — emit\n * straight from their listener or observer, in no phase at all, so their hooks\n * are not read-phase contexts and are deliberately absent.\n */\nconst READ_PHASE_HOOKS = new Set(['ticked', 'scrolled', 'scrolledInView']);\n\n/** Services whose `subscribe()` callback runs in the read phase. */\nconst READ_PHASE_SERVICES = new Set([\n 'useRaf',\n 'useScroll',\n 'useWindowScroll',\n 'useScrollProgress',\n]);\n\n/** A method carrying either of these already names its own phase. */\nconst PHASE_DECORATORS = new Set(['read', 'write']);\n\n/** Properties whose assignment mutates the DOM. */\nconst WRITE_PROPERTIES = new Set([\n 'textContent',\n 'innerHTML',\n 'className',\n 'scrollTop',\n 'scrollLeft',\n 'value',\n]);\n\n/** Methods which mutate the DOM. */\nconst WRITE_METHODS = new Set([\n 'setProperty',\n 'setAttribute',\n 'removeAttribute',\n 'toggleAttribute',\n 'append',\n 'prepend',\n 'remove',\n 'replaceChildren',\n 'insertAdjacentHTML',\n 'scrollTo',\n 'scrollIntoView',\n 'animate',\n]);\n\n/** Globals a component may reach the DOM through. */\nconst DOM_GLOBALS = new Set(['document', 'window']);\n\ntype MemberPath = { base: Node | null; path: (string | null)[] };\n\n/**\n * Splits a member expression into the expression it starts from and the chain\n * of property names read off it. A computed property contributes `null`.\n */\nfunction memberPath(node: Node): MemberPath {\n const path: (string | null)[] = [];\n let current = node;\n\n while (current?.type === 'MemberExpression') {\n path.unshift(current.computed ? null : (current.property?.name ?? null));\n current = current.object;\n }\n\n return { base: current ?? null, path };\n}\n\n/**\n * Returns true if an expression reaches the DOM from one of the roots a v4\n * component owns: `this.$el`, `this.$refs.*`, `document`, `window`, or a local\n * initialised from one of those.\n *\n * Anchoring the receiver is what makes a type-free rule accurate enough to\n * turn on: without it, every `foo.value = 1` in the file would be a candidate.\n */\nfunction isAnchored(node: Node, aliases: Set<string>): boolean {\n if (!node) return false;\n\n // `this.$el.querySelector('.x')` is anchored through its callee.\n if (node.type === 'CallExpression') {\n return isAnchored(node.callee, aliases);\n }\n\n const { base, path } = memberPath(node);\n\n if (!base) return false;\n\n if (base.type === 'ThisExpression') {\n return path[0] === '$el' || path[0] === '$refs';\n }\n\n if (base.type === 'Identifier') {\n return DOM_GLOBALS.has(base.name) || aliases.has(base.name);\n }\n\n return false;\n}\n\n/**\n * Names the DOM write an assignment performs, or null if it is not one.\n */\nfunction assignmentWrite(node: Node, aliases: Set<string>): string | null {\n const left = node.left;\n if (left?.type !== 'MemberExpression') return null;\n if (!isAnchored(left, aliases)) return null;\n\n const { path } = memberPath(left);\n const last = path[path.length - 1];\n\n if (path.includes('style')) return 'style';\n if (typeof last === 'string' && WRITE_PROPERTIES.has(last)) return last;\n\n return null;\n}\n\n/**\n * Names the DOM write a call performs, or null if it is not one.\n */\nfunction callWrite(node: Node, aliases: Set<string>): string | null {\n const callee = node.callee;\n if (callee?.type !== 'MemberExpression') return null;\n if (!isAnchored(callee, aliases)) return null;\n\n const { path } = memberPath(callee);\n const last = path[path.length - 1];\n\n if (path.includes('classList')) return 'classList';\n if (typeof last === 'string' && WRITE_METHODS.has(last)) return `${last}()`;\n\n return null;\n}\n\n/**\n * Collects, in one pass over the file, the names a member path may be anchored\n * to and the names holding a `smoothTo()` value.\n *\n * A pre-pass rather than incremental collection, so that a field declared after\n * the method using it is still resolved.\n */\nfunction collectNames(program: Node): { aliases: Set<string>; smooth: Set<string> } {\n const aliases = new Set<string>();\n const smooth = new Set<string>();\n const candidates: { name: string; init: Node }[] = [];\n\n walk(program, (node) => {\n let name: string | null = null;\n let init: Node | null = null;\n\n if (node.type === 'VariableDeclarator' && node.id?.type === 'Identifier') {\n name = node.id.name;\n init = node.init;\n } else if (node.type === 'PropertyDefinition') {\n name = getKeyName(node);\n init = node.value;\n }\n\n if (!name || !init) return;\n\n if (init.type === 'CallExpression' && init.callee?.type === 'Identifier') {\n if (init.callee.name === 'smoothTo') smooth.add(name);\n }\n\n candidates.push({ name, init });\n });\n\n // An alias may be initialised from another alias, so settle to a fixpoint.\n let changed = true;\n while (changed) {\n changed = false;\n for (const { name, init } of candidates) {\n if (aliases.has(name)) continue;\n if (isAnchored(init, aliases)) {\n aliases.add(name);\n changed = true;\n }\n }\n }\n\n return { aliases, smooth };\n}\n\n/**\n * Returns true if `object` is something whose `subscribe()` callback runs in\n * the read phase.\n */\nfunction isReadPhaseSubscribable(object: Node, smooth: Set<string>): boolean {\n if (!object) return false;\n\n if (object.type === 'CallExpression' && object.callee?.type === 'Identifier') {\n return READ_PHASE_SERVICES.has(object.callee.name);\n }\n\n if (\n object.type === 'MemberExpression' &&\n object.object?.type === 'ThisExpression' &&\n !object.computed\n ) {\n return smooth.has(object.property?.name);\n }\n\n if (object.type === 'Identifier') {\n return smooth.has(object.name);\n }\n\n return false;\n}\n\n/** Returns true for `this.$read(fn)` and `defaultScheduler.read(fn)`. */\nfunction isReadScheduling(callee: Node): boolean {\n const name = callee?.property?.name;\n\n if (name === '$read' && callee.object?.type === 'ThisExpression') return true;\n\n return (\n name === 'read' &&\n callee.object?.type === 'Identifier' &&\n callee.object.name === 'defaultScheduler'\n );\n}\n\nexport const noWriteInReadPhase = createRule({\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Disallow DOM writes in a read-phase callback — return a render function instead',\n },\n messages: {\n writeInReadPhase:\n 'This writes the DOM ({{write}}) in the read phase, which forces layout for every component measuring in the same frame. Return a render function, or move the write into this.$write().',\n writeInHelper:\n 'This writes the DOM ({{write}}) in the read phase, through {{helper}}(). Return a render function, or mark {{helper}}() with @write.',\n },\n },\n createOnce(context: RuleContext) {\n let aliases = new Set<string>();\n let smooth = new Set<string>();\n\n /** One frame per function scope. Nesting resets the armed flag by design. */\n const scopes: boolean[] = [];\n const classes: Node[] = [];\n const reported = new Set<Node>();\n\n const isArmed = (): boolean => scopes[scopes.length - 1] === true;\n\n /**\n * Decides whether entering this function enters a read-phase context.\n */\n function isReadPhaseEntry(node: Node): boolean {\n const ancestors = getAncestors(node, context);\n const parent = ancestors[ancestors.length - 1];\n\n if (!parent) return false;\n\n // A frame hook of a component class.\n if (parent.type === 'MethodDefinition' && parent.value === node) {\n const name = getKeyName(parent);\n if (!name || !READ_PHASE_HOOKS.has(name)) return false;\n const enclosing = findEnclosingClass(ancestors);\n return Boolean(enclosing && isComponentClass(enclosing));\n }\n\n if (parent.type !== 'CallExpression') return false;\n\n const callee = parent.callee;\n if (callee?.type !== 'MemberExpression') return false;\n\n if (isReadScheduling(callee) && parent.arguments?.includes(node)) {\n return true;\n }\n\n if (callee.property?.name === 'subscribe' && parent.arguments?.[0] === node) {\n return isReadPhaseSubscribable(callee.object, smooth);\n }\n\n return false;\n }\n\n /**\n * Resolves `this.<name>(…)` one level and reports the writes of that method.\n *\n * One level only, and never through a method naming its own phase with\n * `@read` or `@write` — which is how `Cursor`'s `@write render()` stays\n * correct while still being called from a frame subscriber.\n */\n function descend(node: Node): void {\n const callee = node.callee;\n if (callee?.type !== 'MemberExpression') return;\n if (callee.computed || callee.object?.type !== 'ThisExpression') return;\n\n const name = callee.property?.name;\n if (typeof name !== 'string' || name.startsWith('$')) return;\n\n const enclosing = classes[classes.length - 1];\n if (!enclosing) return;\n\n const method = (enclosing.body?.body ?? []).find(\n (member: Node) =>\n member.type === 'MethodDefinition' &&\n member.kind === 'method' &&\n getKeyName(member) === name,\n );\n\n if (!method || hasDecorator(method, PHASE_DECORATORS)) return;\n\n walk(method.value?.body, (inner: Node) => {\n // The armed flag clears at a nested function, here as everywhere.\n if (isFunctionNode(inner)) return false;\n\n const write =\n inner.type === 'AssignmentExpression'\n ? assignmentWrite(inner, aliases)\n : inner.type === 'CallExpression'\n ? callWrite(inner, aliases)\n : null;\n\n if (write && !reported.has(inner)) {\n reported.add(inner);\n context.report({\n node: inner,\n messageId: 'writeInHelper',\n data: { write, helper: name },\n });\n }\n });\n }\n\n function report(node: Node, write: string): void {\n if (reported.has(node)) return;\n reported.add(node);\n context.report({ node, messageId: 'writeInReadPhase', data: { write } });\n }\n\n return {\n // `createOnce` runs once for the whole run, so every piece of per-file\n // state is rebuilt here rather than carried between files.\n Program(node: Node) {\n const collected = collectNames(node);\n aliases = collected.aliases;\n smooth = collected.smooth;\n scopes.length = 0;\n classes.length = 0;\n reported.clear();\n },\n\n ClassDeclaration(node: Node) {\n classes.push(node);\n },\n 'ClassDeclaration:exit'() {\n classes.pop();\n },\n ClassExpression(node: Node) {\n classes.push(node);\n },\n 'ClassExpression:exit'() {\n classes.pop();\n },\n\n FunctionDeclaration(node: Node) {\n scopes.push(isReadPhaseEntry(node));\n },\n 'FunctionDeclaration:exit'() {\n scopes.pop();\n },\n FunctionExpression(node: Node) {\n scopes.push(isReadPhaseEntry(node));\n },\n 'FunctionExpression:exit'() {\n scopes.pop();\n },\n ArrowFunctionExpression(node: Node) {\n scopes.push(isReadPhaseEntry(node));\n },\n 'ArrowFunctionExpression:exit'() {\n scopes.pop();\n },\n\n AssignmentExpression(node: Node) {\n if (!isArmed()) return;\n const write = assignmentWrite(node, aliases);\n if (write) report(node, write);\n },\n\n CallExpression(node: Node) {\n if (!isArmed()) return;\n\n const write = callWrite(node, aliases);\n if (write) {\n report(node, write);\n return;\n }\n\n descend(node);\n },\n };\n },\n});\n","import {\n createRule,\n findEnclosingClass,\n getAncestors,\n isComponentClass,\n type Node,\n type RuleContext,\n} from '../utils/ast.ts';\n\n/**\n * Returns true if an expression is `this.$options`, or a path reaching into it.\n */\nfunction isOptionsPath(node: Node): boolean {\n let current = node;\n\n while (current?.type === 'MemberExpression') {\n if (\n current.object?.type === 'ThisExpression' &&\n !current.computed &&\n current.property?.name === '$options'\n ) {\n return true;\n }\n current = current.object;\n }\n\n return false;\n}\n\nexport const noOptionsAssignment = createRule({\n meta: {\n type: 'problem',\n docs: {\n description: 'Disallow writing to this.$options — it is a read-only view of the attributes',\n },\n messages: {\n assignment:\n '`$options` is a read-only view of the element attributes: every property is a getter with no setter, so this throws at runtime. Write the attribute instead, with setAttribute().',\n viewAssignment:\n '`$options` is defined non-writable, so replacing the view throws at runtime — and everything else in the framework would go on reading the original. Write the attributes instead, with setAttribute().',\n objectAssign:\n 'Object.assign() onto `$options` writes properties which are getters with no setter, so this throws at runtime. Write the attributes instead, with setAttribute().',\n },\n },\n createOnce(context: RuleContext) {\n function inComponent(node: Node): boolean {\n const enclosing = findEnclosingClass(getAncestors(node, context));\n return Boolean(enclosing && isComponentClass(enclosing));\n }\n\n return {\n AssignmentExpression(node: Node) {\n const left = node.left;\n if (left?.type !== 'MemberExpression') return;\n if (!isOptionsPath(left)) return;\n if (!inComponent(node)) return;\n\n // `this.$options` is defined non-writable, so replacing the view\n // throws just as writing through it does — a different sentence.\n const isWholeView =\n left.object?.type === 'ThisExpression' && left.property?.name === '$options';\n\n context.report({ node, messageId: isWholeView ? 'viewAssignment' : 'assignment' });\n },\n\n CallExpression(node: Node) {\n const callee = node.callee;\n if (callee?.type !== 'MemberExpression') return;\n if (callee.object?.type !== 'Identifier' || callee.object.name !== 'Object') return;\n if (callee.property?.name !== 'assign') return;\n\n const target = node.arguments?.[0];\n if (!target || target.type !== 'MemberExpression') return;\n if (!isOptionsPath(target)) return;\n if (!inComponent(node)) return;\n\n context.report({ node, messageId: 'objectAssign' });\n },\n };\n },\n});\n","import {\n createRule,\n findEnclosingClass,\n getAncestors,\n isComponentClass,\n type Node,\n type RuleContext,\n} from '../utils/ast.ts';\n\n/** The phases a component owns an instance-scoped equivalent of. */\nconst PHASES = new Map([\n ['read', '$read'],\n ['write', '$write'],\n]);\n\nexport const preferInstanceScheduler = createRule({\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Prefer this.$read()/this.$write() over defaultScheduler inside a component',\n },\n messages: {\n preferInstance:\n 'Use `this.{{instance}}()` rather than `defaultScheduler.{{phase}}()` inside a component. The instance form ties the task to this component, so destroying it cancels the task instead of running it against a detached element.',\n },\n },\n createOnce(context: RuleContext) {\n return {\n CallExpression(node: Node) {\n const callee = node.callee;\n if (callee?.type !== 'MemberExpression' || callee.computed) return;\n if (callee.object?.type !== 'Identifier' || callee.object.name !== 'defaultScheduler') {\n return;\n }\n\n const phase = callee.property?.name;\n const instance = PHASES.get(phase);\n if (!instance) return;\n\n const enclosing = findEnclosingClass(getAncestors(node, context));\n if (!enclosing || !isComponentClass(enclosing)) return;\n\n context.report({ node, messageId: 'preferInstance', data: { phase, instance } });\n },\n };\n },\n});\n","import {\n createRule,\n findComponentConfig,\n getKeyName,\n getProperty,\n type Node,\n type RuleContext,\n} from '../utils/ast.ts';\n\nexport const optionDefaultFactory = createRule({\n meta: {\n type: 'problem',\n docs: {\n description: 'Require a factory for an option default which is an object or an array',\n },\n messages: {\n literalDefault:\n 'Option \"{{name}}\" declares a literal {{kind}} default, which every instance of this component then shares — one instance mutating it mutates it for all of them. Declare it as a factory: `default: () => ({{example}})`.',\n },\n },\n createOnce(context: RuleContext) {\n function check(node: Node) {\n const options = getProperty(findComponentConfig(node), 'options');\n if (options?.type !== 'ObjectExpression') return;\n\n for (const property of options.properties ?? []) {\n if (property.type !== 'Property') continue;\n\n const name = getKeyName(property);\n if (!name || property.value?.type !== 'ObjectExpression') continue;\n\n const fallback = getProperty(property.value, 'default');\n if (!fallback) continue;\n\n if (fallback.type === 'ObjectExpression') {\n context.report({\n node: fallback,\n messageId: 'literalDefault',\n data: { name, kind: 'object', example: '{}' },\n });\n } else if (fallback.type === 'ArrayExpression') {\n context.report({\n node: fallback,\n messageId: 'literalDefault',\n data: { name, kind: 'array', example: '[]' },\n });\n }\n }\n }\n\n return {\n ClassDeclaration: check,\n ClassExpression: check,\n };\n },\n});\n","import {\n createRule,\n findComponentConfig,\n getKeyName,\n getProperty,\n toPascalCase,\n type Node,\n type RuleContext,\n} from '../utils/ast.ts';\n\n/**\n * Returns true if an option declaration can hold a boolean, in any of the\n * spellings v4 accepts: the shorthand `Boolean`, a union `[Boolean, String]`,\n * or the long form `{ type: Boolean }`.\n */\nfunction isBooleanOption(value: Node): boolean {\n if (!value) return false;\n\n if (value.type === 'Identifier') return value.name === 'Boolean';\n\n if (value.type === 'ArrayExpression') {\n return (value.elements ?? []).some(\n (element: Node) => element?.type === 'Identifier' && element.name === 'Boolean',\n );\n }\n\n if (value.type === 'ObjectExpression') {\n return isBooleanOption(getProperty(value, 'type'));\n }\n\n return false;\n}\n\nexport const noConflictingNegatedOption = createRule({\n meta: {\n type: 'problem',\n docs: {\n description: 'Disallow declaring both a boolean option and its negated spelling',\n },\n messages: {\n conflict:\n 'Option \"{{negated}}\" claims `data-option-no-{{attribute}}`, which is also how the boolean option \"{{name}}\" is turned off. One attribute would mean two things. Rename one of them.',\n },\n },\n createOnce(context: RuleContext) {\n function check(node: Node) {\n const options = getProperty(findComponentConfig(node), 'options');\n if (options?.type !== 'ObjectExpression') return;\n\n const declared = new Map<string, Node>();\n\n for (const property of options.properties ?? []) {\n if (property.type !== 'Property') continue;\n const name = getKeyName(property);\n if (name) declared.set(name, property);\n }\n\n for (const [name, property] of declared) {\n if (!isBooleanOption(property.value)) continue;\n\n const negated = `no${toPascalCase(name)}`;\n const conflicting = declared.get(negated);\n if (!conflicting) continue;\n\n context.report({\n node: conflicting.key ?? conflicting,\n messageId: 'conflict',\n data: {\n name,\n negated,\n attribute: name.replaceAll(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase(),\n },\n });\n }\n }\n\n return {\n ClassDeclaration: check,\n ClassExpression: check,\n };\n },\n});\n","import {\n createRule,\n findEnclosingClass,\n getAncestors,\n getKeyName,\n isComponentClass,\n type Node,\n type RuleContext,\n} from '../utils/ast.ts';\n\n/**\n * v4 renamed `$destroy()` to `$unmount()` and `destroyed()` to `unmounted()`.\n *\n * There is no destroyed state in v4: `#isMounted` is one boolean with two\n * values, and the method documented itself as \"the reversible inverse of\n * `$mount()`\". `$mount()`/`$unmount()` and `mounted()`/`unmounted()` are\n * symmetric pairs where `$mount()`/`$destroy()` was not, which is the same\n * rename Vue 3 made to `beforeDestroy`/`destroyed`.\n *\n * ## Why this is its own rule and not an entry in `no-deprecated-properties`\n *\n * Three reasons, and the first is the one that decides it.\n *\n * **`no-deprecated-properties` only flags a member expression whose object is\n * `this`.** That guard is deliberate — `$parent` and `$root` are ordinary\n * enough words that flagging `someLibrary.$parent` would be noise. But most\n * `$destroy()` calls are `instance.$destroy()`: from a registry, from a test,\n * from application code holding an instance. Folding the rename in would\n * therefore miss the common case, and lifting the guard for one entry would\n * lift it for every entry, which is exactly the false positive that guard\n * exists to prevent.\n *\n * **`no-deprecated-properties` is not fixable, and should not become so.**\n * `$parent` → `$closest()` and `$children` → `$watchChildren()` are not safe\n * textual rewrites; they change the shape of the call and often the logic\n * around it. A rename is the one case where a fixer is exactly right, and a\n * rule that is fixable for one of its eleven reports is worse than two rules.\n *\n * **The two rules say different things.** `no-deprecated-properties` reports\n * v3 names that v4 dropped. `$destroy` was never a v3-only name: it is v4's\n * own, renamed while v4 is unreleased. This rule's whole lifetime is that\n * rename window, and it is meant to be deleted, not grown.\n *\n * ## What is flagged, and what is not\n *\n * The two halves are deliberately asymmetric, because the two names are.\n *\n * `$destroy` is flagged on **any** receiver — `this.$destroy()`,\n * `instance.$destroy()`, `super.$destroy()` — and on a `$destroy()` method\n * definition, which is the shape a service mixin overriding the framework's\n * teardown writes. The `$` prefix is the toolkit's own namespace, and the rule\n * ships in `configs.v4` only, which a project turns on when it is on v4. That\n * opt-in is the guard against rewriting an unrelated library's API.\n *\n * `destroyed` has no such prefix — `emitter.destroyed`, `record.destroyed`\n * and a `destroyed` boolean are all ordinary code — so that half is narrowed\n * to the two places where it can only mean the hook: a non-static\n * `destroyed()` method definition in a class that reads as a v4 component,\n * and a `super.destroyed()` call inside one. A plain `foo.destroyed()` call is\n * left alone.\n *\n * Computed access (`instance['$destroy']()`) is not flagged. It is rare, and a\n * fixer would have to guess the quote style of a string it did not write.\n */\nexport const noDestroyLifecycle = createRule({\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description:\n 'Require the v4 names `$unmount()` and `unmounted()` over `$destroy()` and `destroyed()`',\n },\n messages: {\n renamedMethod: '`$destroy()` is named `$unmount()` in v4.',\n renamedHook: 'The `destroyed()` hook is named `unmounted()` in v4.',\n },\n },\n createOnce(context: RuleContext) {\n function inComponent(node: Node): boolean {\n const enclosing = findEnclosingClass(getAncestors(node, context));\n return Boolean(enclosing) && isComponentClass(enclosing as Node);\n }\n\n function rename(target: Node, messageId: string, to: string) {\n context.report({\n node: target,\n messageId,\n fix: (fixer: any) => fixer.replaceText(target, to),\n });\n }\n\n return {\n MemberExpression(node: Node) {\n if (node.computed) return;\n\n const name = node.property?.name;\n\n if (name === '$destroy') {\n rename(node.property, 'renamedMethod', '$unmount');\n return;\n }\n\n // `super.destroyed()` chains the hook of a mixin or an abstract\n // component, so the receiver settles what a bare name cannot.\n if (name === 'destroyed' && node.object?.type === 'Super' && inComponent(node)) {\n rename(node.property, 'renamedHook', 'unmounted');\n }\n },\n\n MethodDefinition(node: Node) {\n if (node.computed || !node.key) return;\n\n const name = getKeyName(node);\n\n // A mixin overrides the framework's own teardown, which is why this is\n // not restricted to a class that reads as a component.\n if (name === '$destroy') {\n rename(node.key, 'renamedMethod', '$unmount');\n return;\n }\n\n if (name !== 'destroyed' || node.static === true) return;\n if (!inComponent(node)) return;\n\n rename(node.key, 'renamedHook', 'unmounted');\n },\n };\n },\n});\n","import { eslintCompatPlugin } from '@oxlint/plugins';\nimport {\n requireConfig,\n requireConfigNamePascalCase,\n refsCamelCase,\n optionsCamelCase,\n asyncLifecycleMethods,\n onHandlerNaming,\n onGlobalHandlerPrefix,\n noDeprecatedProperties,\n noDispatchEvent,\n noShadowDom,\n noCreateApp,\n noEventListenerMethods,\n refsPluralMultiple,\n noDeepUtilsImport,\n noInternalBarrelImport,\n refsNoBracketAccess,\n noRedundantWithMountWhenInView,\n preferRefOverQuerySelector,\n requireRefsDeclaredInConfig,\n noManualIntersectionObserver,\n noManualMutationObserver,\n emitsKebabCase,\n emitsMultiWord,\n componentsPascalCase,\n requireEmitDeclaredInConfig,\n requireChildrenDeclaredInConfig,\n requireOptionsDeclaredInConfig,\n preferDestructuredLookups,\n noDollarPrefix,\n requireDestroyedCleanup,\n noWriteInReadPhase,\n noOptionsAssignment,\n preferInstanceScheduler,\n optionDefaultFactory,\n noConflictingNegatedOption,\n noDestroyLifecycle,\n} from './rules/index.ts';\n\nconst PLUGIN_NAME = 'js-toolkit';\n\nconst rules = {\n 'require-config': requireConfig,\n 'require-config-name-pascal-case': requireConfigNamePascalCase,\n 'refs-camel-case': refsCamelCase,\n 'refs-plural-multiple': refsPluralMultiple,\n 'options-camel-case': optionsCamelCase,\n 'async-lifecycle-methods': asyncLifecycleMethods,\n 'on-handler-naming': onHandlerNaming,\n 'on-global-handler-prefix': onGlobalHandlerPrefix,\n 'no-deprecated-properties': noDeprecatedProperties,\n 'no-dispatch-event': noDispatchEvent,\n 'no-shadow-dom': noShadowDom,\n 'no-create-app': noCreateApp,\n 'no-event-listener-methods': noEventListenerMethods,\n 'no-deep-utils-import': noDeepUtilsImport,\n 'no-internal-barrel-import': noInternalBarrelImport,\n 'refs-no-bracket-access': refsNoBracketAccess,\n 'no-redundant-with-mount-when-in-view': noRedundantWithMountWhenInView,\n 'prefer-ref-over-query-selector': preferRefOverQuerySelector,\n 'require-refs-declared-in-config': requireRefsDeclaredInConfig,\n 'no-manual-intersection-observer': noManualIntersectionObserver,\n 'no-manual-mutation-observer': noManualMutationObserver,\n 'emits-kebab-case': emitsKebabCase,\n 'emits-multi-word': emitsMultiWord,\n 'components-pascal-case': componentsPascalCase,\n 'require-emit-declared-in-config': requireEmitDeclaredInConfig,\n 'require-children-declared-in-config': requireChildrenDeclaredInConfig,\n 'require-options-declared-in-config': requireOptionsDeclaredInConfig,\n 'prefer-destructured-lookups': preferDestructuredLookups,\n 'no-dollar-prefix': noDollarPrefix,\n 'require-destroyed-cleanup': requireDestroyedCleanup,\n 'no-write-in-read-phase': noWriteInReadPhase,\n 'no-options-assignment': noOptionsAssignment,\n 'prefer-instance-scheduler': preferInstanceScheduler,\n 'option-default-factory': optionDefaultFactory,\n 'no-conflicting-negated-option': noConflictingNegatedOption,\n 'no-destroy-lifecycle': noDestroyLifecycle,\n};\n\nconst recommendedRules: Record<string, string> = {\n [`${PLUGIN_NAME}/require-config`]: 'error',\n [`${PLUGIN_NAME}/require-config-name-pascal-case`]: 'error',\n [`${PLUGIN_NAME}/refs-camel-case`]: 'error',\n [`${PLUGIN_NAME}/refs-plural-multiple`]: 'error',\n [`${PLUGIN_NAME}/options-camel-case`]: 'error',\n [`${PLUGIN_NAME}/async-lifecycle-methods`]: 'error',\n [`${PLUGIN_NAME}/on-handler-naming`]: 'error',\n [`${PLUGIN_NAME}/on-global-handler-prefix`]: 'warn',\n [`${PLUGIN_NAME}/no-deprecated-properties`]: 'warn',\n [`${PLUGIN_NAME}/no-dispatch-event`]: 'warn',\n [`${PLUGIN_NAME}/no-shadow-dom`]: 'error',\n [`${PLUGIN_NAME}/no-create-app`]: 'warn',\n [`${PLUGIN_NAME}/no-event-listener-methods`]: 'error',\n [`${PLUGIN_NAME}/no-deep-utils-import`]: 'error',\n [`${PLUGIN_NAME}/refs-no-bracket-access`]: 'error',\n [`${PLUGIN_NAME}/no-redundant-with-mount-when-in-view`]: 'warn',\n [`${PLUGIN_NAME}/prefer-ref-over-query-selector`]: 'warn',\n [`${PLUGIN_NAME}/require-refs-declared-in-config`]: 'error',\n [`${PLUGIN_NAME}/no-manual-intersection-observer`]: 'warn',\n [`${PLUGIN_NAME}/no-manual-mutation-observer`]: 'warn',\n [`${PLUGIN_NAME}/emits-kebab-case`]: 'error',\n [`${PLUGIN_NAME}/emits-multi-word`]: 'error',\n [`${PLUGIN_NAME}/components-pascal-case`]: 'error',\n [`${PLUGIN_NAME}/require-emit-declared-in-config`]: 'error',\n [`${PLUGIN_NAME}/require-children-declared-in-config`]: 'error',\n [`${PLUGIN_NAME}/require-options-declared-in-config`]: 'error',\n [`${PLUGIN_NAME}/prefer-destructured-lookups`]: 'warn',\n [`${PLUGIN_NAME}/no-dollar-prefix`]: 'error',\n [`${PLUGIN_NAME}/require-destroyed-cleanup`]: 'warn',\n};\n\n/**\n * v4 rules.\n *\n * v4 is not v3 with a bigger version number, so this is a separate set rather\n * than an extension of `recommended`. Rules policing something v4 removed —\n * `config.emits`, `$children`, the v3 decorator names — are absent, and\n * `async-lifecycle-methods` is absent because a v4 frame hook returns the\n * function which writes rather than a promise.\n */\nconst v4Rules: Record<string, unknown> = {\n [`${PLUGIN_NAME}/no-write-in-read-phase`]: 'error',\n [`${PLUGIN_NAME}/no-options-assignment`]: 'error',\n [`${PLUGIN_NAME}/prefer-instance-scheduler`]: 'warn',\n [`${PLUGIN_NAME}/option-default-factory`]: 'error',\n [`${PLUGIN_NAME}/no-conflicting-negated-option`]: 'error',\n [`${PLUGIN_NAME}/no-destroy-lifecycle`]: 'error',\n [`${PLUGIN_NAME}/no-deprecated-properties`]: ['error', { version: 'v4' }],\n [`${PLUGIN_NAME}/no-dispatch-event`]: 'warn',\n [`${PLUGIN_NAME}/no-shadow-dom`]: 'error',\n [`${PLUGIN_NAME}/no-event-listener-methods`]: 'error',\n [`${PLUGIN_NAME}/no-manual-mutation-observer`]: 'warn',\n [`${PLUGIN_NAME}/refs-no-bracket-access`]: 'error',\n [`${PLUGIN_NAME}/prefer-ref-over-query-selector`]: 'warn',\n};\n\nconst base = eslintCompatPlugin({\n meta: {\n name: '@studiometa/eslint-plugin-js-toolkit',\n },\n rules,\n});\n\nconst plugin = Object.assign(base, { configs: {} as Record<string, object> });\n\nplugin.configs['recommended'] = {\n plugins: { [PLUGIN_NAME]: plugin },\n rules: recommendedRules,\n};\n\nplugin.configs['v4'] = {\n plugins: { [PLUGIN_NAME]: plugin },\n rules: v4Rules,\n};\n\nexport { plugin as jsToolkit };\nexport default plugin;\n"],"mappings":";;AAiBA,SAAgB,WAA8D,MAGjB;CAC3D,OAAO;AACT;AAEA,MAAa,oCAAoB,IAAI,IAAI;CACvC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;;;AAUD,SAAgB,eAAe,MAAY,SAA+B;CACxE,IAAI,KAAK,SAAS,sBAAsB,KAAK,SAAS,mBACpD,OAAO;CAGT,IAAI,CAAC,KAAK,YACR,OAAO;CAGT,MAAM,YAAY,KAAK,WAAW,SAAS,eAAe,KAAK,WAAW,OAAO;CAEjF,IAAI,CAAC,WACH,OAAO;CAIT,IAAI,cAAc,QAChB,OAAO;CAKT,MAAM,OADa,QAAQ,cAAc,QAAQ,gBAAgB,EAAA,EACzC;CAExB,IAAI,CAAC,KACH,OAAO;CAGT,KAAK,MAAM,QAAQ,IAAI,MAAM;EAC3B,IAAI,KAAK,SAAS,qBAAqB;EACvC,IAAI,KAAK,OAAO,UAAA,0BAA2B;EAE3C,KAAK,MAAM,aAAa,KAAK,YAC3B,IAAI,UAAU,SAAS,qBAAqB,UAAU,MAAM,SAAS,WACnE,OAAO;CAGb;CAEA,OAAO;AACT;;;;AAKA,SAAgB,YAAY,OAAwB;CAClD,OAAO,sBAAsB,KAAK,KAAK;AACzC;;;;AAKA,SAAgB,aAAa,OAAwB;CACnD,OAAO,sBAAsB,KAAK,K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