@talend/eslint-plugin
Advanced tools
Comparing version 0.3.0 to 0.4.0
{ | ||
"name": "@talend/eslint-plugin", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Contains internal rules used at Talend", | ||
@@ -20,5 +20,9 @@ "keywords": [ | ||
"devDependencies": { | ||
"@talend/scripts-config-cdn": "^6.9.1", | ||
"eslint": "^7.1.0", | ||
"mocha": "^7.2.0" | ||
}, | ||
"peerDependencies": { | ||
"@talend/scripts-config-cdn": "^6.9.1" | ||
}, | ||
"engines": { | ||
@@ -25,0 +29,0 @@ "node": ">=10.0.0" |
@@ -6,2 +6,5 @@ /** | ||
const modules = require('@talend/scripts-config-cdn/modules.json'); | ||
const modulesToCheck = Object.keys(modules); | ||
/** | ||
@@ -24,4 +27,8 @@ * Returns the name of the module imported or re-exported. | ||
function isTalendUI(packageName) { | ||
return modulesToCheck.find(package => packageName.startsWith(package)); | ||
} | ||
function checkAndReport(context, node, value, messageId) { | ||
if (!value.startsWith('@talend')) { | ||
if (!isTalendUI(value)) { | ||
return; | ||
@@ -33,3 +40,3 @@ } | ||
if (COMPONENTS.indexOf(splited[1]) !== -1) { | ||
max_length = 4 | ||
max_length = 4; | ||
should = `${should}/${splited[2]}/${splited[3]}`; | ||
@@ -36,0 +43,0 @@ } |
@@ -40,2 +40,6 @@ /** | ||
}, | ||
{ | ||
code: "import pendo from '@talend/ua/lib/pendo';", | ||
parser: require.resolve('babel-eslint'), | ||
}, | ||
], | ||
@@ -42,0 +46,0 @@ |
7447
164
3
3