Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions crates/oxc_linter/src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use crate::{
config::GlobalValue,
disable_directives::DisableDirectives,
fixer::{Fix, FixKind, Message, PossibleFixes, RuleFix, RuleFixer},
frameworks::FrameworkOptions,
};

mod host;
Expand Down Expand Up @@ -443,6 +444,12 @@ impl<'a> LintContext<'a> {
self.parent.frameworks
}

/// Returns the framework options for the current script block.
/// For Vue files, this can be `FrameworkOptions::VueSetup` if we're in a `<script setup>` block.
pub fn frameworks_options(&self) -> FrameworkOptions {
self.parent.frameworks_options()
}

pub fn other_file_hosts(&self) -> Vec<&ContextSubHost<'a>> {
self.parent.other_file_hosts()
}
Expand Down
4 changes: 4 additions & 0 deletions crates/oxc_linter/src/generated/rule_runner_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2689,6 +2689,10 @@ impl RuleRunner for crate::rules::vue::no_multiple_slot_args::NoMultipleSlotArgs
Some(&AstTypesBitset::from_types(&[AstType::CallExpression]));
}

impl RuleRunner for crate::rules::vue::no_required_prop_with_default::NoRequiredPropWithDefault {
const NODE_TYPES: Option<&AstTypesBitset> = None;
}

impl RuleRunner for crate::rules::vue::require_typed_ref::RequireTypedRef {
const NODE_TYPES: Option<&AstTypesBitset> = None;
}
Expand Down
2 changes: 2 additions & 0 deletions crates/oxc_linter/src/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ pub(crate) mod vue {
pub mod define_emits_declaration;
pub mod define_props_declaration;
pub mod no_multiple_slot_args;
pub mod no_required_prop_with_default;
pub mod require_typed_ref;
pub mod valid_define_emits;
pub mod valid_define_props;
Expand Down Expand Up @@ -1218,6 +1219,7 @@ oxc_macros::declare_all_lint_rules! {
vue::define_emits_declaration,
vue::define_props_declaration,
vue::no_multiple_slot_args,
vue::no_required_prop_with_default,
vue::require_typed_ref,
vue::valid_define_emits,
vue::valid_define_props,
Expand Down
Loading
Loading