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

Move common tsconfig, eslintrc into seperate packages #1114

Merged
merged 24 commits into from
Mar 9, 2023

Conversation

Dogdriip
Copy link
Member

@Dogdriip Dogdriip commented Jan 30, 2023

Self Checklist

  • I wrote a PR title in English.
  • I added an appropriate label to the PR.
  • I wrote a commit message in English.
  • I wrote a commit message according to the Conventional Commits specification.
  • I added the appropriate changeset for the changes.
  • [Component] I wrote a unit test about the implementation.
  • [Component] I wrote a storybook document about the implementation.
  • [Component] I tested the implementation in various browsers.
    • Windows: Chrome, Edge, (Optional) Firefox
    • macOS: Chrome, Edge, Safari, (Optional) Firefox
  • [New Component] I added my username to the correct directory in the CODEOWNERS file.

Related Issue

Summary

  • 공통으로 사용되는 TypeScript 설정(tsconfig), ESLint(eslintrc)를 모노레포 내 별도의 패키지로 분리하고, 사용처에서 이를 사용합니다.
    • 다음 패키지를 추가합니다:
      • supports/tsconfig
      • supports/eslint-config-bezier

Details

graph BT
	subgraph root-workspace[root-workspace]
		direction BT
	  subgraph bezier-react[bezier-react]
			bezier-react-tsconfig-eslint-json[tsconfig.eslint.json]
			bezier-react-eslintrc-js[.eslintrc.js]
		end
	  subgraph bezier-figma-plugin[bezier-figma-plugin]
			bezier-figma-plugin-tsconfig-eslint-json[tsconfig.eslint.json]
			bezier-figma-plugin-eslintrc-js[.eslintrc.js]
		end
		subgraph tsconfig[tsconfig]
			eslint-json[eslint.json]
			script-json[script.json]
		end
		subgraph eslint-config-bezier[eslint-config-bezier]
			index.js[index.js]
		end
		channel-io-eslint-config(["@channel.io/eslint-config"])
		channel-io-eslint-plugin(["@channel.io/eslint-plugin"])

		bezier-react-tsconfig-eslint-json --> eslint-json
		bezier-react-eslintrc-js --> eslint-config-bezier
		bezier-figma-plugin-tsconfig-eslint-json --> eslint-json
		bezier-figma-plugin-eslintrc-js --> eslint-config-bezier

		eslint-config-bezier -.-> channel-io-eslint-config
		eslint-config-bezier -.-> channel-io-eslint-plugin

		deps([eslint, stylelint, ...])
	end
Loading

Breaking change or not (Yes/No)

No.

References

@Dogdriip Dogdriip added refactoring Issue or PR related to refactoring with no functional changes build Issue or PR related to build system labels Jan 30, 2023
@Dogdriip Dogdriip self-assigned this Jan 30, 2023
@changeset-bot
Copy link

changeset-bot bot commented Jan 30, 2023

⚠️ No Changeset found

Latest commit: 88ae450

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov
Copy link

codecov bot commented Jan 30, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (543632e) 78.00% compared to head (88ae450) 78.00%.

Additional details and impacted files
@@           Coverage Diff            @@
##           next-v1    #1114   +/-   ##
========================================
  Coverage    78.00%   78.00%           
========================================
  Files          291      291           
  Lines         3778     3778           
  Branches       833      833           
========================================
  Hits          2947     2947           
  Misses         537      537           
  Partials       294      294           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 30, 2023

Chromatic Report

🚀 Congratulations! Your build was successful!

"eslint-plugin-react-hooks": "^4.6.0",
"typescript": "^4.9.4"
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@@ -1,7 +1,8 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
Copy link
Contributor

Choose a reason for hiding this comment

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

👀

Copy link
Member Author

Choose a reason for hiding this comment

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

https://json-schema.org/ turbo 예제에서도 사용하고 있어서 일단 사용해 보았습니다. 원래 VSCode에서 파일명이 tsconfig*이면 잡아주는 것 같긴 한데, 이 파일은 그렇지 않아서 유용하다고 생각했습니다.

packages/tsconfig/package.json Outdated Show resolved Hide resolved
packages/bezier-react/.eslintrc.js Outdated Show resolved Hide resolved
@@ -0,0 +1,17 @@
module.exports = {
root: true,
extends: ['bezier'],
Copy link
Contributor

Choose a reason for hiding this comment

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

package 이름이 eslint-config-bezier 라서 bezier로 로드되는거죠?

Copy link
Member Author

Choose a reason for hiding this comment

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

넵 맞습니다!

The eslint-config- prefix can be omitted from the configuration name. For example, airbnb resolves as eslint-config-airbnb. #

@Dogdriip
Copy link
Member Author

Dogdriip commented Mar 2, 2023

image

IDE의 ESLint 설정을 모노레포 환경에 맞게 잡으려면 https://medium.com/devityoself/monorepo-eslint-vscode-6f5982c8404d 이 글과 같이 IDE별로 별도의 설정이 필요한데, .vscode/settings.json를 레포에 포함시키는 건 좋지 않을 것 같아서 어떻게 해야 할지 고민이네요 🤔

README.md Outdated Show resolved Hide resolved
@sungik-choi
Copy link
Contributor

sungik-choi commented Mar 6, 2023

image

IDE의 ESLint 설정을 모노레포 환경에 맞게 잡으려면 https://medium.com/devityoself/monorepo-eslint-vscode-6f5982c8404d 이 글과 같이 IDE별로 별도의 설정이 필요한데, .vscode/settings.json를 레포에 포함시키는 건 좋지 않을 것 같아서 어떻게 해야 할지 고민이네요 🤔

레포에 포함해도 괜찮다고 생각해요. https://github.com/Shopify/polaris/tree/main/.vscode 이런 예시들도 있구요.

@Dogdriip Dogdriip merged commit 82f6be3 into channel-io:next-v1 Mar 9, 2023
@Dogdriip Dogdriip deleted the refactor/shared-tsconfig branch March 9, 2023 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issue or PR related to build system refactoring Issue or PR related to refactoring with no functional changes
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants