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

Set noImplicitAny true in tsconfig.json #2070

Closed
yangwooseong opened this issue Mar 13, 2024 · 0 comments · Fixed by #2071
Closed

Set noImplicitAny true in tsconfig.json #2070

yangwooseong opened this issue Mar 13, 2024 · 0 comments · Fixed by #2071
Assignees
Labels
enhancement Issues or PR related to making existing features better

Comments

@yangwooseong
Copy link
Collaborator

Description

bezier-react 의 tsconfig.noImplicitAny 속성을 false 에서 true 로 변경하고 타입 에러가 뜨는 곳에 대응합니다.

Reasons for suggestion

noImplicitAny 는 true 가 권장됩니다. false 로 하면 any 를 암시적으로 사용하는 것을 허용해서 타입체크에서 발견못하는 버그가 생깁니다. 예를 들면 다음과 같은 경우입니다.

const sizeToValue = {
  's': 12,
  'm': 24,
}

const foo = (size: 's' | 'm' | 'l') => {
  // sizeToValue 가 'l'에 대한 맵핑이 없음에도 noImplicitAny 가 false 라면 any 로 잡히게 되어 타입체크가 통과됨
  const value = sizeToValue[size] 
} 

any에 대한 타입 체크가 강화되면 #2068 같은 버그도 사전에 방지될 것으로 예상됩니다.

Proposed solution

bezier-react 의 tsconfig.noImplicitAny 속성을 false 에서 true 로 변경

References

https://www.typescriptlang.org/tsconfig#noImplicitAny

@yangwooseong yangwooseong added the enhancement Issues or PR related to making existing features better label Mar 13, 2024
@sungik-choi sungik-choi self-assigned this Mar 13, 2024
sungik-choi added a commit that referenced this issue Mar 13, 2024
<!--
  How to write a good PR title:
- Follow [the Conventional Commits
specification](https://www.conventionalcommits.org/en/v1.0.0/).
  - Give as much context as necessary and as little as possible
  - Prefix it with [WIP] while it’s a work in progress
-->

## Self Checklist

- [x] I wrote a PR title in **English** and added an appropriate
**label** to the PR.
- [x] I wrote the commit message in **English** and to follow [**the
Conventional Commits
specification**](https://www.conventionalcommits.org/en/v1.0.0/).
- [x] I [added the
**changeset**](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md)
about the changes that needed to be released. (or didn't have to)
- [x] I wrote or updated **documentation** related to the changes. (or
didn't have to)
- [x] I wrote or updated **tests** related to the changes. (or didn't
have to)
- [x] I tested the changes in various browsers. (or didn't have to)
  - Windows: Chrome, Edge, (Optional) Firefox
  - macOS: Chrome, Edge, Safari, (Optional) Firefox

## Related Issue
<!-- Please link to issue if one exists -->

- Fixes #2070

## Summary
<!-- Please brief explanation of the changes made -->

Set `noImplicitAny` true in tsconfig.json

## Details
<!-- Please elaborate description of the changes -->

- 암시적 any 타입을 허용하지 않도록 변경하고, 발생한 타입 에러들을 수정합니다.
- 그 과정에서 누락되어 있었던 AvatarGroup의 AvatarSize 72에 해당하는 ellipsis 스타일을 추가합니다.

### Breaking change? (Yes/No)
<!-- If Yes, please describe the impact and migration path for users -->

No

## References
<!-- Please list any other resources or points the reviewer should be
aware of -->

- https://www.typescriptlang.org/tsconfig#strict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues or PR related to making existing features better
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants