Skip to content

Commit

Permalink
also check exported member in diags
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx committed Sep 21, 2022
1 parent 17fea50 commit 4b831b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions glint/glint-hbs-imports-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,11 @@ const patchedRewriteDiagnostics = function (diagnostics, fileName) {
console.error('patchedRewriteDiagnostics');
const diags = rewriteDiagnostics.call(this, diagnostics, fileName);
diags.forEach((d) => {
const regex = /Cannot find module '(.*)' or its corresponding type declarations./;
const result = d.messageText.match?.(regex);
const regexs = [
/Cannot find module '(.*)' or its corresponding type declarations./,
/Namespace '(.*)' has no exported member/
];
const result = regexs.map(r => d.messageText.match?.(r)).find(r => r && result.length > 1)
if (result && result.length > 1) {
const importPath = result[1];
const rel = path.relative(cwd, d.file.fileName).replace(/\\/g, '/');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-hbs-imports",
"version": "0.5.9",
"version": "0.5.10",
"repository": {
"type": "git",
"url": "https://github.com/patricklx/ember-hbs-imports"
Expand Down

0 comments on commit 4b831b3

Please sign in to comment.