@blumintinc/eslint-plugin-blumint 1.5.1 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js
CHANGED
|
@@ -137,15 +137,16 @@ exports.enforceExportedFunctionTypes = (0, createRule_1.createRule)({
|
|
|
137
137
|
function isTypeExported(typeName) {
|
|
138
138
|
const sourceCode = context.getSourceCode();
|
|
139
139
|
const program = sourceCode.ast;
|
|
140
|
-
// Check for imported types
|
|
141
|
-
|
|
140
|
+
// Check for imported types first - if found, return true immediately
|
|
141
|
+
// since imported types are already available to consumers
|
|
142
|
+
const hasImportedType = program.body.some((node) => {
|
|
142
143
|
if (node.type === utils_1.AST_NODE_TYPES.ImportDeclaration) {
|
|
143
144
|
return node.specifiers.some((specifier) => specifier.type === utils_1.AST_NODE_TYPES.ImportSpecifier &&
|
|
144
145
|
specifier.local.name === typeName);
|
|
145
146
|
}
|
|
146
147
|
return false;
|
|
147
148
|
});
|
|
148
|
-
if (
|
|
149
|
+
if (hasImportedType) {
|
|
149
150
|
return true;
|
|
150
151
|
}
|
|
151
152
|
// Check for exported type declarations
|