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

chore: adjust tsconfig #259

Merged
merged 1 commit into from
Jun 18, 2023
Merged

chore: adjust tsconfig #259

merged 1 commit into from
Jun 18, 2023

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Jun 18, 2023

fix https://github.com/react-component/image/pull/258/files#r1233237066

prettier-plugin-sort-imports 会移除非必要引入,作为组件库会 break 掉使用。例如创建一个 tmp.tsx 写以下代码:

import React from 'react';

export default () => <></>;

当 tsconfig 设置 "jsx": "preserve" 后,会被 prettier 掉成:

export default () => <></>;

编译后代码为:

export default (function () {
  return /*#__PURE__*/React.createElement(React.Fragment, null);
});

导致使用该库的用户报错 React 未定义,tsconfig 中设置 "jsx": "react" 即可。

@vercel
Copy link

vercel bot commented Jun 18, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
image ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 18, 2023 9:27am

@codecov
Copy link

codecov bot commented Jun 18, 2023

Codecov Report

Merging #259 (26e54eb) into master (0a3cb75) will not change coverage.
The diff coverage is n/a.

❗ Current head 26e54eb differs from pull request most recent head 1957a1c. Consider uploading reports for the commit 1957a1c to get more accurate results

@@           Coverage Diff           @@
##           master     #259   +/-   ##
=======================================
  Coverage   97.54%   97.54%           
=======================================
  Files          10       10           
  Lines         366      366           
  Branches      106      106           
=======================================
  Hits          357      357           
  Misses          9        9           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@zombieJ zombieJ merged commit c1796f5 into master Jun 18, 2023
@zombieJ zombieJ deleted the modify-config branch June 18, 2023 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant