Skip to content

feat: add no import expression eslint rule #22507

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

Closed
wants to merge 1 commit into from

Conversation

headwindz
Copy link
Contributor

Summary

This is a follow-up of PR #21918 and issue #21910 . It introduces a custom internal eslint rule to prevent dynamic import expression in literal.

How did you test this change?

  1. new tests are added.
  2. yarn test passes.
  3. yarn run eslint passes.
  4. When dynamic import expression is used in literal, E.g.
console.log(
     'lazy: Expected the result of a dynamic import() call. ' +
     "const MyComponent = lazy(() => import('./MyComponent'))"
);

it does report a lint error

@sizebot
Copy link

sizebot commented Oct 5, 2021

Comparing: f2c3811...908ba82

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 130.05 kB 130.05 kB = 41.34 kB 41.34 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 132.88 kB 132.88 kB = 42.30 kB 42.31 kB
facebook-www/ReactDOM-prod.classic.js = 413.66 kB 413.66 kB = 76.44 kB 76.44 kB
facebook-www/ReactDOM-prod.modern.js = 402.24 kB 402.24 kB = 74.71 kB 74.71 kB
facebook-www/ReactDOMForked-prod.classic.js = 413.66 kB 413.66 kB = 76.45 kB 76.45 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 908ba82

Copy link
Contributor

@Biki-das Biki-das left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

Copy link

This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.

@github-actions github-actions bot added the Resolution: Stale Automatically closed due to inactivity label Apr 10, 2024
@headwindz headwindz closed this Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Resolution: Stale Automatically closed due to inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants