Skip to content
New issue

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

fix: doctor import checkups is not work for jsx and tsx files #754

Merged
merged 2 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/doctor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default async (api: IApi): Promise<IDoctorReport> => {
for (const file of sourceFiles) {
// skip non-javascript files
// TODO: support collect imports from style style pre-processor files
if (!/(?<!\.d)\.(j|t)s$/.test(file)) continue;
if (!/(?<!\.d)\.(j|t)sx?$/.test(file)) continue;

importsReport.push(
...(await api.applyPlugins({
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/doctor/errors/src/component.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './CamelCase'
6 changes: 3 additions & 3 deletions tests/fixtures/doctor/errors/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import orgAlias from '@org/alias';
import orgExternals from '@org/externals';
import alias from 'alias';
import path from 'child_process';
import esm from 'esm';
import externals from 'externals';
import hello from 'hello';
import BigCamelCase from './CamelCase';
import esm from 'esm';
import component from './component';
import './index.less';

// to avoid esbuild tree-shaking
Expand All @@ -17,6 +17,6 @@ console.log(
externals,
orgExternals,
path,
BigCamelCase,
component,
esm,
);
Loading