We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I am working with Deno Fresh project, where "index.js" "index.ts" are typically present in import paths:
import { t } from "/utils/i18n/index.ts";
In this case, current ts-unused-exports will produce false positives, when the exporting file name is "index.ts".
2 modules with unused exports /Users/me/my-project/utils/i18n/index.ts: Languages, t
To remove false positives in Deno projects, I suggest to add a new option. This will prevent removing "index.ts" from the file name during parsing.
argsParser.js:
... switch (optionName) { case '--allowUnusedEnums': newOptions.allowUnusedEnums = true; break; ... case '--keepIndex': newOptions.keepIndexInFileNames = true; break; ...
parser/index.js:
... var pathWithoutExtension = function (pathIn, extraOptions) { var parsed = path.parse(pathIn); if (!extraOptions.keepIndexInFileNames) { if (util_1.indexCandidates.some(function (i) { return pathIn.endsWith(i); })) return parsed.dir; } return path.join(parsed.dir, cleanFilename(pathIn)); }; ... return { path: pathWithoutExtension(path, extraOptions), fullPath: path, imports: imports, exports: exportNames, exportLocations: exportLocations, };
I'm not sure if this change is the best way, but at least in my Deno project just commentting out
if (util_1.indexCandidates.some(function (i) { return pathIn.endsWith(i); })) return parsed.dir;
part works fine.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi, I am working with Deno Fresh project, where "index.js" "index.ts" are typically present in import paths:
In this case, current ts-unused-exports will produce false positives, when the exporting file name is "index.ts".
To remove false positives in Deno projects, I suggest to add a new option.
This will prevent removing "index.ts" from the file name during parsing.
argsParser.js:
parser/index.js:
I'm not sure if this change is the best way, but at least in my Deno project just commentting out
part works fine.
The text was updated successfully, but these errors were encountered: