1
0
Fork 0
mirror of synced 2024-10-05 12:34:50 +13:00
budibase/eslint-local-rules/index.js

22 lines
629 B
JavaScript
Raw Normal View History

2023-11-18 02:39:52 +13:00
module.exports = {
"no-budibase-imports": {
create: function (context) {
return {
ImportDeclaration(node) {
const importPath = node.source.value
if (
/^@budibase\/[^/]+\/.*$/.test(importPath) &&
2024-02-06 06:26:39 +13:00
!["@budibase/backend-core/tests","@budibase/string-templates/js-helpers"].includes(importPath)
2023-11-18 02:39:52 +13:00
) {
context.report({
node,
2024-02-06 06:26:39 +13:00
message: `Importing from @budibase is not allowed, except for @budibase/backend-core/tests and @budibase/string-templates/js-helpers.`,
2023-11-18 02:39:52 +13:00
})
}
},
}
},
},
}