Skip to content

Commit 6d1a76f

Browse files
iropoloiropolo
andauthored
fix(deprecated-component): NO-JIRA fix deprecated component regex (#1140)
Co-authored-by: iropolo <ignacio.ropolo@dialpad.com>
1 parent a9bb763 commit 6d1a76f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/eslint-plugin-dialtone/lib/rules/deprecated-component.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,16 @@ module.exports = {
6767
return {
6868
ImportDeclaration(node) {
6969
let foundIndex;
70+
const importPath = node.source.value.toLowerCase();
71+
72+
// Skip Dialtone's own component imports to avoid false positives
73+
if (importPath.includes('@dialpad/dialtone')) {
74+
return;
75+
}
7076

7177
deprecatedComponents.forEach(item => {
7278
const regex = new RegExp(`^.*/${item.fileName}(?:\\.vue)?$`, 'g');
73-
foundIndex = node.source.value.toLowerCase().search(regex);
79+
foundIndex = importPath.search(regex);
7480

7581
if (foundIndex !== -1) {
7682
context.report({

0 commit comments

Comments
 (0)