From 60041bc95683c5cdaee713cb85111521470063f5 Mon Sep 17 00:00:00 2001 From: JC Franco Date: Fri, 27 Sep 2024 12:53:04 -0700 Subject: [PATCH] deprecate: deprecate `enforce-ref-last-prop` rule --- .../docs/enforce-ref-last-prop.md | 2 ++ .../src/rules/enforce-ref-last-prop.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/packages/eslint-plugin-calcite-components/docs/enforce-ref-last-prop.md b/packages/eslint-plugin-calcite-components/docs/enforce-ref-last-prop.md index 55528ecd2f7..c54081ede54 100644 --- a/packages/eslint-plugin-calcite-components/docs/enforce-ref-last-prop.md +++ b/packages/eslint-plugin-calcite-components/docs/enforce-ref-last-prop.md @@ -1,5 +1,7 @@ # enforce-ref-last-prop +**Deprecated** This rule is deprecated and will be removed in a future release. It is no longer needed if you are using Stencil 4.14.1 or greater. + This ensures the node passed into the `ref` callback is in sync with its JSX attributes/properties when invoked. Placing `ref` last helps work around a [Stencil bug](https://github.com/ionic-team/stencil/issues/4074) where the `ref` callback is invoked in the specified order and not after initializing the element with all its attributes/properties. This can cause attributes/properties to be outdated by the time the callback is invoked. diff --git a/packages/eslint-plugin-calcite-components/src/rules/enforce-ref-last-prop.ts b/packages/eslint-plugin-calcite-components/src/rules/enforce-ref-last-prop.ts index 17a040121ef..3d6776b2dd2 100644 --- a/packages/eslint-plugin-calcite-components/src/rules/enforce-ref-last-prop.ts +++ b/packages/eslint-plugin-calcite-components/src/rules/enforce-ref-last-prop.ts @@ -3,6 +3,7 @@ import type { JSXAttribute, JSXOpeningElement, JSXSpreadAttribute } from "@babel const rule: Rule.RuleModule = { meta: { + deprecated: true, docs: { description: `This ensures the node passed into the ref callback is in sync with its JSX attributes/properties when invoked.`, recommended: true,