UNPKG

@dfinity/eslint-config-oisy-wallet

Version:

Shared ESLint configurations from the Oisy Wallet team

28 lines (26 loc) 586 B
module.exports = { meta: { type: "suggestion", docs: { description: "Disallow all relative imports", category: "Best Practices", recommended: false, }, messages: { noRelativeImports: "Relative imports are not allowed. Use an alias or absolute imports.", }, schema: [], }, create: (context) => ({ ImportDeclaration: (node) => { const path = node.source.value; if (path.startsWith("./")) { context.report({ node, messageId: "noRelativeImports", }); } }, }), };