Skip to content

Commit

Permalink
Move common tsconfig, eslintrc into seperate packages (#1114)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dogdriip committed Mar 9, 2023
1 parent 1fab303 commit 82f6be3
Show file tree
Hide file tree
Showing 16 changed files with 725 additions and 433 deletions.
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'],
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

0 comments on commit 82f6be3

Please sign in to comment.