UNPKG

eslint-plugin-sonarjs

Version:
15 lines (14 loc) • 1.07 kB
import type { Rule } from 'eslint'; import type estree from 'estree'; export type VueReactiveBindingKind = 'ref' | 'reactive'; export declare function isInsideVueSetupScript(node: estree.Node, ctx: Rule.RuleContext): boolean; /** Returns true when no Vue dependency is declared, or a declared parseable range provably excludes Vue 3+; an unparseable range (workspace:, catalog:, git:) keeps reporting, unlike a missing dependency. */ export declare function isVue2OrEarlier(context: Rule.RuleContext): boolean; /** * Resolves `identifier` to the variable it references and, if that variable is initialized by a * call to `ref()` or `reactive()` imported from 'vue', returns which one. Used to recognize * mutations of tracked reactive state without requiring the enclosing code to be independently * proven to be a Vue component: an import-resolved `ref`/`reactive` binding is itself a strong * enough Vue signal. */ export declare function getVueReactiveBindingKind(context: Rule.RuleContext, identifier: estree.Identifier): VueReactiveBindingKind | undefined;