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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a8927ef
feat(packages): add tsconfig package
Dogdriip Jan 30, 2023
9151eed
refactor(tsconfig.script): move into packages/tsconfig
Dogdriip Jan 30, 2023
ddb1c88
feat(bezier-react): add tsconfig as deps
Dogdriip Jan 30, 2023
7c3a831
refactor(bezier-react): move eslintrc, tsconfig.eslint into package
Dogdriip Jan 30, 2023
5d5e77e
fix(bezier-react/eslintrc): resolve path, remove bezier-figma-plugin …
Dogdriip Jan 30, 2023
93457e2
feat(bezier-figma-plugin): move eslintrc into package
Dogdriip Jan 30, 2023
91ff270
feat(packages): add eslint-config-bezier
Dogdriip Jan 30, 2023
300e72f
feat(packages/*): use eslint-config-bezier
Dogdriip Jan 30, 2023
446689c
refactor(root): remove eslint config/plugin deps from root workspace
Dogdriip Jan 30, 2023
a6099c8
docs(readme): add tsconfig, eslint-config-bezier to table
Dogdriip Jan 30, 2023
d0620bd
refactor(eslint-config-bezier): remove eslint from deps
Dogdriip Jan 30, 2023
74f4119
chore(bezier-figma-plugin): add tsconfig deps
Dogdriip Jan 30, 2023
4bbf9b9
fix(eslint-config-bezier): devDeps to deps
Dogdriip Jan 30, 2023
56714d2
feat(root): add root eslintrc
Dogdriip Jan 30, 2023
be2822b
chore(packages): move config packages to supports (@inhibitor1217)
Dogdriip Feb 6, 2023
dfd72f2
fix(.eslintrc): remove redundant nextjs settings
Dogdriip Feb 6, 2023
997bcc9
feat(eslint-config-bezier): add eslintrc for config package itself
Dogdriip Feb 6, 2023
cead66a
Merge branch 'next-v1' into refactor/shared-tsconfig
Dogdriip Mar 2, 2023
e20dd81
fix(root): remove root .eslintrc
Dogdriip Mar 2, 2023
25e9bfc
fix(bezier-react/.eslintrc): fix import/order override path (@inhibit…
Dogdriip Mar 2, 2023
274e71b
chore(supports/eslint-config-bezier): remove eslintrc of itself
Dogdriip Mar 2, 2023
d25bf19
Merge branch 'next-v1' into refactor/shared-tsconfig
Dogdriip Mar 7, 2023
fc50c26
Revert "docs(readme): add tsconfig, eslint-config-bezier to table"
Dogdriip Mar 7, 2023
88ae450
feat(.vscode): add workspace settings for eslint
Dogdriip Mar 7, 2023
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
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"eslint.workingDirectories": [{ "mode": "auto" }]
}
20 changes: 4 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"private": true,
"license": "Apache-2.0",
"workspaces": [
"packages/*"
"packages/*",
"supports/*"
],
"scripts": {
"build": "turbo run build",
Expand All @@ -15,33 +16,20 @@
"storybook": "yarn workspace @channel.io/bezier-react storybook",
"update-snapshot": "yarn workspace @channel.io/bezier-react update-snapshot",
"pre-commit": "run-s verify lint-staged typecheck test",
"verify": "ts-node -P ./tsconfig.script.json scripts/check-yarn-version.ts",
"verify": "ts-node -P ./supports/tsconfig/script.json ./scripts/check-yarn-version.ts",
"lint-staged": "lint-staged",
"changeset": "changeset",
"prepare": "husky install"
},
"devDependencies": {
"@changesets/changelog-github": "^0.4.7",
"@changesets/cli": "^2.23.0",
"@channel.io/eslint-config": "^1.2.0",
"@channel.io/eslint-plugin": "^1.1.1",
"@channel.io/stylelint-config": "^1.2.0",
"@commitlint/cli": "^17.2.0",
"@commitlint/config-conventional": "^13.1.0",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^4.33.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^7.32.0",
"eslint-config-airbnb-typescript": "^12.3.1",
"eslint-import-resolver-typescript": "^2.5.0",
"eslint-import-resolver-webpack": "^0.10.1",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jest": "^22.21.0",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-storybook": "^0.5.11",
"eslint-config-bezier": "workspace:*",
"husky": "^6.0.0",
"lint-staged": "^13.0.3",
"npm-run-all": "^4.1.5",
Expand Down
17 changes: 17 additions & 0 deletions packages/bezier-figma-plugin/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -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. #

parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.eslint.json',
},
overrides: [
{
files: ['./**/*'],
rules: {
'no-restricted-imports': 'off',
'no-restricted-globals': 'off',
},
},
],
}
2 changes: 2 additions & 0 deletions packages/bezier-figma-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
"@types/react": "^18.0.9",
"@types/react-dom": "^18.0.5",
"css-loader": "^6.7.2",
"eslint-config-bezier": "workspace:*",
"html-webpack-inline-source-plugin": "^0.0.10",
"html-webpack-plugin": "^5.5.0",
"react-dev-utils": "^12.0.1",
"style-loader": "^3.3.1",
"ts-loader": "^9.3.0",
"tsconfig": "workspace:*",
"url-loader": "^4.1.1",
"webpack": "^5.72.1",
"webpack-cli": "^4.9.2"
Expand Down
13 changes: 13 additions & 0 deletions packages/bezier-figma-plugin/tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "tsconfig/eslint.json",
"include": [
".*.js",
"src/**/*",
"*.js",
"*.ts"
],
"exclude": [
"node_modules",
"dist",
]
}
14 changes: 2 additions & 12 deletions .eslintrc.js → packages/bezier-react/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
module.exports = {
root: true,
extends: [
'@channel.io/eslint-config',
'plugin:storybook/recommended',
],
extends: ['bezier'],
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.eslint.json',
Expand All @@ -17,7 +14,7 @@ module.exports = {
},
overrides: [
{
files: ['./packages/bezier-react/**/*'],
files: ['./packages/**/src/**/*'],
rules: {
'import/order': [
'error',
Expand Down Expand Up @@ -64,12 +61,5 @@ module.exports = {
],
},
},
{
files: ['./packages/bezier-figma-plugin/**/*'],
rules: {
'no-restricted-imports': 'off',
'no-restricted-globals': 'off',
},
},
],
}
3 changes: 3 additions & 0 deletions packages/bezier-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
"chromatic": "^6.11.4",
"core-js": "^3.8.1",
"cross-env": "^7.0.3",
"eslint-config-bezier": "workspace:*",
"eslint-plugin-storybook": "^0.5.11",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.6.3",
"jest-styled-components": "^7.1.1",
Expand All @@ -106,6 +108,7 @@
"rollup-plugin-visualizer": "^5.8.3",
"styled-components": "^5.3.5",
"ts-prune": "^0.10.3",
"tsconfig": "workspace:*",
"tsconfig-paths-webpack-plugin": "^3.5.2",
"tslib": "^2.3.1",
"ttypescript": "^1.5.13",
Expand Down
13 changes: 13 additions & 0 deletions packages/bezier-react/tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "tsconfig/eslint.json",
"include": [
".*.js",
"src/**/*",
"*.js",
"*.ts"
],
"exclude": [
"node_modules",
"build",
]
}
5 changes: 5 additions & 0 deletions supports/eslint-config-bezier/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
extends: [
'@channel.io/eslint-config',
],
}
21 changes: 21 additions & 0 deletions supports/eslint-config-bezier/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "eslint-config-bezier",
"main": "index.js",
"dependencies": {
"@channel.io/eslint-config": "^1.4.1",
"@channel.io/eslint-plugin": "^1.2.3",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"babel-eslint": "^8.2.6",
"eslint-config-airbnb-typescript": "^12.3.1",
"eslint-import-resolver-typescript": "^2.7.1",
"eslint-import-resolver-webpack": "^0.10.1",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^22.21.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"typescript": "^4.9.4"
}
}
8 changes: 8 additions & 0 deletions supports/tsconfig/eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"types": ["@types/node"],
"noEmit": true,
"allowJs": true
}
}
3 changes: 3 additions & 0 deletions supports/tsconfig/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "tsconfig"
}
3 changes: 2 additions & 1 deletion tsconfig.script.json → supports/tsconfig/script.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"resolveJsonModule": true,
"esModuleInterop": true,
"module": "CommonJS"
"module": "commonjs"
}
}
9 changes: 0 additions & 9 deletions tsconfig.eslint.json

This file was deleted.

6 changes: 0 additions & 6 deletions tsconfig.json

This file was deleted.

Loading