1
0
Fork 0
mirror of synced 2024-07-03 21:40:55 +12:00
budibase/eslint-local-rules/index.js
2024-02-05 18:26:39 +01:00

22 lines
629 B
JavaScript

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