更新日志
Version 2.2.6 Latest
Patch Changes
-
#7071
a8e7301
Thanks @ptkagori! - Added theuseQwikMethodUsage
lint rule for the Qwik domain.This rule validates Qwik hook usage. Identifiers matching
useXxx
must be called only within serialisable reactive contexts (for example, insidecomponent$
, route loaders/actions, or within other Qwik hooks), preventing common Qwik antipatterns.Invalid:
// Top-level hook call is invalid.const state = useStore({ count: 0 });function helper() {// Calling a hook in a non-reactive function is invalid.const loc = useLocation();}Valid:
component$(() => {const state = useStore({ count: 0 }); // OK inside component$.return <div>{state.count}</div>;});const handler = $(() => {const loc = useLocation(); // OK inside a $-wrapped closure.console.log(loc.params);}); -
#7685
52071f5
Thanks @denbezrukov! - Fixed #6981: The NoUnknownPseudoClass rule no longer reports local pseudo-classes when CSS Modules are used. -
#7640
899f7b2
Thanks @arendjr! - Fixed #7638:useImportExtensions
no longer emits diagnostics on valid import paths that end with a query or hash.Example
// This no longer warns if `index.css` exists:import style from "../theme/index.css?inline"; -
#7071
a8e7301
Thanks @ptkagori! - Added theuseQwikValidLexicalScope
rule to the Qwik domain.This rule helps you avoid common bugs in Qwik components by checking that your variables and functions are declared in the correct place.
Invalid:
// Invalid: state defined outside the component's lexical scope.let state = useStore({ count: 0 });const Component = component$(() => {return (<button onClick$={() => state.count++}>Invalid: {state.count}</button>);});Valid:
// Valid: state initialised within the component's lexical scope and captured by the event.const Component = component$(() => {const state = useStore({ count: 0 });return <button onClick$={() => state.count++}>Valid: {state.count}</button>;}); -
#7620
5beb1ee
Thanks @Netail! - Added the ruleuseDeprecatedDate
, which makes a deprecation date required for the graphql@deprecated
directive.Invalid
query {member @deprecated(reason: "Use `members` instead") {id}}Valid
query {member@deprecated(reason: "Use `members` instead", deletionDate: "2099-12-25") {id}} -
#7709
d6da4d5
Thanks @siketyan! - Fixed #7704: TheuseExhaustiveDependencies
rule now correctly adds an object dependency when its method is called within the closure.For example:
function Component(props) {useEffect(() => {props.foo();}, []);}will now be fixed to:
function Component(props) {useEffect(() => {props.foo();}, [props]);} -
#7624
309ae41
Thanks @lucasweng! - Fixed #7595:noUselessEscapeInString
no longer reports$\{
escape in template literals. -
#7665
29e4229
Thanks @ryan-m-walker! - Fixed #7619: Added support for parsing the CSS:state()
pseudo-class.custom-selector:state(checked) {} -
#7608
41df59b
Thanks @ritoban23! - Fixed #7604: theuseMaxParams
rule now highlights parameter lists instead of entire function bodies. This provides more precise error highlighting. Previously, the entire function was highlighted; now only the parameter list is highlighted, such as(a, b, c, d, e, f, g, h)
. -
#7643
459a6ac
Thanks @daivinhtran! - Fixed #7580: Include plugin in summary report
Copyright (c) 2023-present Biome Developers and Contributors.