Skip to content

feat(eslint-plugin-dialtone): DLT-3314 add deprecated-dialtone-component rule#1200

Merged
Brad Paugh (braddialpad) merged 2 commits intostagingfrom
feat/eslint-deprecated-dialtone-component
Apr 17, 2026
Merged

feat(eslint-plugin-dialtone): DLT-3314 add deprecated-dialtone-component rule#1200
Brad Paugh (braddialpad) merged 2 commits intostagingfrom
feat/eslint-deprecated-dialtone-component

Conversation

@braddialpad
Copy link
Copy Markdown
Contributor

@braddialpad Brad Paugh (braddialpad) commented Apr 15, 2026

Obligatory GIF (super important!)

Obligatory GIF

🛠️ Type Of Change

  • Feature

📖 Jira Ticket

DLT-3314

📖 Description

Adds a new ESLint rule deprecated-dialtone-component to eslint-plugin-dialtone that detects imports of deprecated Dialtone components and reports the correct replacement.

Two categories of deprecations are covered:

  • DtIcon — the generic icon wrapper component. Should be replaced with a direct named icon import (e.g. DtIconPhoneHangUp) from @dialpad/dialtone-icons/vue3.
  • DtRecipe* components — all recipe components that have been moved to standalone UI-Kit packages (@dialpad/callbarkit, @dialpad/chatkit, @dialpad/navigationkit, @dialpad/workflowkit) or promoted to core Dialtone (@dialpad/dialtone).

The rule operates on named ImportSpecifier nodes (not file paths), so it correctly flags only the deprecated name within a multi-import statement without flagging the whole import.

💡 Context

DtRecipe* components were deprecated in favour of UI-Kit packages (see the March 2026 release note). DtIcon is being deprecated in favour of direct icon imports for better tree-shaking and static analysability. This rule helps consumers of @dialpad/dialtone-vue catch usages that need to be migrated.

📝 Checklist

For all PRs:

  • I have ensured no private Dialpad links or info are in the code or pull request description (Dialtone is a public repo!).
  • I have reviewed my changes.
  • I have added all relevant documentation.
  • I have considered the performance impact of my change.

Adds an ESLint rule deprecated-dialtone-component that detects deprecated DtIcon and DtRecipe* imports, reports replacements, and includes implementation, documentation, and tests.

…ent rule

Detects imports of deprecated Dialtone components (DtRecipe* and DtIcon)
and suggests their replacements.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 035b29c0-f6a2-48de-8960-8fff41306d16

📥 Commits

Reviewing files that changed from the base of the PR and between 4edfd62 and 2e9ce7b.

📒 Files selected for processing (1)
  • packages/eslint-plugin-dialtone/lib/rules/deprecated-dialtone-component.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/eslint-plugin-dialtone/lib/rules/deprecated-dialtone-component.js

Walkthrough

Adds a new ESLint rule that flags deprecated Dialtone components (notably DtIcon and DtRecipe* variants) imported from @dialpad/dialtone or @dialpad/dialtone-vue, and documents replacement packages and import patterns.

Changes

Cohort / File(s) Summary
ESLint Rule Documentation
packages/eslint-plugin-dialtone/docs/rules/deprecated-dialtone-component.md
New documentation page describing the rule, mapping deprecated components to replacement packages (e.g., @dialpad/dialtone, @dialpad/callbarkit, @dialpad/chatkit, @dialpad/navigationkit, @dialpad/workflowkit), advising to replace DtIcon with direct imports from @dialpad/dialtone-icons/vue3, and including incorrect/correct import examples.
ESLint Rule Implementation
packages/eslint-plugin-dialtone/lib/rules/deprecated-dialtone-component.js
New rule module registering an ImportDeclaration visitor that matches Dialtone import sources (`^@dialpad/dialtone(?:-vue)?(?:$
Rule Tests
packages/eslint-plugin-dialtone/tests/lib/rules/deprecated-dialtone-component.js
Adds RuleTester suite with valid cases (non-deprecated imports, other packages, default import) and invalid cases asserting errors for DtIcon and various DtRecipe* deprecated imports across @dialpad/dialtone-vue and @dialpad/dialtone, including multi-specifier import scenarios.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/eslint-deprecated-dialtone-component

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/eslint-plugin-dialtone/lib/rules/deprecated-dialtone-component.js`:
- Around line 23-24: The rule's user-facing messages are hardcoded English;
replace the inline strings assigned to deprecatedDialtoneComponent and
deprecatedDtIcon with FTL localization key lookups (e.g., use a localization
helper or constants that reference FTL keys instead of literal English). Update
where the rule emits messages to pass the localization keys (and any
interpolation data like componentName, replacement, package) so message
formatting is done via the existing i18n/localization utility used elsewhere in
the plugin; ensure the keys follow the project's FTL naming convention and that
deprecatedDialtoneComponent and deprecatedDtIcon reference those keys rather
than raw strings.
- Around line 65-67: The current check using importPath.includes(...)
over-matches; update the condition in deprecated-dialtone-component.js to
perform anchored package matching on the importPath variable (e.g. test against
a regex like /^@dialpad\/dialtone(-vue)?(\/|$)/ or compare for exact equality or
startsWith followed by '/' or end-of-string) so only the exact packages
'@dialpad/dialtone-vue' or '@dialpad/dialtone' (and their direct subpaths) are
matched instead of any substring matches like '@dialpad/dialtone-icons/vue3'.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 52d2d191-3afb-4228-ba25-a6ad8426fac2

📥 Commits

Reviewing files that changed from the base of the PR and between 9971fc0 and 4edfd62.

📒 Files selected for processing (3)
  • packages/eslint-plugin-dialtone/docs/rules/deprecated-dialtone-component.md
  • packages/eslint-plugin-dialtone/lib/rules/deprecated-dialtone-component.js
  • packages/eslint-plugin-dialtone/tests/lib/rules/deprecated-dialtone-component.js

Comment thread packages/eslint-plugin-dialtone/lib/rules/deprecated-dialtone-component.js Outdated
…component.js

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@braddialpad Brad Paugh (braddialpad) merged commit c73b7ee into staging Apr 17, 2026
13 checks passed
@braddialpad Brad Paugh (braddialpad) deleted the feat/eslint-deprecated-dialtone-component branch April 17, 2026 22:35
Brad Paugh (braddialpad) pushed a commit that referenced this pull request Apr 17, 2026
# [1.12.0](eslint-plugin-dialtone/v1.11.2...eslint-plugin-dialtone/v1.12.0) (2026-04-17)

### Features

* **Eslint Plugin Dialtone:** DLT-3314 add deprecated-dialtone-component rule ([#1200](#1200)) ([c73b7ee](c73b7ee))
Brad Paugh (braddialpad) pushed a commit that referenced this pull request Apr 17, 2026
# [9.180.0](dialtone/v9.179.0...dialtone/v9.180.0) (2026-04-17)

### Bug Fixes

* **Rich Text Editor:** DP-179947 use URL as display text when inserting link without text ([#1202](#1202)) ([30f2504](30f2504))

### Documentation

* **Modal:** NO-JIRA fix code examples ([#1207](#1207)) ([aedd4a1](aedd4a1))

### Features

* **Eslint Plugin Dialtone:** DLT-3314 add deprecated-dialtone-component rule ([#1200](#1200)) ([c73b7ee](c73b7ee))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant